# HG changeset patch # User michaelni # Date 1052951938 0 # Node ID 9fce515e9894dd5cf1ea69d346c0ef902485c471 # Parent 82e0e1b9c28311c14167a508a435117a7da03122 libmpeg2 style bitstream reader 17 vs 16 bit bugfix diff -r 82e0e1b9c283 -r 9fce515e9894 common.c --- a/common.c Wed May 14 17:46:55 2003 +0000 +++ b/common.c Wed May 14 22:38:58 2003 +0000 @@ -162,7 +162,7 @@ { OPEN_READER(re, s) UPDATE_CACHE(re, s) -// UPDATE_CACHE(re, s) + UPDATE_CACHE(re, s) CLOSE_READER(re, s) } #ifdef A32_BITSTREAM_READER diff -r 82e0e1b9c283 -r 9fce515e9894 common.h --- a/common.h Wed May 14 17:46:55 2003 +0000 +++ b/common.h Wed May 14 22:38:58 2003 +0000 @@ -546,7 +546,7 @@ #elif defined LIBMPEG2_BITSTREAM_READER //libmpeg2 like reader -# define MIN_CACHE_BITS 16 +# define MIN_CACHE_BITS 17 # define OPEN_READER(name, gb)\ int name##_bit_count=(gb)->bit_count;\ @@ -570,7 +570,7 @@ #else # 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##_buffer_ptr+=2;\ name##_bit_count-= 16;\