30 #ifndef AVCODEC_GOLOMB_H
31 #define AVCODEC_GOLOMB_H
37 #define INVALID_VLC 0x80000000
71 if (CONFIG_FTRAPV && log < 0) {
156 if(range==1)
return 0;
157 else if(range==2)
return get_bits1(gb)^1;
200 if(buf&1) buf= -(buf>>1);
226 if((buf & 0xAAAAAAAA) == 0)
229 for(log=31; (buf & 0x80000000) == 0; log--){
230 buf = (buf << 2) - ((buf << log) >> (log - 1)) + (buf >> 30);
236 return (
signed) (((((buf << log) >> log) - 1) ^ -(buf & 0x1)) + 1) >> 1;
251 ret = (ret ^
buf) - buf;
287 return buf + limit - 1;
313 for (i = 0; i < limit &&
SHOW_UBITS(
re, gb, 1) == 0; i++) {
331 }
else if(i == limit - 1){
349 if (v&1)
return v>>1;
360 return (v>>1) ^ -(v&1);
395 print_bin(bits, len);
397 av_log(NULL,
AV_LOG_DEBUG,
"%5d %2d %3d ue @%5d in %s %s:%d\n", bits, len, i, pos, file, func, line);
411 print_bin(bits, len);
413 av_log(NULL,
AV_LOG_DEBUG,
"%5d %2d %3d se @%5d in %s %s:%d\n", bits, len, i, pos, file, func, line);
425 print_bin(bits, len);
427 av_log(NULL,
AV_LOG_DEBUG,
"%5d %2d %3d te @%5d in %s %s:%d\n", bits, len, i, pos, file, func, line);
432 #define get_ue_golomb(a) get_ue(a, __FILE__, __PRETTY_FUNCTION__, __LINE__)
433 #define get_se_golomb(a) get_se(a, __FILE__, __PRETTY_FUNCTION__, __LINE__)
434 #define get_te_golomb(a, r) get_te(a, r, __FILE__, __PRETTY_FUNCTION__, __LINE__)
435 #define get_te0_golomb(a, r) get_te(a, r, __FILE__, __PRETTY_FUNCTION__, __LINE__)
500 put_bits(pb, e + k + 1, (1<<k) + (i&((1<<k)-1)));
502 put_bits(pb, limit + esc_len, i - limit + 1);