You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

672 lines
20KB

  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. * @file
  22. * bitstream reader API header.
  23. */
  24. #ifndef AVCODEC_GET_BITS_H
  25. #define AVCODEC_GET_BITS_H
  26. #include <stdint.h>
  27. #include "libavutil/common.h"
  28. #include "libavutil/intreadwrite.h"
  29. #include "libavutil/log.h"
  30. #include "libavutil/avassert.h"
  31. #include "mathops.h"
  32. /*
  33. * Safe bitstream reading:
  34. * optionally, the get_bits API can check to ensure that we
  35. * don't read past input buffer boundaries. This is protected
  36. * with CONFIG_SAFE_BITSTREAM_READER at the global level, and
  37. * then below that with UNCHECKED_BITSTREAM_READER at the per-
  38. * decoder level. This means that decoders that check internally
  39. * can "#define UNCHECKED_BITSTREAM_READER 1" to disable
  40. * overread checks.
  41. * Boundary checking causes a minor performance penalty so for
  42. * applications that won't want/need this, it can be disabled
  43. * globally using "#define CONFIG_SAFE_BITSTREAM_READER 0".
  44. */
  45. #ifndef UNCHECKED_BITSTREAM_READER
  46. #define UNCHECKED_BITSTREAM_READER !CONFIG_SAFE_BITSTREAM_READER
  47. #endif
  48. typedef struct GetBitContext {
  49. const uint8_t *buffer, *buffer_end;
  50. int index;
  51. int size_in_bits;
  52. int size_in_bits_plus8;
  53. } GetBitContext;
  54. #define VLC_TYPE int16_t
  55. typedef struct VLC {
  56. int bits;
  57. VLC_TYPE (*table)[2]; ///< code, bits
  58. int table_size, table_allocated;
  59. void * volatile init_state;
  60. } VLC;
  61. typedef struct RL_VLC_ELEM {
  62. int16_t level;
  63. int8_t len;
  64. uint8_t run;
  65. } RL_VLC_ELEM;
  66. /* Bitstream reader API docs:
  67. * name
  68. * arbitrary name which is used as prefix for the internal variables
  69. *
  70. * gb
  71. * getbitcontext
  72. *
  73. * OPEN_READER(name, gb)
  74. * load gb into local variables
  75. *
  76. * CLOSE_READER(name, gb)
  77. * store local vars in gb
  78. *
  79. * UPDATE_CACHE(name, gb)
  80. * Refill the internal cache from the bitstream.
  81. * After this call at least MIN_CACHE_BITS will be available.
  82. *
  83. * GET_CACHE(name, gb)
  84. * Will output the contents of the internal cache,
  85. * next bit is MSB of 32 or 64 bit (FIXME 64bit).
  86. *
  87. * SHOW_UBITS(name, gb, num)
  88. * Will return the next num bits.
  89. *
  90. * SHOW_SBITS(name, gb, num)
  91. * Will return the next num bits and do sign extension.
  92. *
  93. * SKIP_BITS(name, gb, num)
  94. * Will skip over the next num bits.
  95. * Note, this is equivalent to SKIP_CACHE; SKIP_COUNTER.
  96. *
  97. * SKIP_CACHE(name, gb, num)
  98. * Will remove the next num bits from the cache (note SKIP_COUNTER
  99. * MUST be called before UPDATE_CACHE / CLOSE_READER).
  100. *
  101. * SKIP_COUNTER(name, gb, num)
  102. * Will increment the internal bit counter (see SKIP_CACHE & SKIP_BITS).
  103. *
  104. * LAST_SKIP_BITS(name, gb, num)
  105. * Like SKIP_BITS, to be used if next call is UPDATE_CACHE or CLOSE_READER.
  106. *
  107. * For examples see get_bits, show_bits, skip_bits, get_vlc.
  108. */
  109. #ifdef LONG_BITSTREAM_READER
  110. # define MIN_CACHE_BITS 32
  111. #else
  112. # define MIN_CACHE_BITS 25
  113. #endif
  114. #if UNCHECKED_BITSTREAM_READER
  115. #define OPEN_READER(name, gb) \
  116. unsigned int name ## _index = (gb)->index; \
  117. unsigned int av_unused name ## _cache
  118. #define HAVE_BITS_REMAINING(name, gb) 1
  119. #else
  120. #define OPEN_READER(name, gb) \
  121. unsigned int name ## _index = (gb)->index; \
  122. unsigned int av_unused name ## _cache = 0; \
  123. unsigned int av_unused name ## _size_plus8 = (gb)->size_in_bits_plus8
  124. #define HAVE_BITS_REMAINING(name, gb) name ## _index < name ## _size_plus8
  125. #endif
  126. #define CLOSE_READER(name, gb) (gb)->index = name ## _index
  127. # ifdef LONG_BITSTREAM_READER
  128. # define UPDATE_CACHE_LE(name, gb) name ## _cache = \
  129. AV_RL64((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7)
  130. # define UPDATE_CACHE_BE(name, gb) name ## _cache = \
  131. AV_RB64((gb)->buffer + (name ## _index >> 3)) >> (32 - (name ## _index & 7))
  132. #else
  133. # define UPDATE_CACHE_LE(name, gb) name ## _cache = \
  134. AV_RL32((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7)
  135. # define UPDATE_CACHE_BE(name, gb) name ## _cache = \
  136. AV_RB32((gb)->buffer + (name ## _index >> 3)) << (name ## _index & 7)
  137. #endif
  138. #ifdef BITSTREAM_READER_LE
  139. # define UPDATE_CACHE(name, gb) UPDATE_CACHE_LE(name, gb)
  140. # define SKIP_CACHE(name, gb, num) name ## _cache >>= (num)
  141. #else
  142. # define UPDATE_CACHE(name, gb) UPDATE_CACHE_BE(name, gb)
  143. # define SKIP_CACHE(name, gb, num) name ## _cache <<= (num)
  144. #endif
  145. #if UNCHECKED_BITSTREAM_READER
  146. # define SKIP_COUNTER(name, gb, num) name ## _index += (num)
  147. #else
  148. # define SKIP_COUNTER(name, gb, num) \
  149. name ## _index = FFMIN(name ## _size_plus8, name ## _index + (num))
  150. #endif
  151. #define SKIP_BITS(name, gb, num) \
  152. do { \
  153. SKIP_CACHE(name, gb, num); \
  154. SKIP_COUNTER(name, gb, num); \
  155. } while (0)
  156. #define LAST_SKIP_BITS(name, gb, num) SKIP_COUNTER(name, gb, num)
  157. #define SHOW_UBITS_LE(name, gb, num) zero_extend(name ## _cache, num)
  158. #define SHOW_SBITS_LE(name, gb, num) sign_extend(name ## _cache, num)
  159. #define SHOW_UBITS_BE(name, gb, num) NEG_USR32(name ## _cache, num)
  160. #define SHOW_SBITS_BE(name, gb, num) NEG_SSR32(name ## _cache, num)
  161. #ifdef BITSTREAM_READER_LE
  162. # define SHOW_UBITS(name, gb, num) SHOW_UBITS_LE(name, gb, num)
  163. # define SHOW_SBITS(name, gb, num) SHOW_SBITS_LE(name, gb, num)
  164. #else
  165. # define SHOW_UBITS(name, gb, num) SHOW_UBITS_BE(name, gb, num)
  166. # define SHOW_SBITS(name, gb, num) SHOW_SBITS_BE(name, gb, num)
  167. #endif
  168. #define GET_CACHE(name, gb) ((uint32_t) name ## _cache)
  169. static inline int get_bits_count(const GetBitContext *s)
  170. {
  171. return s->index;
  172. }
  173. static inline void skip_bits_long(GetBitContext *s, int n)
  174. {
  175. #if UNCHECKED_BITSTREAM_READER
  176. s->index += n;
  177. #else
  178. s->index += av_clip(n, -s->index, s->size_in_bits_plus8 - s->index);
  179. #endif
  180. }
  181. /**
  182. * read mpeg1 dc style vlc (sign bit + mantissa with no MSB).
  183. * if MSB not set it is negative
  184. * @param n length in bits
  185. */
  186. static inline int get_xbits(GetBitContext *s, int n)
  187. {
  188. register int sign;
  189. register int32_t cache;
  190. OPEN_READER(re, s);
  191. av_assert2(n>0 && n<=25);
  192. UPDATE_CACHE(re, s);
  193. cache = GET_CACHE(re, s);
  194. sign = ~cache >> 31;
  195. LAST_SKIP_BITS(re, s, n);
  196. CLOSE_READER(re, s);
  197. return (NEG_USR32(sign ^ cache, n) ^ sign) - sign;
  198. }
  199. static inline int get_sbits(GetBitContext *s, int n)
  200. {
  201. register int tmp;
  202. OPEN_READER(re, s);
  203. av_assert2(n>0 && n<=25);
  204. UPDATE_CACHE(re, s);
  205. tmp = SHOW_SBITS(re, s, n);
  206. LAST_SKIP_BITS(re, s, n);
  207. CLOSE_READER(re, s);
  208. return tmp;
  209. }
  210. /**
  211. * Read 1-25 bits.
  212. */
  213. static inline unsigned int get_bits(GetBitContext *s, int n)
  214. {
  215. register int tmp;
  216. OPEN_READER(re, s);
  217. av_assert2(n>0 && n<=25);
  218. UPDATE_CACHE(re, s);
  219. tmp = SHOW_UBITS(re, s, n);
  220. LAST_SKIP_BITS(re, s, n);
  221. CLOSE_READER(re, s);
  222. return tmp;
  223. }
  224. static inline unsigned int get_bits_le(GetBitContext *s, int n)
  225. {
  226. register int tmp;
  227. OPEN_READER(re, s);
  228. av_assert2(n>0 && n<=25);
  229. UPDATE_CACHE_LE(re, s);
  230. tmp = SHOW_UBITS_LE(re, s, n);
  231. LAST_SKIP_BITS(re, s, n);
  232. CLOSE_READER(re, s);
  233. return tmp;
  234. }
  235. /**
  236. * Show 1-25 bits.
  237. */
  238. static inline unsigned int show_bits(GetBitContext *s, int n)
  239. {
  240. register int tmp;
  241. OPEN_READER(re, s);
  242. av_assert2(n>0 && n<=25);
  243. UPDATE_CACHE(re, s);
  244. tmp = SHOW_UBITS(re, s, n);
  245. return tmp;
  246. }
  247. static inline void skip_bits(GetBitContext *s, int n)
  248. {
  249. OPEN_READER(re, s);
  250. LAST_SKIP_BITS(re, s, n);
  251. CLOSE_READER(re, s);
  252. }
  253. static inline unsigned int get_bits1(GetBitContext *s)
  254. {
  255. unsigned int index = s->index;
  256. uint8_t result = s->buffer[index >> 3];
  257. #ifdef BITSTREAM_READER_LE
  258. result >>= index & 7;
  259. result &= 1;
  260. #else
  261. result <<= index & 7;
  262. result >>= 8 - 1;
  263. #endif
  264. #if !UNCHECKED_BITSTREAM_READER
  265. if (s->index < s->size_in_bits_plus8)
  266. #endif
  267. index++;
  268. s->index = index;
  269. return result;
  270. }
  271. static inline unsigned int show_bits1(GetBitContext *s)
  272. {
  273. return show_bits(s, 1);
  274. }
  275. static inline void skip_bits1(GetBitContext *s)
  276. {
  277. skip_bits(s, 1);
  278. }
  279. /**
  280. * Read 0-32 bits.
  281. */
  282. static inline unsigned int get_bits_long(GetBitContext *s, int n)
  283. {
  284. if (!n) {
  285. return 0;
  286. } else if (n <= MIN_CACHE_BITS) {
  287. return get_bits(s, n);
  288. } else {
  289. #ifdef BITSTREAM_READER_LE
  290. unsigned ret = get_bits(s, 16);
  291. return ret | (get_bits(s, n - 16) << 16);
  292. #else
  293. unsigned ret = get_bits(s, 16) << (n - 16);
  294. return ret | get_bits(s, n - 16);
  295. #endif
  296. }
  297. }
  298. /**
  299. * Read 0-64 bits.
  300. */
  301. static inline uint64_t get_bits64(GetBitContext *s, int n)
  302. {
  303. if (n <= 32) {
  304. return get_bits_long(s, n);
  305. } else {
  306. #ifdef BITSTREAM_READER_LE
  307. uint64_t ret = get_bits_long(s, 32);
  308. return ret | (uint64_t) get_bits_long(s, n - 32) << 32;
  309. #else
  310. uint64_t ret = (uint64_t) get_bits_long(s, n - 32) << 32;
  311. return ret | get_bits_long(s, 32);
  312. #endif
  313. }
  314. }
  315. /**
  316. * Read 0-32 bits as a signed integer.
  317. */
  318. static inline int get_sbits_long(GetBitContext *s, int n)
  319. {
  320. return sign_extend(get_bits_long(s, n), n);
  321. }
  322. /**
  323. * Show 0-32 bits.
  324. */
  325. static inline unsigned int show_bits_long(GetBitContext *s, int n)
  326. {
  327. if (n <= MIN_CACHE_BITS) {
  328. return show_bits(s, n);
  329. } else {
  330. GetBitContext gb = *s;
  331. return get_bits_long(&gb, n);
  332. }
  333. }
  334. static inline int check_marker(GetBitContext *s, const char *msg)
  335. {
  336. int bit = get_bits1(s);
  337. if (!bit)
  338. av_log(NULL, AV_LOG_INFO, "Marker bit missing %s\n", msg);
  339. return bit;
  340. }
  341. /**
  342. * Initialize GetBitContext.
  343. * @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes
  344. * larger than the actual read bits because some optimized bitstream
  345. * readers read 32 or 64 bit at once and could read over the end
  346. * @param bit_size the size of the buffer in bits
  347. * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
  348. */
  349. static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
  350. int bit_size)
  351. {
  352. int buffer_size;
  353. int ret = 0;
  354. if (bit_size >= INT_MAX - 7 || bit_size < 0 || !buffer) {
  355. buffer_size = bit_size = 0;
  356. buffer = NULL;
  357. ret = AVERROR_INVALIDDATA;
  358. }
  359. buffer_size = (bit_size + 7) >> 3;
  360. s->buffer = buffer;
  361. s->size_in_bits = bit_size;
  362. s->size_in_bits_plus8 = bit_size + 8;
  363. s->buffer_end = buffer + buffer_size;
  364. s->index = 0;
  365. return ret;
  366. }
  367. /**
  368. * Initialize GetBitContext.
  369. * @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes
  370. * larger than the actual read bits because some optimized bitstream
  371. * readers read 32 or 64 bit at once and could read over the end
  372. * @param byte_size the size of the buffer in bytes
  373. * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
  374. */
  375. static inline int init_get_bits8(GetBitContext *s, const uint8_t *buffer,
  376. int byte_size)
  377. {
  378. if (byte_size > INT_MAX / 8 || byte_size < 0)
  379. byte_size = -1;
  380. return init_get_bits(s, buffer, byte_size * 8);
  381. }
  382. static inline const uint8_t *align_get_bits(GetBitContext *s)
  383. {
  384. int n = -get_bits_count(s) & 7;
  385. if (n)
  386. skip_bits(s, n);
  387. return s->buffer + (s->index >> 3);
  388. }
  389. #define init_vlc(vlc, nb_bits, nb_codes, \
  390. bits, bits_wrap, bits_size, \
  391. codes, codes_wrap, codes_size, \
  392. flags) \
  393. ff_init_vlc_sparse(vlc, nb_bits, nb_codes, \
  394. bits, bits_wrap, bits_size, \
  395. codes, codes_wrap, codes_size, \
  396. NULL, 0, 0, flags)
  397. int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
  398. const void *bits, int bits_wrap, int bits_size,
  399. const void *codes, int codes_wrap, int codes_size,
  400. const void *symbols, int symbols_wrap, int symbols_size,
  401. int flags);
  402. void ff_free_vlc(VLC *vlc);
  403. #define INIT_VLC_LE 2
  404. #define INIT_VLC_USE_NEW_STATIC 4
  405. #define INIT_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size) \
  406. do { \
  407. static VLC_TYPE table[static_size][2]; \
  408. (vlc)->table = table; \
  409. (vlc)->table_allocated = static_size; \
  410. init_vlc(vlc, bits, a, b, c, d, e, f, g, INIT_VLC_USE_NEW_STATIC); \
  411. } while (0)
  412. /**
  413. * If the vlc code is invalid and max_depth=1, then no bits will be removed.
  414. * If the vlc code is invalid and max_depth>1, then the number of bits removed
  415. * is undefined.
  416. */
  417. #define GET_VLC(code, name, gb, table, bits, max_depth) \
  418. do { \
  419. int n, nb_bits; \
  420. unsigned int index; \
  421. \
  422. index = SHOW_UBITS(name, gb, bits); \
  423. code = table[index][0]; \
  424. n = table[index][1]; \
  425. \
  426. if (max_depth > 1 && n < 0) { \
  427. LAST_SKIP_BITS(name, gb, bits); \
  428. UPDATE_CACHE(name, gb); \
  429. \
  430. nb_bits = -n; \
  431. \
  432. index = SHOW_UBITS(name, gb, nb_bits) + code; \
  433. code = table[index][0]; \
  434. n = table[index][1]; \
  435. if (max_depth > 2 && n < 0) { \
  436. LAST_SKIP_BITS(name, gb, nb_bits); \
  437. UPDATE_CACHE(name, gb); \
  438. \
  439. nb_bits = -n; \
  440. \
  441. index = SHOW_UBITS(name, gb, nb_bits) + code; \
  442. code = table[index][0]; \
  443. n = table[index][1]; \
  444. } \
  445. } \
  446. SKIP_BITS(name, gb, n); \
  447. } while (0)
  448. #define GET_RL_VLC(level, run, name, gb, table, bits, \
  449. max_depth, need_update) \
  450. do { \
  451. int n, nb_bits; \
  452. unsigned int index; \
  453. \
  454. index = SHOW_UBITS(name, gb, bits); \
  455. level = table[index].level; \
  456. n = table[index].len; \
  457. \
  458. if (max_depth > 1 && n < 0) { \
  459. SKIP_BITS(name, gb, bits); \
  460. if (need_update) { \
  461. UPDATE_CACHE(name, gb); \
  462. } \
  463. \
  464. nb_bits = -n; \
  465. \
  466. index = SHOW_UBITS(name, gb, nb_bits) + level; \
  467. level = table[index].level; \
  468. n = table[index].len; \
  469. } \
  470. run = table[index].run; \
  471. SKIP_BITS(name, gb, n); \
  472. } while (0)
  473. /**
  474. * Parse a vlc code.
  475. * @param bits is the number of bits which will be read at once, must be
  476. * identical to nb_bits in init_vlc()
  477. * @param max_depth is the number of times bits bits must be read to completely
  478. * read the longest vlc code
  479. * = (max_vlc_length + bits - 1) / bits
  480. */
  481. static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2],
  482. int bits, int max_depth)
  483. {
  484. int code;
  485. OPEN_READER(re, s);
  486. UPDATE_CACHE(re, s);
  487. GET_VLC(code, re, s, table, bits, max_depth);
  488. CLOSE_READER(re, s);
  489. return code;
  490. }
  491. static inline int decode012(GetBitContext *gb)
  492. {
  493. int n;
  494. n = get_bits1(gb);
  495. if (n == 0)
  496. return 0;
  497. else
  498. return get_bits1(gb) + 1;
  499. }
  500. static inline int decode210(GetBitContext *gb)
  501. {
  502. if (get_bits1(gb))
  503. return 0;
  504. else
  505. return 2 - get_bits1(gb);
  506. }
  507. static inline int get_bits_left(GetBitContext *gb)
  508. {
  509. return gb->size_in_bits - get_bits_count(gb);
  510. }
  511. static inline int skip_1stop_8data_bits(GetBitContext *gb)
  512. {
  513. if (get_bits_left(gb) <= 0)
  514. return AVERROR_INVALIDDATA;
  515. while (get_bits1(gb)) {
  516. skip_bits(gb, 8);
  517. if (get_bits_left(gb) <= 0)
  518. return AVERROR_INVALIDDATA;
  519. }
  520. return 0;
  521. }
  522. //#define TRACE
  523. #ifdef TRACE
  524. static inline void print_bin(int bits, int n)
  525. {
  526. int i;
  527. for (i = n - 1; i >= 0; i--)
  528. av_log(NULL, AV_LOG_DEBUG, "%d", (bits >> i) & 1);
  529. for (i = n; i < 24; i++)
  530. av_log(NULL, AV_LOG_DEBUG, " ");
  531. }
  532. static inline int get_bits_trace(GetBitContext *s, int n, const char *file,
  533. const char *func, int line)
  534. {
  535. int r = get_bits(s, n);
  536. print_bin(r, n);
  537. av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d bit @%5d in %s %s:%d\n",
  538. r, n, r, get_bits_count(s) - n, file, func, line);
  539. return r;
  540. }
  541. static inline int get_vlc_trace(GetBitContext *s, VLC_TYPE (*table)[2],
  542. int bits, int max_depth, const char *file,
  543. const char *func, int line)
  544. {
  545. int show = show_bits(s, 24);
  546. int pos = get_bits_count(s);
  547. int r = get_vlc2(s, table, bits, max_depth);
  548. int len = get_bits_count(s) - pos;
  549. int bits2 = show >> (24 - len);
  550. print_bin(bits2, len);
  551. av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d vlc @%5d in %s %s:%d\n",
  552. bits2, len, r, pos, file, func, line);
  553. return r;
  554. }
  555. static inline int get_xbits_trace(GetBitContext *s, int n, const char *file,
  556. const char *func, int line)
  557. {
  558. int show = show_bits(s, n);
  559. int r = get_xbits(s, n);
  560. print_bin(show, n);
  561. av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d xbt @%5d in %s %s:%d\n",
  562. show, n, r, get_bits_count(s) - n, file, func, line);
  563. return r;
  564. }
  565. #define get_bits(s, n) get_bits_trace(s , n, __FILE__, __PRETTY_FUNCTION__, __LINE__)
  566. #define get_bits1(s) get_bits_trace(s, 1, __FILE__, __PRETTY_FUNCTION__, __LINE__)
  567. #define get_xbits(s, n) get_xbits_trace(s, n, __FILE__, __PRETTY_FUNCTION__, __LINE__)
  568. #define get_vlc(s, vlc) get_vlc_trace(s, (vlc)->table, (vlc)->bits, 3, __FILE__, __PRETTY_FUNCTION__, __LINE__)
  569. #define get_vlc2(s, tab, bits, max) get_vlc_trace(s, tab, bits, max, __FILE__, __PRETTY_FUNCTION__, __LINE__)
  570. #define tprintf(p, ...) av_log(p, AV_LOG_DEBUG, __VA_ARGS__)
  571. #else //TRACE
  572. #define tprintf(p, ...) { }
  573. #endif
  574. #endif /* AVCODEC_GET_BITS_H */