Lines Matching refs:gb

53 static inline int get_ue_golomb(GetBitContext *gb)
58 buf = show_bits_long(gb, 32);
62 skip_bits_long(gb, ff_golomb_vlc_len[buf]);
68 skip_bits_long(gb, 32 - log);
77 OPEN_READER(re, gb);
78 UPDATE_CACHE(re, gb);
79 buf = GET_CACHE(re, gb);
83 LAST_SKIP_BITS(re, gb, ff_golomb_vlc_len[buf]);
84 CLOSE_READER(re, gb);
89 LAST_SKIP_BITS(re, gb, 32 - log);
90 CLOSE_READER(re, gb);
104 static inline unsigned get_ue_golomb_long(GetBitContext *gb)
108 buf = show_bits_long(gb, 32);
110 skip_bits_long(gb, log);
112 return get_bits_long(gb, log + 1) - 1;
120 static inline int get_ue_golomb_31(GetBitContext *gb)
125 buf = show_bits_long(gb, 32);
128 skip_bits_long(gb, ff_golomb_vlc_len[buf]);
131 OPEN_READER(re, gb);
132 UPDATE_CACHE(re, gb);
133 buf = GET_CACHE(re, gb);
136 LAST_SKIP_BITS(re, gb, ff_golomb_vlc_len[buf]);
137 CLOSE_READER(re, gb);
143 static inline unsigned get_interleaved_ue_golomb(GetBitContext *gb)
148 buf = show_bits_long(gb, 32);
152 skip_bits_long(gb, ff_interleaved_golomb_vlc_len[buf]);
160 skip_bits_long(gb, FFMIN(ff_interleaved_golomb_vlc_len[buf], 8));
168 buf = show_bits_long(gb, 32);
169 } while (get_bits_left(gb) > 0);
174 OPEN_READER(re, gb);
175 UPDATE_CACHE(re, gb);
176 buf = GET_CACHE(re, gb);
180 LAST_SKIP_BITS(re, gb, ff_interleaved_golomb_vlc_len[buf]);
181 CLOSE_READER(re, gb);
189 LAST_SKIP_BITS(re, gb,
198 UPDATE_CACHE(re, gb);
199 buf = GET_CACHE(re, gb);
200 } while (ret<0x8000000U && BITS_AVAILABLE(re, gb));
202 CLOSE_READER(re, gb);
211 static inline int get_te0_golomb(GetBitContext *gb, int range)
218 return get_bits1(gb) ^ 1;
220 return get_ue_golomb(gb);
226 static inline int get_te_golomb(GetBitContext *gb, int range)
231 return get_bits1(gb) ^ 1;
233 return get_ue_golomb(gb);
239 static inline int get_se_golomb(GetBitContext *gb)
244 buf = show_bits_long(gb, 32);
248 skip_bits_long(gb, ff_golomb_vlc_len[buf]);
255 skip_bits_long(gb, 32 - log);
265 OPEN_READER(re, gb);
266 UPDATE_CACHE(re, gb);
267 buf = GET_CACHE(re, gb);
271 LAST_SKIP_BITS(re, gb, ff_golomb_vlc_len[buf]);
272 CLOSE_READER(re, gb);
277 LAST_SKIP_BITS(re, gb, 31 - log);
278 UPDATE_CACHE(re, gb);
279 buf = GET_CACHE(re, gb);
283 LAST_SKIP_BITS(re, gb, 32 - log);
284 CLOSE_READER(re, gb);
294 static inline int get_se_golomb_long(GetBitContext *gb)
296 unsigned int buf = get_ue_golomb_long(gb);
301 static inline int get_interleaved_se_golomb(GetBitContext *gb)
306 buf = show_bits_long(gb, 32);
310 skip_bits_long(gb, ff_interleaved_golomb_vlc_len[buf]);
315 skip_bits(gb, 8);
316 buf |= 1 | show_bits(gb, 24);
324 skip_bits_long(gb, 63 - 2 * log - 8);
329 OPEN_READER(re, gb);
330 UPDATE_CACHE(re, gb);
331 buf = GET_CACHE(re, gb);
335 LAST_SKIP_BITS(re, gb, ff_interleaved_golomb_vlc_len[buf]);
336 CLOSE_READER(re, gb);
341 LAST_SKIP_BITS(re, gb, 8);
342 UPDATE_CACHE(re, gb);
343 buf |= 1 | (GET_CACHE(re, gb) >> 8);
351 LAST_SKIP_BITS(re, gb, 63 - 2 * log - 8);
352 CLOSE_READER(re, gb);
359 static inline int dirac_get_se_golomb(GetBitContext *gb)
361 uint32_t ret = get_interleaved_ue_golomb(gb);
364 int sign = -get_bits1(gb);
374 static inline int get_ur_golomb(GetBitContext *gb, int k, int limit,
381 buf = show_bits_long(gb, 32);
388 skip_bits_long(gb, 32 + k - log);
392 skip_bits_long(gb, limit);
393 buf = get_bits_long(gb, esc_len);
398 OPEN_READER(re, gb);
399 UPDATE_CACHE(re, gb);
400 buf = GET_CACHE(re, gb);
407 LAST_SKIP_BITS(re, gb, 32 + k - log);
408 CLOSE_READER(re, gb);
412 LAST_SKIP_BITS(re, gb, limit);
413 UPDATE_CACHE(re, gb);
415 buf = SHOW_UBITS(re, gb, esc_len);
417 LAST_SKIP_BITS(re, gb, esc_len);
418 CLOSE_READER(re, gb);
428 static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit,
435 buf = show_bits_long(gb, 32);
442 skip_bits_long(gb, 32 + k - log);
448 i < limit && get_bits1(gb) == 0 && get_bits_left(gb) > 0;
452 buf = get_bits_long(gb, k);
456 buf = get_bits_long(gb, esc_len);
463 OPEN_READER(re, gb);
464 UPDATE_CACHE(re, gb);
465 buf = GET_CACHE(re, gb);
475 LAST_SKIP_BITS(re, gb, 32 + k - log);
476 CLOSE_READER(re, gb);
481 for (i = 0; i + MIN_CACHE_BITS <= limit && SHOW_UBITS(re, gb, MIN_CACHE_BITS) == 0; i += MIN_CACHE_BITS) {
482 if (gb->size_in_bits <= re_index) {
483 CLOSE_READER(re, gb);
486 LAST_SKIP_BITS(re, gb, MIN_CACHE_BITS);
487 UPDATE_CACHE(re, gb);
489 for (; i < limit && SHOW_UBITS(re, gb, 1) == 0; i++) {
490 SKIP_BITS(re, gb, 1);
492 LAST_SKIP_BITS(re, gb, 1);
493 UPDATE_CACHE(re, gb);
498 buf = SHOW_UBITS(re, gb, 16) << (k-16);
499 LAST_SKIP_BITS(re, gb, 16);
500 UPDATE_CACHE(re, gb);
501 buf |= SHOW_UBITS(re, gb, k-16);
502 LAST_SKIP_BITS(re, gb, k-16);
504 buf = SHOW_UBITS(re, gb, k);
505 LAST_SKIP_BITS(re, gb, k);
513 buf = SHOW_UBITS(re, gb, esc_len);
514 LAST_SKIP_BITS(re, gb, esc_len);
520 CLOSE_READER(re, gb);
529 static inline int get_sr_golomb(GetBitContext *gb, int k, int limit,
532 unsigned v = get_ur_golomb(gb, k, limit, esc_len);
539 static inline int get_sr_golomb_flac(GetBitContext *gb, int k, int limit,
542 unsigned v = get_ur_golomb_jpegls(gb, k, limit, esc_len);
549 static inline unsigned int get_ur_golomb_shorten(GetBitContext *gb, int k)
551 return get_ur_golomb_jpegls(gb, k, INT_MAX, 0);
557 static inline int get_sr_golomb_shorten(GetBitContext *gb, int k)
559 int uvar = get_ur_golomb_jpegls(gb, k + 1, INT_MAX, 0);