diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-01-19 16:03:38 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-01-19 16:03:38 +0300 |
commit | 895345da9a45175c4cd6a72d6137218074423df8 (patch) | |
tree | 70c31afd702f4eb60d91b64b1fd2e7f3f35ce0d4 /libavcodec/golomb.h | |
parent | 61f040dd1abe37da2e365d26909ce48c6644bf1a (diff) |
svq3_get_se_golomb() fix
Originally committed as revision 3849 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/golomb.h')
-rw-r--r-- | libavcodec/golomb.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h index fdf97bc740..9f89502fa6 100644 --- a/libavcodec/golomb.h +++ b/libavcodec/golomb.h @@ -167,7 +167,10 @@ static inline int svq3_get_se_golomb(GetBitContext *gb){ return ff_interleaved_se_golomb_vlc_code[buf]; }else{ - buf |=1; + LAST_SKIP_BITS(re, gb, 8); + UPDATE_CACHE(re, gb); + buf |= 1 | (GET_CACHE(re, gb) >> 8); + if((buf & 0xAAAAAAAA) == 0) return INVALID_VLC; @@ -175,7 +178,7 @@ static inline int svq3_get_se_golomb(GetBitContext *gb){ buf = (buf << 2) - ((buf << log) >> (log - 1)) + (buf >> 30); } - LAST_SKIP_BITS(re, gb, 63 - 2*log); + LAST_SKIP_BITS(re, gb, 63 - 2*log - 8); CLOSE_READER(re, gb); return (signed) (((((buf << log) >> log) - 1) ^ -(buf & 0x1)) + 1) >> 1; |