FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
get_bits.h
Go to the documentation of this file.
1 /*
2  * copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 /**
22  * @file
23  * bitstream reader API header.
24  */
25 
26 #ifndef AVCODEC_GET_BITS_H
27 #define AVCODEC_GET_BITS_H
28 
29 #include <stdint.h>
30 
31 #include "libavutil/common.h"
32 #include "libavutil/intreadwrite.h"
33 #include "libavutil/log.h"
34 #include "libavutil/avassert.h"
35 #include "mathops.h"
36 #include "vlc.h"
37 
38 /*
39  * Safe bitstream reading:
40  * optionally, the get_bits API can check to ensure that we
41  * don't read past input buffer boundaries. This is protected
42  * with CONFIG_SAFE_BITSTREAM_READER at the global level, and
43  * then below that with UNCHECKED_BITSTREAM_READER at the per-
44  * decoder level. This means that decoders that check internally
45  * can "#define UNCHECKED_BITSTREAM_READER 1" to disable
46  * overread checks.
47  * Boundary checking causes a minor performance penalty so for
48  * applications that won't want/need this, it can be disabled
49  * globally using "#define CONFIG_SAFE_BITSTREAM_READER 0".
50  */
51 #ifndef UNCHECKED_BITSTREAM_READER
52 #define UNCHECKED_BITSTREAM_READER !CONFIG_SAFE_BITSTREAM_READER
53 #endif
54 
55 typedef struct GetBitContext {
57  int index;
61 
62 /* Bitstream reader API docs:
63  * name
64  * arbitrary name which is used as prefix for the internal variables
65  *
66  * gb
67  * getbitcontext
68  *
69  * OPEN_READER(name, gb)
70  * load gb into local variables
71  *
72  * CLOSE_READER(name, gb)
73  * store local vars in gb
74  *
75  * UPDATE_CACHE(name, gb)
76  * Refill the internal cache from the bitstream.
77  * After this call at least MIN_CACHE_BITS will be available.
78  *
79  * GET_CACHE(name, gb)
80  * Will output the contents of the internal cache,
81  * next bit is MSB of 32 or 64 bits (FIXME 64 bits).
82  *
83  * SHOW_UBITS(name, gb, num)
84  * Will return the next num bits.
85  *
86  * SHOW_SBITS(name, gb, num)
87  * Will return the next num bits and do sign extension.
88  *
89  * SKIP_BITS(name, gb, num)
90  * Will skip over the next num bits.
91  * Note, this is equivalent to SKIP_CACHE; SKIP_COUNTER.
92  *
93  * SKIP_CACHE(name, gb, num)
94  * Will remove the next num bits from the cache (note SKIP_COUNTER
95  * MUST be called before UPDATE_CACHE / CLOSE_READER).
96  *
97  * SKIP_COUNTER(name, gb, num)
98  * Will increment the internal bit counter (see SKIP_CACHE & SKIP_BITS).
99  *
100  * LAST_SKIP_BITS(name, gb, num)
101  * Like SKIP_BITS, to be used if next call is UPDATE_CACHE or CLOSE_READER.
102  *
103  * BITS_LEFT(name, gb)
104  * Return the number of bits left
105  *
106  * For examples see get_bits, show_bits, skip_bits, get_vlc.
107  */
108 
109 #ifdef LONG_BITSTREAM_READER
110 # define MIN_CACHE_BITS 32
111 #else
112 # define MIN_CACHE_BITS 25
113 #endif
114 
115 #define OPEN_READER_NOSIZE(name, gb) \
116  unsigned int name ## _index = (gb)->index; \
117  unsigned int av_unused name ## _cache
118 
119 #if UNCHECKED_BITSTREAM_READER
120 #define OPEN_READER(name, gb) OPEN_READER_NOSIZE(name, gb)
121 
122 #define BITS_AVAILABLE(name, gb) 1
123 #else
124 #define OPEN_READER(name, gb) \
125  OPEN_READER_NOSIZE(name, gb); \
126  unsigned int name ## _size_plus8 = (gb)->size_in_bits_plus8
127 
128 #define BITS_AVAILABLE(name, gb) name ## _index < name ## _size_plus8
129 #endif
130 
131 #define CLOSE_READER(name, gb) (gb)->index = name ## _index
132 
133 # ifdef LONG_BITSTREAM_READER
134 
135 # define UPDATE_CACHE_LE(name, gb) name ## _cache = \
136  AV_RL64((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7)
137 
138 # define UPDATE_CACHE_BE(name, gb) name ## _cache = \
139  AV_RB64((gb)->buffer + (name ## _index >> 3)) >> (32 - (name ## _index & 7))
140 
141 #else
142 
143 # define UPDATE_CACHE_LE(name, gb) name ## _cache = \
144  AV_RL32((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7)
145 
146 # define UPDATE_CACHE_BE(name, gb) name ## _cache = \
147  AV_RB32((gb)->buffer + (name ## _index >> 3)) << (name ## _index & 7)
148 
149 #endif
150 
151 
152 #ifdef BITSTREAM_READER_LE
153 
154 # define UPDATE_CACHE(name, gb) UPDATE_CACHE_LE(name, gb)
155 
156 # define SKIP_CACHE(name, gb, num) name ## _cache >>= (num)
157 
158 #else
159 
160 # define UPDATE_CACHE(name, gb) UPDATE_CACHE_BE(name, gb)
161 
162 # define SKIP_CACHE(name, gb, num) name ## _cache <<= (num)
163 
164 #endif
165 
166 #if UNCHECKED_BITSTREAM_READER
167 # define SKIP_COUNTER(name, gb, num) name ## _index += (num)
168 #else
169 # define SKIP_COUNTER(name, gb, num) \
170  name ## _index = FFMIN(name ## _size_plus8, name ## _index + (num))
171 #endif
172 
173 #define BITS_LEFT(name, gb) ((int)((gb)->size_in_bits - name ## _index))
174 
175 #define SKIP_BITS(name, gb, num) \
176  do { \
177  SKIP_CACHE(name, gb, num); \
178  SKIP_COUNTER(name, gb, num); \
179  } while (0)
180 
181 #define LAST_SKIP_BITS(name, gb, num) SKIP_COUNTER(name, gb, num)
182 
183 #define SHOW_UBITS_LE(name, gb, num) zero_extend(name ## _cache, num)
184 #define SHOW_SBITS_LE(name, gb, num) sign_extend(name ## _cache, num)
185 
186 #define SHOW_UBITS_BE(name, gb, num) NEG_USR32(name ## _cache, num)
187 #define SHOW_SBITS_BE(name, gb, num) NEG_SSR32(name ## _cache, num)
188 
189 #ifdef BITSTREAM_READER_LE
190 # define SHOW_UBITS(name, gb, num) SHOW_UBITS_LE(name, gb, num)
191 # define SHOW_SBITS(name, gb, num) SHOW_SBITS_LE(name, gb, num)
192 #else
193 # define SHOW_UBITS(name, gb, num) SHOW_UBITS_BE(name, gb, num)
194 # define SHOW_SBITS(name, gb, num) SHOW_SBITS_BE(name, gb, num)
195 #endif
196 
197 #define GET_CACHE(name, gb) ((uint32_t) name ## _cache)
198 
199 static inline int get_bits_count(const GetBitContext *s)
200 {
201  return s->index;
202 }
203 
204 static inline void skip_bits_long(GetBitContext *s, int n)
205 {
206 #if UNCHECKED_BITSTREAM_READER
207  s->index += n;
208 #else
209  s->index += av_clip(n, -s->index, s->size_in_bits_plus8 - s->index);
210 #endif
211 }
212 
213 /**
214  * Read MPEG-1 dc-style VLC (sign bit + mantissa with no MSB).
215  * if MSB not set it is negative
216  * @param n length in bits
217  */
218 static inline int get_xbits(GetBitContext *s, int n)
219 {
220  register int sign;
221  register int32_t cache;
222  OPEN_READER(re, s);
223  av_assert2(n>0 && n<=25);
224  UPDATE_CACHE(re, s);
225  cache = GET_CACHE(re, s);
226  sign = ~cache >> 31;
227  LAST_SKIP_BITS(re, s, n);
228  CLOSE_READER(re, s);
229  return (NEG_USR32(sign ^ cache, n) ^ sign) - sign;
230 }
231 
232 static inline int get_sbits(GetBitContext *s, int n)
233 {
234  register int tmp;
235  OPEN_READER(re, s);
236  av_assert2(n>0 && n<=25);
237  UPDATE_CACHE(re, s);
238  tmp = SHOW_SBITS(re, s, n);
239  LAST_SKIP_BITS(re, s, n);
240  CLOSE_READER(re, s);
241  return tmp;
242 }
243 
244 /**
245  * Read 1-25 bits.
246  */
247 static inline unsigned int get_bits(GetBitContext *s, int n)
248 {
249  register int tmp;
250  OPEN_READER(re, s);
251  av_assert2(n>0 && n<=25);
252  UPDATE_CACHE(re, s);
253  tmp = SHOW_UBITS(re, s, n);
254  LAST_SKIP_BITS(re, s, n);
255  CLOSE_READER(re, s);
256  return tmp;
257 }
258 
259 /**
260  * Read 0-25 bits.
261  */
263 {
264  return n ? get_bits(s, n) : 0;
265 }
266 
267 static inline unsigned int get_bits_le(GetBitContext *s, int n)
268 {
269  register int tmp;
270  OPEN_READER(re, s);
271  av_assert2(n>0 && n<=25);
272  UPDATE_CACHE_LE(re, s);
273  tmp = SHOW_UBITS_LE(re, s, n);
274  LAST_SKIP_BITS(re, s, n);
275  CLOSE_READER(re, s);
276  return tmp;
277 }
278 
279 /**
280  * Show 1-25 bits.
281  */
282 static inline unsigned int show_bits(GetBitContext *s, int n)
283 {
284  register int tmp;
286  av_assert2(n>0 && n<=25);
287  UPDATE_CACHE(re, s);
288  tmp = SHOW_UBITS(re, s, n);
289  return tmp;
290 }
291 
292 static inline void skip_bits(GetBitContext *s, int n)
293 {
294  OPEN_READER(re, s);
295  LAST_SKIP_BITS(re, s, n);
296  CLOSE_READER(re, s);
297 }
298 
299 static inline unsigned int get_bits1(GetBitContext *s)
300 {
301  unsigned int index = s->index;
302  uint8_t result = s->buffer[index >> 3];
303 #ifdef BITSTREAM_READER_LE
304  result >>= index & 7;
305  result &= 1;
306 #else
307  result <<= index & 7;
308  result >>= 8 - 1;
309 #endif
310 #if !UNCHECKED_BITSTREAM_READER
311  if (s->index < s->size_in_bits_plus8)
312 #endif
313  index++;
314  s->index = index;
315 
316  return result;
317 }
318 
319 static inline unsigned int show_bits1(GetBitContext *s)
320 {
321  return show_bits(s, 1);
322 }
323 
324 static inline void skip_bits1(GetBitContext *s)
325 {
326  skip_bits(s, 1);
327 }
328 
329 /**
330  * Read 0-32 bits.
331  */
332 static inline unsigned int get_bits_long(GetBitContext *s, int n)
333 {
334  if (!n) {
335  return 0;
336  } else if (n <= MIN_CACHE_BITS) {
337  return get_bits(s, n);
338  } else {
339 #ifdef BITSTREAM_READER_LE
340  unsigned ret = get_bits(s, 16);
341  return ret | (get_bits(s, n - 16) << 16);
342 #else
343  unsigned ret = get_bits(s, 16) << (n - 16);
344  return ret | get_bits(s, n - 16);
345 #endif
346  }
347 }
348 
349 /**
350  * Read 0-64 bits.
351  */
352 static inline uint64_t get_bits64(GetBitContext *s, int n)
353 {
354  if (n <= 32) {
355  return get_bits_long(s, n);
356  } else {
357 #ifdef BITSTREAM_READER_LE
358  uint64_t ret = get_bits_long(s, 32);
359  return ret | (uint64_t) get_bits_long(s, n - 32) << 32;
360 #else
361  uint64_t ret = (uint64_t) get_bits_long(s, n - 32) << 32;
362  return ret | get_bits_long(s, 32);
363 #endif
364  }
365 }
366 
367 /**
368  * Read 0-32 bits as a signed integer.
369  */
370 static inline int get_sbits_long(GetBitContext *s, int n)
371 {
372  // sign_extend(x, 0) is undefined
373  if (!n)
374  return 0;
375 
376  return sign_extend(get_bits_long(s, n), n);
377 }
378 
379 /**
380  * Show 0-32 bits.
381  */
382 static inline unsigned int show_bits_long(GetBitContext *s, int n)
383 {
384  if (n <= MIN_CACHE_BITS) {
385  return show_bits(s, n);
386  } else {
387  GetBitContext gb = *s;
388  return get_bits_long(&gb, n);
389  }
390 }
391 
392 static inline int check_marker(void *logctx, GetBitContext *s, const char *msg)
393 {
394  int bit = get_bits1(s);
395  if (!bit)
396  av_log(logctx, AV_LOG_INFO, "Marker bit missing at %d of %d %s\n",
397  get_bits_count(s) - 1, s->size_in_bits, msg);
398 
399  return bit;
400 }
401 
402 /**
403  * Initialize GetBitContext.
404  * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes
405  * larger than the actual read bits because some optimized bitstream
406  * readers read 32 or 64 bit at once and could read over the end
407  * @param bit_size the size of the buffer in bits
408  * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
409  */
410 static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
411  int bit_size)
412 {
413  int buffer_size;
414  int ret = 0;
415 
416  if (bit_size >= INT_MAX - 7 || bit_size < 0 || !buffer) {
417  bit_size = 0;
418  buffer = NULL;
419  ret = AVERROR_INVALIDDATA;
420  }
421 
422  buffer_size = (bit_size + 7) >> 3;
423 
424  s->buffer = buffer;
425  s->size_in_bits = bit_size;
426  s->size_in_bits_plus8 = bit_size + 8;
427  s->buffer_end = buffer + buffer_size;
428  s->index = 0;
429 
430  return ret;
431 }
432 
433 /**
434  * Initialize GetBitContext.
435  * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes
436  * larger than the actual read bits because some optimized bitstream
437  * readers read 32 or 64 bit at once and could read over the end
438  * @param byte_size the size of the buffer in bytes
439  * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
440  */
441 static inline int init_get_bits8(GetBitContext *s, const uint8_t *buffer,
442  int byte_size)
443 {
444  if (byte_size > INT_MAX / 8 || byte_size < 0)
445  byte_size = -1;
446  return init_get_bits(s, buffer, byte_size * 8);
447 }
448 
449 static inline const uint8_t *align_get_bits(GetBitContext *s)
450 {
451  int n = -get_bits_count(s) & 7;
452  if (n)
453  skip_bits(s, n);
454  return s->buffer + (s->index >> 3);
455 }
456 
457 /**
458  * If the vlc code is invalid and max_depth=1, then no bits will be removed.
459  * If the vlc code is invalid and max_depth>1, then the number of bits removed
460  * is undefined.
461  */
462 #define GET_VLC(code, name, gb, table, bits, max_depth) \
463  do { \
464  int n, nb_bits; \
465  unsigned int index; \
466  \
467  index = SHOW_UBITS(name, gb, bits); \
468  code = table[index][0]; \
469  n = table[index][1]; \
470  \
471  if (max_depth > 1 && n < 0) { \
472  LAST_SKIP_BITS(name, gb, bits); \
473  UPDATE_CACHE(name, gb); \
474  \
475  nb_bits = -n; \
476  \
477  index = SHOW_UBITS(name, gb, nb_bits) + code; \
478  code = table[index][0]; \
479  n = table[index][1]; \
480  if (max_depth > 2 && n < 0) { \
481  LAST_SKIP_BITS(name, gb, nb_bits); \
482  UPDATE_CACHE(name, gb); \
483  \
484  nb_bits = -n; \
485  \
486  index = SHOW_UBITS(name, gb, nb_bits) + code; \
487  code = table[index][0]; \
488  n = table[index][1]; \
489  } \
490  } \
491  SKIP_BITS(name, gb, n); \
492  } while (0)
493 
494 #define GET_RL_VLC(level, run, name, gb, table, bits, \
495  max_depth, need_update) \
496  do { \
497  int n, nb_bits; \
498  unsigned int index; \
499  \
500  index = SHOW_UBITS(name, gb, bits); \
501  level = table[index].level; \
502  n = table[index].len; \
503  \
504  if (max_depth > 1 && n < 0) { \
505  SKIP_BITS(name, gb, bits); \
506  if (need_update) { \
507  UPDATE_CACHE(name, gb); \
508  } \
509  \
510  nb_bits = -n; \
511  \
512  index = SHOW_UBITS(name, gb, nb_bits) + level; \
513  level = table[index].level; \
514  n = table[index].len; \
515  if (max_depth > 2 && n < 0) { \
516  LAST_SKIP_BITS(name, gb, nb_bits); \
517  if (need_update) { \
518  UPDATE_CACHE(name, gb); \
519  } \
520  nb_bits = -n; \
521  \
522  index = SHOW_UBITS(name, gb, nb_bits) + level; \
523  level = table[index].level; \
524  n = table[index].len; \
525  } \
526  } \
527  run = table[index].run; \
528  SKIP_BITS(name, gb, n); \
529  } while (0)
530 
531 /**
532  * Parse a vlc code.
533  * @param bits is the number of bits which will be read at once, must be
534  * identical to nb_bits in init_vlc()
535  * @param max_depth is the number of times bits bits must be read to completely
536  * read the longest vlc code
537  * = (max_vlc_length + bits - 1) / bits
538  */
540  int bits, int max_depth)
541 {
542  int code;
543 
544  OPEN_READER(re, s);
545  UPDATE_CACHE(re, s);
546 
547  GET_VLC(code, re, s, table, bits, max_depth);
548 
549  CLOSE_READER(re, s);
550 
551  return code;
552 }
553 
554 static inline int decode012(GetBitContext *gb)
555 {
556  int n;
557  n = get_bits1(gb);
558  if (n == 0)
559  return 0;
560  else
561  return get_bits1(gb) + 1;
562 }
563 
564 static inline int decode210(GetBitContext *gb)
565 {
566  if (get_bits1(gb))
567  return 0;
568  else
569  return 2 - get_bits1(gb);
570 }
571 
572 static inline int get_bits_left(GetBitContext *gb)
573 {
574  return gb->size_in_bits - get_bits_count(gb);
575 }
576 
577 static inline int skip_1stop_8data_bits(GetBitContext *gb)
578 {
579  if (get_bits_left(gb) <= 0)
580  return AVERROR_INVALIDDATA;
581 
582  while (get_bits1(gb)) {
583  skip_bits(gb, 8);
584  if (get_bits_left(gb) <= 0)
585  return AVERROR_INVALIDDATA;
586  }
587 
588  return 0;
589 }
590 
591 #endif /* AVCODEC_GET_BITS_H */
static unsigned int show_bits_long(GetBitContext *s, int n)
Show 0-32 bits.
Definition: get_bits.h:382
static unsigned int show_bits1(GetBitContext *s)
Definition: get_bits.h:319
#define NULL
Definition: coverity.c:32
const char * s
Definition: avisynth_c.h:768
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
float re
Definition: fft.c:82
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:247
static void skip_bits_long(GetBitContext *s, int n)
Definition: get_bits.h:204
static int check_marker(void *logctx, GetBitContext *s, const char *msg)
Definition: get_bits.h:392
const uint8_t * buffer
Definition: get_bits.h:56
static int get_sbits(GetBitContext *s, int n)
Definition: get_bits.h:232
static int get_sbits_long(GetBitContext *s, int n)
Read 0-32 bits as a signed integer.
Definition: get_bits.h:370
uint8_t bits
Definition: crc.c:296
uint8_t
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
Definition: avassert.h:64
static int get_bits_count(const GetBitContext *s)
Definition: get_bits.h:199
#define SHOW_UBITS_LE(name, gb, num)
Definition: get_bits.h:183
#define av_log(a,...)
static int get_bits_left(GetBitContext *gb)
Definition: get_bits.h:572
static uint64_t get_bits64(GetBitContext *s, int n)
Read 0-64 bits.
Definition: get_bits.h:352
#define UPDATE_CACHE(name, gb)
Definition: get_bits.h:160
static const struct endianess table[]
simple assert() macros that are a bit more flexible than ISO C assert().
#define CLOSE_READER(name, gb)
Definition: get_bits.h:131
#define NEG_USR32(a, s)
Definition: mathops.h:175
int size_in_bits
Definition: get_bits.h:58
int32_t
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
Definition: get_bits.h:282
#define LAST_SKIP_BITS(name, gb, num)
Definition: get_bits.h:181
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
Definition: get_bits.h:539
int n
Definition: avisynth_c.h:684
#define GET_VLC(code, name, gb, table, bits, max_depth)
If the vlc code is invalid and max_depth=1, then no bits will be removed.
Definition: get_bits.h:462
#define SHOW_UBITS(name, gb, num)
Definition: get_bits.h:193
static int decode210(GetBitContext *gb)
Definition: get_bits.h:564
#define AV_LOG_INFO
Standard information.
Definition: log.h:187
int size_in_bits_plus8
Definition: get_bits.h:59
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
Definition: get_bits.h:441
static int get_xbits(GetBitContext *s, int n)
Read MPEG-1 dc-style VLC (sign bit + mantissa with no MSB).
Definition: get_bits.h:218
#define OPEN_READER(name, gb)
Definition: get_bits.h:120
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:299
static void skip_bits1(GetBitContext *s)
Definition: get_bits.h:324
static void skip_bits(GetBitContext *s, int n)
Definition: get_bits.h:292
int index
Definition: gxfenc.c:89
#define UPDATE_CACHE_LE(name, gb)
Definition: get_bits.h:143
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Definition: get_bits.h:410
#define GET_CACHE(name, gb)
Definition: get_bits.h:197
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
Definition: get_bits.h:332
#define MIN_CACHE_BITS
Definition: get_bits.h:112
static av_const int sign_extend(int val, unsigned bits)
Definition: mathops.h:139
static unsigned int get_bits_le(GetBitContext *s, int n)
Definition: get_bits.h:267
#define SHOW_SBITS(name, gb, num)
Definition: get_bits.h:194
#define OPEN_READER_NOSIZE(name, gb)
Definition: get_bits.h:115
common internal and external API header
const uint8_t * buffer_end
Definition: get_bits.h:56
static uint8_t tmp[8]
Definition: des.c:38
static int decode012(GetBitContext *gb)
Definition: get_bits.h:554
static const uint8_t * align_get_bits(GetBitContext *s)
Definition: get_bits.h:449
static int skip_1stop_8data_bits(GetBitContext *gb)
Definition: get_bits.h:577
#define av_always_inline
Definition: attributes.h:39
#define VLC_TYPE
Definition: vlc.h:24
static av_always_inline int get_bitsz(GetBitContext *s, int n)
Read 0-25 bits.
Definition: get_bits.h:262
GLuint buffer
Definition: opengl_enc.c:102