comparison golomb.h @ 1362:f26d6b57e620 libavcodec

10l
author michaelni
date Sun, 13 Jul 2003 11:14:43 +0000
parents 8479b875a989
children 6d762acfff5d
comparison
equal deleted inserted replaced
1361:8479b875a989 1362:f26d6b57e620
218 UPDATE_CACHE(re, gb); 218 UPDATE_CACHE(re, gb);
219 buf=GET_CACHE(re, gb); 219 buf=GET_CACHE(re, gb);
220 220
221 log= av_log2(buf); 221 log= av_log2(buf);
222 222
223 if(log > 31-12){ 223 if(log > 31-11){
224 buf >>= log - k; 224 buf >>= log - k;
225 buf += (30-log)<<k; 225 buf += (30-log)<<k;
226 LAST_SKIP_BITS(re, gb, 32 + k - log); 226 LAST_SKIP_BITS(re, gb, 32 + k - log);
227 CLOSE_READER(re, gb); 227 CLOSE_READER(re, gb);
228 228
383 assert(i>=0); 383 assert(i>=0);
384 384
385 e= (i>>k) + 1; 385 e= (i>>k) + 1;
386 if(e<limit){ 386 if(e<limit){
387 put_bits(pb, e, 1); 387 put_bits(pb, e, 1);
388 put_bits(pb, k, i&((1<<k)-1)); 388 if(k)
389 put_bits(pb, k, i&((1<<k)-1));
389 }else{ 390 }else{
390 put_bits(pb, limit , 1); 391 put_bits(pb, limit , 1);
391 put_bits(pb, esc_len, i - 1); 392 put_bits(pb, esc_len, i - 1);
392 } 393 }
393 } 394 }