comparison golomb.h @ 9020:97b991a32b85 libavcodec

Fix get_ur_golomb_jpegls() with A32_BITSTREAM_READER If k==0, log==0 can indicate that the coded value uses more than MIN_CACHE_BITS bits. With MIN_CACHE_BITS==32, the fast branch is incorrectly taken in this case unless explicitly forbidden.
author mru
date Tue, 24 Feb 2009 01:41:44 +0000
parents 9218ef5d5afb
children 4cb7c65fc775
comparison
equal deleted inserted replaced
9019:895f99d00718 9020:97b991a32b85
271 UPDATE_CACHE(re, gb); 271 UPDATE_CACHE(re, gb);
272 buf=GET_CACHE(re, gb); 272 buf=GET_CACHE(re, gb);
273 273
274 log= av_log2(buf); 274 log= av_log2(buf);
275 275
276 if(log - k >= 32-MIN_CACHE_BITS && 32-log < limit){ 276 if(log - k >= 32-MIN_CACHE_BITS+(MIN_CACHE_BITS==32) && 32-log < limit){
277 buf >>= log - k; 277 buf >>= log - k;
278 buf += (30-log)<<k; 278 buf += (30-log)<<k;
279 LAST_SKIP_BITS(re, gb, 32 + k - log); 279 LAST_SKIP_BITS(re, gb, 32 + k - log);
280 CLOSE_READER(re, gb); 280 CLOSE_READER(re, gb);
281 281