* Read 0-32 bits. */
| 422 | * Read 0-32 bits. |
| 423 | */ |
| 424 | static inline unsigned int get_bits_long(GetBitContext *s, int n) |
| 425 | { |
| 426 | av_assert2(n>=0 && n<=32); |
| 427 | if (!n) { |
| 428 | return 0; |
| 429 | } else if ((!HAVE_FAST_64BIT || av_builtin_constant_p(n <= MIN_CACHE_BITS)) |
| 430 | && n <= MIN_CACHE_BITS) { |
| 431 | return get_bits(s, n); |
| 432 | } else { |
| 433 | #if HAVE_FAST_64BIT |
| 434 | unsigned tmp; |
| 435 | OPEN_READER(re, s); |
| 436 | UPDATE_CACHE_32(re, s); |
| 437 | tmp = SHOW_UBITS(re, s, n); |
| 438 | LAST_SKIP_BITS(re, s, n); |
| 439 | CLOSE_READER(re, s); |
| 440 | return tmp; |
| 441 | #else |
| 442 | #ifdef BITSTREAM_READER_LE |
| 443 | unsigned ret = get_bits(s, 16); |
| 444 | return ret | (get_bits(s, n - 16) << 16); |
| 445 | #else |
| 446 | unsigned ret = get_bits(s, 16) << (n - 16); |
| 447 | return ret | get_bits(s, n - 16); |
| 448 | #endif |
| 449 | #endif |
| 450 | } |
| 451 | } |
| 452 | |
| 453 | /** |
| 454 | * Read 0-64 bits. |
no test coverage detected