Commit 96ebc991 authored by michaelni's avatar michaelni

libmpeg2 style bitstream reader 17 vs 16 bit bugfix


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@1881 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 6861df00
...@@ -162,7 +162,7 @@ void init_get_bits(GetBitContext *s, ...@@ -162,7 +162,7 @@ void init_get_bits(GetBitContext *s,
{ {
OPEN_READER(re, s) OPEN_READER(re, s)
UPDATE_CACHE(re, s) UPDATE_CACHE(re, s)
// UPDATE_CACHE(re, s) UPDATE_CACHE(re, s)
CLOSE_READER(re, s) CLOSE_READER(re, s)
} }
#ifdef A32_BITSTREAM_READER #ifdef A32_BITSTREAM_READER
......
...@@ -546,7 +546,7 @@ static inline int get_bits_count(GetBitContext *s){ ...@@ -546,7 +546,7 @@ static inline int get_bits_count(GetBitContext *s){
#elif defined LIBMPEG2_BITSTREAM_READER #elif defined LIBMPEG2_BITSTREAM_READER
//libmpeg2 like reader //libmpeg2 like reader
# define MIN_CACHE_BITS 16 # define MIN_CACHE_BITS 17
# define OPEN_READER(name, gb)\ # define OPEN_READER(name, gb)\
int name##_bit_count=(gb)->bit_count;\ int name##_bit_count=(gb)->bit_count;\
...@@ -570,7 +570,7 @@ static inline int get_bits_count(GetBitContext *s){ ...@@ -570,7 +570,7 @@ static inline int get_bits_count(GetBitContext *s){
#else #else
# define UPDATE_CACHE(name, gb)\ # define UPDATE_CACHE(name, gb)\
if(name##_bit_count > 0){\ if(name##_bit_count >= 0){\
name##_cache+= ((name##_buffer_ptr[0]<<8) + name##_buffer_ptr[1]) << name##_bit_count;\ name##_cache+= ((name##_buffer_ptr[0]<<8) + name##_buffer_ptr[1]) << name##_bit_count;\
name##_buffer_ptr+=2;\ name##_buffer_ptr+=2;\
name##_bit_count-= 16;\ name##_bit_count-= 16;\
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment