summaryrefslogtreecommitdiff
path: root/libavcodec/golomb.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-06-19 01:14:13 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-06-19 01:14:13 +0000
commitcceb990ef9a62ad07108342057380a19183b9520 (patch)
treef20bf57a2299fa7ae1975aef19a080aed380a4ae /libavcodec/golomb.h
parent6258c7e6749278cadae7971d1f2c1f340a39a0d4 (diff)
1000l to the ffsvq3 author, our default bitstream reader is only guranteed to be able to read 25bit at a time
Originally committed as revision 3237 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/golomb.h')
-rw-r--r--libavcodec/golomb.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index cd8bdd38d5..847128c8a6 100644
--- a/libavcodec/golomb.h
+++ b/libavcodec/golomb.h
@@ -80,7 +80,10 @@ static inline int svq3_get_ue_golomb(GetBitContext *gb){
return ff_interleaved_ue_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;
@@ -88,7 +91,7 @@ static inline int svq3_get_ue_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 ((buf << log) >> log) - 1;