From 6fa6c481b91f833c212d88e6206e088aad8437d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20T=C3=A4uber?= Date: Fri, 11 Sep 2009 06:25:36 +0000 Subject: [PATCH] =?UTF-8?q?Make=20get=5Fur=5Fgolomb=20capable=20of=20readi?= =?UTF-8?q?ng=2016=20bit=20values.=20Patch=20by=20Lars=20T=C3=A4uber:=20fi?= =?UTF-8?q?rstname=20taeuber=20gmx=20net?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally committed as revision 19821 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/golomb.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h index 7044042c95..c227607f1f 100644 --- a/libavcodec/golomb.h +++ b/libavcodec/golomb.h @@ -253,8 +253,12 @@ static inline int get_ur_golomb(GetBitContext *gb, int k, int limit, int esc_len return buf; }else{ - buf >>= 32 - limit - esc_len; - LAST_SKIP_BITS(re, gb, esc_len + limit); + LAST_SKIP_BITS(re, gb, limit); + UPDATE_CACHE(re, gb); + + buf = SHOW_UBITS(re, gb, esc_len); + + LAST_SKIP_BITS(re, gb, esc_len); CLOSE_READER(re, gb); return buf + limit - 1;