/src/ffmpeg/libavcodec/bitstream_template.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2016 Alexandra Hájková |
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 | | #ifdef BITSTREAM_TEMPLATE_LE |
22 | | # define BS_SUFFIX_LOWER _le |
23 | | # define BS_SUFFIX_UPPER LE |
24 | | #else |
25 | | # define BS_SUFFIX_LOWER _be |
26 | | # define BS_SUFFIX_UPPER BE |
27 | | #endif |
28 | | |
29 | 19.0G | #define BS_JOIN(x, y, z) x ## y ## z |
30 | 19.0G | #define BS_JOIN3(x, y, z) BS_JOIN(x, y, z) |
31 | 19.0G | #define BS_FUNC(x) BS_JOIN3(bits_, x, BS_SUFFIX_LOWER) |
32 | | |
33 | | #define BSCTX BS_JOIN3(Bitstream, Context, BS_SUFFIX_UPPER) |
34 | | |
35 | | typedef struct BSCTX { |
36 | | uint64_t bits; // stores bits read from the buffer |
37 | | const uint8_t *buffer, *buffer_end; |
38 | | const uint8_t *ptr; // pointer to the position inside a buffer |
39 | | unsigned bits_valid; // number of bits left in bits field |
40 | | unsigned size_in_bits; |
41 | | } BSCTX; |
42 | | |
43 | | /** |
44 | | * @return |
45 | | * - 0 on successful refill |
46 | | * - a negative number when bitstream end is hit |
47 | | * |
48 | | * Always succeeds when UNCHECKED_BITSTREAM_READER is enabled. |
49 | | */ |
50 | | static inline int BS_FUNC(priv_refill_64)(BSCTX *bc) |
51 | 12.5M | { |
52 | | #if !UNCHECKED_BITSTREAM_READER |
53 | 12.5M | if (bc->ptr >= bc->buffer_end) |
54 | 2.92M | return -1; |
55 | 9.28M | #endif |
56 | | |
57 | | #ifdef BITSTREAM_TEMPLATE_LE |
58 | 9.28M | bc->bits = AV_RL64(bc->ptr); |
59 | | #else |
60 | 296k | bc->bits = AV_RB64(bc->ptr); |
61 | | #endif |
62 | 291k | bc->ptr += 8; |
63 | 291k | bc->bits_valid = 64; |
64 | | |
65 | 291k | return 0; |
66 | 12.5M | } tak_parser.c:bits_priv_refill_64_le Line | Count | Source | 51 | 3.63M | { | 52 | 3.63M | #if !UNCHECKED_BITSTREAM_READER | 53 | 3.63M | if (bc->ptr >= bc->buffer_end) | 54 | 0 | return -1; | 55 | 3.63M | #endif | 56 | | | 57 | 3.63M | #ifdef BITSTREAM_TEMPLATE_LE | 58 | 3.63M | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | | bc->bits = AV_RB64(bc->ptr); | 61 | | #endif | 62 | 3.63M | bc->ptr += 8; | 63 | 3.63M | bc->bits_valid = 64; | 64 | | | 65 | 3.63M | return 0; | 66 | 3.63M | } |
tak.c:bits_priv_refill_64_le Line | Count | Source | 51 | 4.65M | { | 52 | 4.65M | #if !UNCHECKED_BITSTREAM_READER | 53 | 4.65M | if (bc->ptr >= bc->buffer_end) | 54 | 8.24k | return -1; | 55 | 4.64M | #endif | 56 | | | 57 | 4.64M | #ifdef BITSTREAM_TEMPLATE_LE | 58 | 4.64M | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | | bc->bits = AV_RB64(bc->ptr); | 61 | | #endif | 62 | 4.64M | bc->ptr += 8; | 63 | 4.64M | bc->bits_valid = 64; | 64 | | | 65 | 4.64M | return 0; | 66 | 4.65M | } |
sheervideo.c:bits_priv_refill_64_be Line | Count | Source | 51 | 187k | { | 52 | 187k | #if !UNCHECKED_BITSTREAM_READER | 53 | 187k | if (bc->ptr >= bc->buffer_end) | 54 | 47.3k | return -1; | 55 | 139k | #endif | 56 | | | 57 | | #ifdef BITSTREAM_TEMPLATE_LE | 58 | | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | 139k | bc->bits = AV_RB64(bc->ptr); | 61 | 139k | #endif | 62 | 139k | bc->ptr += 8; | 63 | 139k | bc->bits_valid = 64; | 64 | | | 65 | 139k | return 0; | 66 | 187k | } |
Unexecuted instantiation: sheervideo.c:bits_priv_refill_64_le utvideodec.c:bits_priv_refill_64_le Line | Count | Source | 51 | 7.97k | { | 52 | | #if !UNCHECKED_BITSTREAM_READER | 53 | | if (bc->ptr >= bc->buffer_end) | 54 | | return -1; | 55 | | #endif | 56 | | | 57 | 7.97k | #ifdef BITSTREAM_TEMPLATE_LE | 58 | 7.97k | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | | bc->bits = AV_RB64(bc->ptr); | 61 | | #endif | 62 | 7.97k | bc->ptr += 8; | 63 | 7.97k | bc->bits_valid = 64; | 64 | | | 65 | 7.97k | return 0; | 66 | 7.97k | } |
utvideodec.c:bits_priv_refill_64_be Line | Count | Source | 51 | 4.38k | { | 52 | | #if !UNCHECKED_BITSTREAM_READER | 53 | | if (bc->ptr >= bc->buffer_end) | 54 | | return -1; | 55 | | #endif | 56 | | | 57 | | #ifdef BITSTREAM_TEMPLATE_LE | 58 | | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | 4.38k | bc->bits = AV_RB64(bc->ptr); | 61 | 4.38k | #endif | 62 | 4.38k | bc->ptr += 8; | 63 | 4.38k | bc->bits_valid = 64; | 64 | | | 65 | 4.38k | return 0; | 66 | 4.38k | } |
vmixdec.c:bits_priv_refill_64_be Line | Count | Source | 51 | 304k | { | 52 | 304k | #if !UNCHECKED_BITSTREAM_READER | 53 | 304k | if (bc->ptr >= bc->buffer_end) | 54 | 252k | return -1; | 55 | 52.9k | #endif | 56 | | | 57 | | #ifdef BITSTREAM_TEMPLATE_LE | 58 | | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | 52.9k | bc->bits = AV_RB64(bc->ptr); | 61 | 52.9k | #endif | 62 | 52.9k | bc->ptr += 8; | 63 | 52.9k | bc->bits_valid = 64; | 64 | | | 65 | 52.9k | return 0; | 66 | 304k | } |
Unexecuted instantiation: vmixdec.c:bits_priv_refill_64_le magicyuv.c:bits_priv_refill_64_be Line | Count | Source | 51 | 51.1k | { | 52 | 51.1k | #if !UNCHECKED_BITSTREAM_READER | 53 | 51.1k | if (bc->ptr >= bc->buffer_end) | 54 | 4.92k | return -1; | 55 | 46.2k | #endif | 56 | | | 57 | | #ifdef BITSTREAM_TEMPLATE_LE | 58 | | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | 46.2k | bc->bits = AV_RB64(bc->ptr); | 61 | 46.2k | #endif | 62 | 46.2k | bc->ptr += 8; | 63 | 46.2k | bc->bits_valid = 64; | 64 | | | 65 | 46.2k | return 0; | 66 | 51.1k | } |
Unexecuted instantiation: magicyuv.c:bits_priv_refill_64_le prores_raw.c:bits_priv_refill_64_be Line | Count | Source | 51 | 36.9k | { | 52 | 36.9k | #if !UNCHECKED_BITSTREAM_READER | 53 | 36.9k | if (bc->ptr >= bc->buffer_end) | 54 | 25.3k | return -1; | 55 | 11.6k | #endif | 56 | | | 57 | | #ifdef BITSTREAM_TEMPLATE_LE | 58 | | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | 11.6k | bc->bits = AV_RB64(bc->ptr); | 61 | 11.6k | #endif | 62 | 11.6k | bc->ptr += 8; | 63 | 11.6k | bc->bits_valid = 64; | 64 | | | 65 | 11.6k | return 0; | 66 | 36.9k | } |
Unexecuted instantiation: prores_raw.c:bits_priv_refill_64_le takdec.c:bits_priv_refill_64_le Line | Count | Source | 51 | 3.59M | { | 52 | 3.59M | #if !UNCHECKED_BITSTREAM_READER | 53 | 3.59M | if (bc->ptr >= bc->buffer_end) | 54 | 2.59M | return -1; | 55 | 1.00M | #endif | 56 | | | 57 | 1.00M | #ifdef BITSTREAM_TEMPLATE_LE | 58 | 1.00M | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | | bc->bits = AV_RB64(bc->ptr); | 61 | | #endif | 62 | 1.00M | bc->ptr += 8; | 63 | 1.00M | bc->bits_valid = 64; | 64 | | | 65 | 1.00M | return 0; | 66 | 3.59M | } |
photocd.c:bits_priv_refill_64_be Line | Count | Source | 51 | 1.45k | { | 52 | 1.45k | #if !UNCHECKED_BITSTREAM_READER | 53 | 1.45k | if (bc->ptr >= bc->buffer_end) | 54 | 81 | return -1; | 55 | 1.37k | #endif | 56 | | | 57 | | #ifdef BITSTREAM_TEMPLATE_LE | 58 | | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | 1.37k | bc->bits = AV_RB64(bc->ptr); | 61 | 1.37k | #endif | 62 | 1.37k | bc->ptr += 8; | 63 | 1.37k | bc->bits_valid = 64; | 64 | | | 65 | 1.37k | return 0; | 66 | 1.45k | } |
Unexecuted instantiation: photocd.c:bits_priv_refill_64_le mvha.c:bits_priv_refill_64_be Line | Count | Source | 51 | 39.8k | { | 52 | 39.8k | #if !UNCHECKED_BITSTREAM_READER | 53 | 39.8k | if (bc->ptr >= bc->buffer_end) | 54 | 0 | return -1; | 55 | 39.8k | #endif | 56 | | | 57 | | #ifdef BITSTREAM_TEMPLATE_LE | 58 | | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | 39.8k | bc->bits = AV_RB64(bc->ptr); | 61 | 39.8k | #endif | 62 | 39.8k | bc->ptr += 8; | 63 | 39.8k | bc->bits_valid = 64; | 64 | | | 65 | 39.8k | return 0; | 66 | 39.8k | } |
Unexecuted instantiation: mvha.c:bits_priv_refill_64_le |
67 | | |
68 | | /** |
69 | | * @return |
70 | | * - 0 on successful refill |
71 | | * - a negative number when bitstream end is hit |
72 | | * |
73 | | * Always succeeds when UNCHECKED_BITSTREAM_READER is enabled. |
74 | | */ |
75 | | static inline int BS_FUNC(priv_refill_32)(BSCTX *bc) |
76 | 169M | { |
77 | | #if !UNCHECKED_BITSTREAM_READER |
78 | 169M | if (bc->ptr >= bc->buffer_end) |
79 | 143M | return -1; |
80 | 512k | #endif |
81 | | |
82 | | #ifdef BITSTREAM_TEMPLATE_LE |
83 | 515k | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; |
84 | | #else |
85 | 24.9M | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); |
86 | | #endif |
87 | 24.8M | bc->ptr += 4; |
88 | 24.8M | bc->bits_valid += 32; |
89 | | |
90 | 24.8M | return 0; |
91 | 169M | } Unexecuted instantiation: tak_parser.c:bits_priv_refill_32_le tak.c:bits_priv_refill_32_le Line | Count | Source | 76 | 83.6k | { | 77 | 83.6k | #if !UNCHECKED_BITSTREAM_READER | 78 | 83.6k | if (bc->ptr >= bc->buffer_end) | 79 | 9.13k | return -1; | 80 | 74.4k | #endif | 81 | | | 82 | 74.4k | #ifdef BITSTREAM_TEMPLATE_LE | 83 | 74.4k | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; | 84 | | #else | 85 | | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); | 86 | | #endif | 87 | 74.4k | bc->ptr += 4; | 88 | 74.4k | bc->bits_valid += 32; | 89 | | | 90 | 74.4k | return 0; | 91 | 83.6k | } |
sheervideo.c:bits_priv_refill_32_be Line | Count | Source | 76 | 116M | { | 77 | 116M | #if !UNCHECKED_BITSTREAM_READER | 78 | 116M | if (bc->ptr >= bc->buffer_end) | 79 | 92.6M | return -1; | 80 | 23.9M | #endif | 81 | | | 82 | | #ifdef BITSTREAM_TEMPLATE_LE | 83 | | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; | 84 | | #else | 85 | 23.9M | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); | 86 | 23.9M | #endif | 87 | 23.9M | bc->ptr += 4; | 88 | 23.9M | bc->bits_valid += 32; | 89 | | | 90 | 23.9M | return 0; | 91 | 116M | } |
Unexecuted instantiation: sheervideo.c:bits_priv_refill_32_le utvideodec.c:bits_priv_refill_32_le Line | Count | Source | 76 | 2.26k | { | 77 | | #if !UNCHECKED_BITSTREAM_READER | 78 | | if (bc->ptr >= bc->buffer_end) | 79 | | return -1; | 80 | | #endif | 81 | | | 82 | 2.26k | #ifdef BITSTREAM_TEMPLATE_LE | 83 | 2.26k | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; | 84 | | #else | 85 | | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); | 86 | | #endif | 87 | 2.26k | bc->ptr += 4; | 88 | 2.26k | bc->bits_valid += 32; | 89 | | | 90 | 2.26k | return 0; | 91 | 2.26k | } |
utvideodec.c:bits_priv_refill_32_be Line | Count | Source | 76 | 133k | { | 77 | | #if !UNCHECKED_BITSTREAM_READER | 78 | | if (bc->ptr >= bc->buffer_end) | 79 | | return -1; | 80 | | #endif | 81 | | | 82 | | #ifdef BITSTREAM_TEMPLATE_LE | 83 | | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; | 84 | | #else | 85 | 133k | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); | 86 | 133k | #endif | 87 | 133k | bc->ptr += 4; | 88 | 133k | bc->bits_valid += 32; | 89 | | | 90 | 133k | return 0; | 91 | 133k | } |
vmixdec.c:bits_priv_refill_32_be Line | Count | Source | 76 | 204k | { | 77 | 204k | #if !UNCHECKED_BITSTREAM_READER | 78 | 204k | if (bc->ptr >= bc->buffer_end) | 79 | 53.4k | return -1; | 80 | 151k | #endif | 81 | | | 82 | | #ifdef BITSTREAM_TEMPLATE_LE | 83 | | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; | 84 | | #else | 85 | 151k | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); | 86 | 151k | #endif | 87 | 151k | bc->ptr += 4; | 88 | 151k | bc->bits_valid += 32; | 89 | | | 90 | 151k | return 0; | 91 | 204k | } |
Unexecuted instantiation: vmixdec.c:bits_priv_refill_32_le magicyuv.c:bits_priv_refill_32_be Line | Count | Source | 76 | 1.50M | { | 77 | 1.50M | #if !UNCHECKED_BITSTREAM_READER | 78 | 1.50M | if (bc->ptr >= bc->buffer_end) | 79 | 1.19M | return -1; | 80 | 311k | #endif | 81 | | | 82 | | #ifdef BITSTREAM_TEMPLATE_LE | 83 | | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; | 84 | | #else | 85 | 311k | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); | 86 | 311k | #endif | 87 | 311k | bc->ptr += 4; | 88 | 311k | bc->bits_valid += 32; | 89 | | | 90 | 311k | return 0; | 91 | 1.50M | } |
Unexecuted instantiation: magicyuv.c:bits_priv_refill_32_le prores_raw.c:bits_priv_refill_32_be Line | Count | Source | 76 | 40.4k | { | 77 | 40.4k | #if !UNCHECKED_BITSTREAM_READER | 78 | 40.4k | if (bc->ptr >= bc->buffer_end) | 79 | 40.1k | return -1; | 80 | 308 | #endif | 81 | | | 82 | | #ifdef BITSTREAM_TEMPLATE_LE | 83 | | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; | 84 | | #else | 85 | 308 | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); | 86 | 308 | #endif | 87 | 308 | bc->ptr += 4; | 88 | 308 | bc->bits_valid += 32; | 89 | | | 90 | 308 | return 0; | 91 | 40.4k | } |
Unexecuted instantiation: prores_raw.c:bits_priv_refill_32_le takdec.c:bits_priv_refill_32_le Line | Count | Source | 76 | 50.2M | { | 77 | 50.2M | #if !UNCHECKED_BITSTREAM_READER | 78 | 50.2M | if (bc->ptr >= bc->buffer_end) | 79 | 49.8M | return -1; | 80 | 438k | #endif | 81 | | | 82 | 438k | #ifdef BITSTREAM_TEMPLATE_LE | 83 | 438k | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; | 84 | | #else | 85 | | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); | 86 | | #endif | 87 | 438k | bc->ptr += 4; | 88 | 438k | bc->bits_valid += 32; | 89 | | | 90 | 438k | return 0; | 91 | 50.2M | } |
photocd.c:bits_priv_refill_32_be Line | Count | Source | 76 | 308k | { | 77 | 308k | #if !UNCHECKED_BITSTREAM_READER | 78 | 308k | if (bc->ptr >= bc->buffer_end) | 79 | 391 | return -1; | 80 | 307k | #endif | 81 | | | 82 | | #ifdef BITSTREAM_TEMPLATE_LE | 83 | | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; | 84 | | #else | 85 | 307k | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); | 86 | 307k | #endif | 87 | 307k | bc->ptr += 4; | 88 | 307k | bc->bits_valid += 32; | 89 | | | 90 | 307k | return 0; | 91 | 308k | } |
Unexecuted instantiation: photocd.c:bits_priv_refill_32_le mvha.c:bits_priv_refill_32_be Line | Count | Source | 76 | 107k | { | 77 | 107k | #if !UNCHECKED_BITSTREAM_READER | 78 | 107k | if (bc->ptr >= bc->buffer_end) | 79 | 1.54k | return -1; | 80 | 106k | #endif | 81 | | | 82 | | #ifdef BITSTREAM_TEMPLATE_LE | 83 | | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; | 84 | | #else | 85 | 106k | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); | 86 | 106k | #endif | 87 | 106k | bc->ptr += 4; | 88 | 106k | bc->bits_valid += 32; | 89 | | | 90 | 106k | return 0; | 91 | 107k | } |
Unexecuted instantiation: mvha.c:bits_priv_refill_32_le |
92 | | |
93 | | /** |
94 | | * Initialize BitstreamContext. |
95 | | * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes |
96 | | * larger than the actual read bits because some optimized bitstream |
97 | | * readers read 32 or 64 bits at once and could read over the end |
98 | | * @param bit_size the size of the buffer in bits |
99 | | * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. |
100 | | */ |
101 | | static inline int BS_FUNC(init)(BSCTX *bc, const uint8_t *buffer, |
102 | | unsigned int bit_size) |
103 | 5.15M | { |
104 | 5.15M | unsigned int buffer_size; |
105 | | |
106 | 5.15M | if (bit_size > INT_MAX - 7 || !buffer) { |
107 | 0 | bc->buffer = NULL; |
108 | 0 | bc->ptr = NULL; |
109 | 0 | bc->bits_valid = 0; |
110 | 0 | return AVERROR_INVALIDDATA; |
111 | 0 | } |
112 | | |
113 | 5.15M | buffer_size = (bit_size + 7) >> 3; |
114 | | |
115 | 5.15M | bc->buffer = buffer; |
116 | 5.15M | bc->buffer_end = buffer + buffer_size; |
117 | 5.15M | bc->ptr = bc->buffer; |
118 | 5.15M | bc->size_in_bits = bit_size; |
119 | 5.15M | bc->bits_valid = 0; |
120 | 5.15M | bc->bits = 0; |
121 | | |
122 | 5.15M | BS_FUNC(priv_refill_64)(bc); |
123 | | |
124 | 5.15M | return 0; |
125 | 5.15M | } tak_parser.c:bits_init_le Line | Count | Source | 103 | 3.63M | { | 104 | 3.63M | unsigned int buffer_size; | 105 | | | 106 | 3.63M | if (bit_size > INT_MAX - 7 || !buffer) { | 107 | 0 | bc->buffer = NULL; | 108 | 0 | bc->ptr = NULL; | 109 | 0 | bc->bits_valid = 0; | 110 | 0 | return AVERROR_INVALIDDATA; | 111 | 0 | } | 112 | | | 113 | 3.63M | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 3.63M | bc->buffer = buffer; | 116 | 3.63M | bc->buffer_end = buffer + buffer_size; | 117 | 3.63M | bc->ptr = bc->buffer; | 118 | 3.63M | bc->size_in_bits = bit_size; | 119 | 3.63M | bc->bits_valid = 0; | 120 | 3.63M | bc->bits = 0; | 121 | | | 122 | 3.63M | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 3.63M | return 0; | 125 | 3.63M | } |
Line | Count | Source | 103 | 1.14k | { | 104 | 1.14k | unsigned int buffer_size; | 105 | | | 106 | 1.14k | if (bit_size > INT_MAX - 7 || !buffer) { | 107 | 0 | bc->buffer = NULL; | 108 | 0 | bc->ptr = NULL; | 109 | 0 | bc->bits_valid = 0; | 110 | 0 | return AVERROR_INVALIDDATA; | 111 | 0 | } | 112 | | | 113 | 1.14k | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 1.14k | bc->buffer = buffer; | 116 | 1.14k | bc->buffer_end = buffer + buffer_size; | 117 | 1.14k | bc->ptr = bc->buffer; | 118 | 1.14k | bc->size_in_bits = bit_size; | 119 | 1.14k | bc->bits_valid = 0; | 120 | 1.14k | bc->bits = 0; | 121 | | | 122 | 1.14k | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 1.14k | return 0; | 125 | 1.14k | } |
sheervideo.c:bits_init_be Line | Count | Source | 103 | 118k | { | 104 | 118k | unsigned int buffer_size; | 105 | | | 106 | 118k | if (bit_size > INT_MAX - 7 || !buffer) { | 107 | 0 | bc->buffer = NULL; | 108 | 0 | bc->ptr = NULL; | 109 | 0 | bc->bits_valid = 0; | 110 | 0 | return AVERROR_INVALIDDATA; | 111 | 0 | } | 112 | | | 113 | 118k | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 118k | bc->buffer = buffer; | 116 | 118k | bc->buffer_end = buffer + buffer_size; | 117 | 118k | bc->ptr = bc->buffer; | 118 | 118k | bc->size_in_bits = bit_size; | 119 | 118k | bc->bits_valid = 0; | 120 | 118k | bc->bits = 0; | 121 | | | 122 | 118k | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 118k | return 0; | 125 | 118k | } |
Unexecuted instantiation: sheervideo.c:bits_init_le utvideodec.c:bits_init_le Line | Count | Source | 103 | 7.97k | { | 104 | 7.97k | unsigned int buffer_size; | 105 | | | 106 | 7.97k | if (bit_size > INT_MAX - 7 || !buffer) { | 107 | 0 | bc->buffer = NULL; | 108 | 0 | bc->ptr = NULL; | 109 | 0 | bc->bits_valid = 0; | 110 | 0 | return AVERROR_INVALIDDATA; | 111 | 0 | } | 112 | | | 113 | 7.97k | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 7.97k | bc->buffer = buffer; | 116 | 7.97k | bc->buffer_end = buffer + buffer_size; | 117 | 7.97k | bc->ptr = bc->buffer; | 118 | 7.97k | bc->size_in_bits = bit_size; | 119 | 7.97k | bc->bits_valid = 0; | 120 | 7.97k | bc->bits = 0; | 121 | | | 122 | 7.97k | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 7.97k | return 0; | 125 | 7.97k | } |
utvideodec.c:bits_init_be Line | Count | Source | 103 | 4.38k | { | 104 | 4.38k | unsigned int buffer_size; | 105 | | | 106 | 4.38k | if (bit_size > INT_MAX - 7 || !buffer) { | 107 | 0 | bc->buffer = NULL; | 108 | 0 | bc->ptr = NULL; | 109 | 0 | bc->bits_valid = 0; | 110 | 0 | return AVERROR_INVALIDDATA; | 111 | 0 | } | 112 | | | 113 | 4.38k | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 4.38k | bc->buffer = buffer; | 116 | 4.38k | bc->buffer_end = buffer + buffer_size; | 117 | 4.38k | bc->ptr = bc->buffer; | 118 | 4.38k | bc->size_in_bits = bit_size; | 119 | 4.38k | bc->bits_valid = 0; | 120 | 4.38k | bc->bits = 0; | 121 | | | 122 | 4.38k | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 4.38k | return 0; | 125 | 4.38k | } |
Line | Count | Source | 103 | 298k | { | 104 | 298k | unsigned int buffer_size; | 105 | | | 106 | 298k | if (bit_size > INT_MAX - 7 || !buffer) { | 107 | 0 | bc->buffer = NULL; | 108 | 0 | bc->ptr = NULL; | 109 | 0 | bc->bits_valid = 0; | 110 | 0 | return AVERROR_INVALIDDATA; | 111 | 0 | } | 112 | | | 113 | 298k | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 298k | bc->buffer = buffer; | 116 | 298k | bc->buffer_end = buffer + buffer_size; | 117 | 298k | bc->ptr = bc->buffer; | 118 | 298k | bc->size_in_bits = bit_size; | 119 | 298k | bc->bits_valid = 0; | 120 | 298k | bc->bits = 0; | 121 | | | 122 | 298k | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 298k | return 0; | 125 | 298k | } |
Unexecuted instantiation: vmixdec.c:bits_init_le Line | Count | Source | 103 | 51.1k | { | 104 | 51.1k | unsigned int buffer_size; | 105 | | | 106 | 51.1k | if (bit_size > INT_MAX - 7 || !buffer) { | 107 | 0 | bc->buffer = NULL; | 108 | 0 | bc->ptr = NULL; | 109 | 0 | bc->bits_valid = 0; | 110 | 0 | return AVERROR_INVALIDDATA; | 111 | 0 | } | 112 | | | 113 | 51.1k | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 51.1k | bc->buffer = buffer; | 116 | 51.1k | bc->buffer_end = buffer + buffer_size; | 117 | 51.1k | bc->ptr = bc->buffer; | 118 | 51.1k | bc->size_in_bits = bit_size; | 119 | 51.1k | bc->bits_valid = 0; | 120 | 51.1k | bc->bits = 0; | 121 | | | 122 | 51.1k | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 51.1k | return 0; | 125 | 51.1k | } |
Unexecuted instantiation: magicyuv.c:bits_init_le prores_raw.c:bits_init_be Line | Count | Source | 103 | 35.1k | { | 104 | 35.1k | unsigned int buffer_size; | 105 | | | 106 | 35.1k | if (bit_size > INT_MAX - 7 || !buffer) { | 107 | 0 | bc->buffer = NULL; | 108 | 0 | bc->ptr = NULL; | 109 | 0 | bc->bits_valid = 0; | 110 | 0 | return AVERROR_INVALIDDATA; | 111 | 0 | } | 112 | | | 113 | 35.1k | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 35.1k | bc->buffer = buffer; | 116 | 35.1k | bc->buffer_end = buffer + buffer_size; | 117 | 35.1k | bc->ptr = bc->buffer; | 118 | 35.1k | bc->size_in_bits = bit_size; | 119 | 35.1k | bc->bits_valid = 0; | 120 | 35.1k | bc->bits = 0; | 121 | | | 122 | 35.1k | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 35.1k | return 0; | 125 | 35.1k | } |
Unexecuted instantiation: prores_raw.c:bits_init_le Line | Count | Source | 103 | 965k | { | 104 | 965k | unsigned int buffer_size; | 105 | | | 106 | 965k | if (bit_size > INT_MAX - 7 || !buffer) { | 107 | 0 | bc->buffer = NULL; | 108 | 0 | bc->ptr = NULL; | 109 | 0 | bc->bits_valid = 0; | 110 | 0 | return AVERROR_INVALIDDATA; | 111 | 0 | } | 112 | | | 113 | 965k | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 965k | bc->buffer = buffer; | 116 | 965k | bc->buffer_end = buffer + buffer_size; | 117 | 965k | bc->ptr = bc->buffer; | 118 | 965k | bc->size_in_bits = bit_size; | 119 | 965k | bc->bits_valid = 0; | 120 | 965k | bc->bits = 0; | 121 | | | 122 | 965k | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 965k | return 0; | 125 | 965k | } |
Line | Count | Source | 103 | 462 | { | 104 | 462 | unsigned int buffer_size; | 105 | | | 106 | 462 | if (bit_size > INT_MAX - 7 || !buffer) { | 107 | 0 | bc->buffer = NULL; | 108 | 0 | bc->ptr = NULL; | 109 | 0 | bc->bits_valid = 0; | 110 | 0 | return AVERROR_INVALIDDATA; | 111 | 0 | } | 112 | | | 113 | 462 | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 462 | bc->buffer = buffer; | 116 | 462 | bc->buffer_end = buffer + buffer_size; | 117 | 462 | bc->ptr = bc->buffer; | 118 | 462 | bc->size_in_bits = bit_size; | 119 | 462 | bc->bits_valid = 0; | 120 | 462 | bc->bits = 0; | 121 | | | 122 | 462 | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 462 | return 0; | 125 | 462 | } |
Unexecuted instantiation: photocd.c:bits_init_le Line | Count | Source | 103 | 35.0k | { | 104 | 35.0k | unsigned int buffer_size; | 105 | | | 106 | 35.0k | if (bit_size > INT_MAX - 7 || !buffer) { | 107 | 0 | bc->buffer = NULL; | 108 | 0 | bc->ptr = NULL; | 109 | 0 | bc->bits_valid = 0; | 110 | 0 | return AVERROR_INVALIDDATA; | 111 | 0 | } | 112 | | | 113 | 35.0k | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 35.0k | bc->buffer = buffer; | 116 | 35.0k | bc->buffer_end = buffer + buffer_size; | 117 | 35.0k | bc->ptr = bc->buffer; | 118 | 35.0k | bc->size_in_bits = bit_size; | 119 | 35.0k | bc->bits_valid = 0; | 120 | 35.0k | bc->bits = 0; | 121 | | | 122 | 35.0k | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 35.0k | return 0; | 125 | 35.0k | } |
Unexecuted instantiation: mvha.c:bits_init_le |
126 | | |
127 | | /** |
128 | | * Initialize BitstreamContext. |
129 | | * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes |
130 | | * larger than the actual read bits because some optimized bitstream |
131 | | * readers read 32 or 64 bits at once and could read over the end |
132 | | * @param byte_size the size of the buffer in bytes |
133 | | * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow |
134 | | */ |
135 | | static inline int BS_FUNC(init8)(BSCTX *bc, const uint8_t *buffer, |
136 | | unsigned int byte_size) |
137 | 5.14M | { |
138 | 5.14M | if (byte_size > INT_MAX / 8) |
139 | 0 | return AVERROR_INVALIDDATA; |
140 | 5.14M | return BS_FUNC(init)(bc, buffer, byte_size * 8); |
141 | 5.14M | } tak_parser.c:bits_init8_le Line | Count | Source | 137 | 3.63M | { | 138 | 3.63M | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 3.63M | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 3.63M | } |
Line | Count | Source | 137 | 1.14k | { | 138 | 1.14k | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 1.14k | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 1.14k | } |
sheervideo.c:bits_init8_be Line | Count | Source | 137 | 118k | { | 138 | 118k | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 118k | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 118k | } |
Unexecuted instantiation: sheervideo.c:bits_init8_le utvideodec.c:bits_init8_le Line | Count | Source | 137 | 7.97k | { | 138 | 7.97k | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 7.97k | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 7.97k | } |
Unexecuted instantiation: utvideodec.c:bits_init8_be Line | Count | Source | 137 | 298k | { | 138 | 298k | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 298k | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 298k | } |
Unexecuted instantiation: vmixdec.c:bits_init8_le Line | Count | Source | 137 | 51.1k | { | 138 | 51.1k | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 51.1k | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 51.1k | } |
Unexecuted instantiation: magicyuv.c:bits_init8_le prores_raw.c:bits_init8_be Line | Count | Source | 137 | 35.1k | { | 138 | 35.1k | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 35.1k | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 35.1k | } |
Unexecuted instantiation: prores_raw.c:bits_init8_le Line | Count | Source | 137 | 965k | { | 138 | 965k | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 965k | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 965k | } |
Line | Count | Source | 137 | 462 | { | 138 | 462 | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 462 | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 462 | } |
Unexecuted instantiation: photocd.c:bits_init8_le Line | Count | Source | 137 | 35.0k | { | 138 | 35.0k | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 35.0k | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 35.0k | } |
Unexecuted instantiation: mvha.c:bits_init8_le |
142 | | |
143 | | /** |
144 | | * Return number of bits already read. |
145 | | */ |
146 | | static inline int BS_FUNC(tell)(const BSCTX *bc) |
147 | 6.57M | { |
148 | 6.57M | return (bc->ptr - bc->buffer) * 8 - bc->bits_valid; |
149 | 6.57M | } tak_parser.c:bits_tell_le Line | Count | Source | 147 | 3.59M | { | 148 | 3.59M | return (bc->ptr - bc->buffer) * 8 - bc->bits_valid; | 149 | 3.59M | } |
Line | Count | Source | 147 | 123k | { | 148 | 123k | return (bc->ptr - bc->buffer) * 8 - bc->bits_valid; | 149 | 123k | } |
Unexecuted instantiation: sheervideo.c:bits_tell_le Unexecuted instantiation: sheervideo.c:bits_tell_be Unexecuted instantiation: utvideodec.c:bits_tell_le Unexecuted instantiation: utvideodec.c:bits_tell_be Line | Count | Source | 147 | 32.6k | { | 148 | 32.6k | return (bc->ptr - bc->buffer) * 8 - bc->bits_valid; | 149 | 32.6k | } |
Unexecuted instantiation: vmixdec.c:bits_tell_le Unexecuted instantiation: magicyuv.c:bits_tell_le Unexecuted instantiation: magicyuv.c:bits_tell_be Unexecuted instantiation: prores_raw.c:bits_tell_le Unexecuted instantiation: prores_raw.c:bits_tell_be Line | Count | Source | 147 | 2.82M | { | 148 | 2.82M | return (bc->ptr - bc->buffer) * 8 - bc->bits_valid; | 149 | 2.82M | } |
Line | Count | Source | 147 | 101 | { | 148 | 101 | return (bc->ptr - bc->buffer) * 8 - bc->bits_valid; | 149 | 101 | } |
Unexecuted instantiation: photocd.c:bits_tell_le Unexecuted instantiation: mvha.c:bits_tell_le Unexecuted instantiation: mvha.c:bits_tell_be |
150 | | |
151 | | /** |
152 | | * Return buffer size in bits. |
153 | | */ |
154 | | static inline int BS_FUNC(size)(const BSCTX *bc) |
155 | 0 | { |
156 | 0 | return bc->size_in_bits; |
157 | 0 | } Unexecuted instantiation: tak_parser.c:bits_size_le Unexecuted instantiation: tak.c:bits_size_le Unexecuted instantiation: sheervideo.c:bits_size_le Unexecuted instantiation: sheervideo.c:bits_size_be Unexecuted instantiation: utvideodec.c:bits_size_le Unexecuted instantiation: utvideodec.c:bits_size_be Unexecuted instantiation: vmixdec.c:bits_size_le Unexecuted instantiation: vmixdec.c:bits_size_be Unexecuted instantiation: magicyuv.c:bits_size_le Unexecuted instantiation: magicyuv.c:bits_size_be Unexecuted instantiation: prores_raw.c:bits_size_le Unexecuted instantiation: prores_raw.c:bits_size_be Unexecuted instantiation: takdec.c:bits_size_le Unexecuted instantiation: photocd.c:bits_size_le Unexecuted instantiation: photocd.c:bits_size_be Unexecuted instantiation: mvha.c:bits_size_le Unexecuted instantiation: mvha.c:bits_size_be |
158 | | |
159 | | /** |
160 | | * Return buffer size in bytes. |
161 | | */ |
162 | | static inline int BS_FUNC(bytesize)(const BSCTX *bc, int round_up) |
163 | 0 | { |
164 | 0 | return (bc->size_in_bits + (round_up ? 7 : 0)) >> 3; |
165 | 0 | } Unexecuted instantiation: tak_parser.c:bits_bytesize_le Unexecuted instantiation: tak.c:bits_bytesize_le Unexecuted instantiation: sheervideo.c:bits_bytesize_le Unexecuted instantiation: sheervideo.c:bits_bytesize_be Unexecuted instantiation: utvideodec.c:bits_bytesize_le Unexecuted instantiation: utvideodec.c:bits_bytesize_be Unexecuted instantiation: vmixdec.c:bits_bytesize_le Unexecuted instantiation: vmixdec.c:bits_bytesize_be Unexecuted instantiation: magicyuv.c:bits_bytesize_le Unexecuted instantiation: magicyuv.c:bits_bytesize_be Unexecuted instantiation: prores_raw.c:bits_bytesize_le Unexecuted instantiation: prores_raw.c:bits_bytesize_be Unexecuted instantiation: takdec.c:bits_bytesize_le Unexecuted instantiation: photocd.c:bits_bytesize_le Unexecuted instantiation: photocd.c:bits_bytesize_be Unexecuted instantiation: mvha.c:bits_bytesize_le Unexecuted instantiation: mvha.c:bits_bytesize_be |
166 | | |
167 | | /** |
168 | | * Return the number of the bits left in a buffer. |
169 | | */ |
170 | | static inline int BS_FUNC(left)(const BSCTX *bc) |
171 | 938M | { |
172 | 938M | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; |
173 | 938M | } Unexecuted instantiation: tak_parser.c:bits_left_le Line | Count | Source | 171 | 4.55M | { | 172 | 4.55M | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; | 173 | 4.55M | } |
Unexecuted instantiation: sheervideo.c:bits_left_le Unexecuted instantiation: sheervideo.c:bits_left_be utvideodec.c:bits_left_be Line | Count | Source | 171 | 5.29M | { | 172 | 5.29M | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; | 173 | 5.29M | } |
Unexecuted instantiation: utvideodec.c:bits_left_le Line | Count | Source | 171 | 922k | { | 172 | 922k | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; | 173 | 922k | } |
Unexecuted instantiation: vmixdec.c:bits_left_le Line | Count | Source | 171 | 921M | { | 172 | 921M | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; | 173 | 921M | } |
Unexecuted instantiation: magicyuv.c:bits_left_le prores_raw.c:bits_left_be Line | Count | Source | 171 | 148k | { | 172 | 148k | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; | 173 | 148k | } |
Unexecuted instantiation: prores_raw.c:bits_left_le Line | Count | Source | 171 | 912k | { | 172 | 912k | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; | 173 | 912k | } |
Line | Count | Source | 171 | 4.73M | { | 172 | 4.73M | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; | 173 | 4.73M | } |
Unexecuted instantiation: photocd.c:bits_left_le Line | Count | Source | 171 | 461k | { | 172 | 461k | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; | 173 | 461k | } |
Unexecuted instantiation: mvha.c:bits_left_le |
174 | | |
175 | | static inline uint64_t BS_FUNC(priv_val_show)(BSCTX *bc, unsigned int n) |
176 | 4.77G | { |
177 | 4.77G | av_assert2(n > 0 && n <= 64); |
178 | | |
179 | | #ifdef BITSTREAM_TEMPLATE_LE |
180 | | return bc->bits & (UINT64_MAX >> (64 - n)); |
181 | | #else |
182 | | return bc->bits >> (64 - n); |
183 | | #endif |
184 | 4.77G | } Unexecuted instantiation: tak_parser.c:bits_priv_val_show_le tak.c:bits_priv_val_show_le Line | Count | Source | 176 | 14.9M | { | 177 | 14.9M | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | 14.9M | #ifdef BITSTREAM_TEMPLATE_LE | 180 | 14.9M | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | | return bc->bits >> (64 - n); | 183 | | #endif | 184 | 14.9M | } |
sheervideo.c:bits_priv_val_show_be Line | Count | Source | 176 | 4.45G | { | 177 | 4.45G | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | | #ifdef BITSTREAM_TEMPLATE_LE | 180 | | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | 4.45G | return bc->bits >> (64 - n); | 183 | 4.45G | #endif | 184 | 4.45G | } |
Unexecuted instantiation: sheervideo.c:bits_priv_val_show_le utvideodec.c:bits_priv_val_show_le Line | Count | Source | 176 | 29.6k | { | 177 | 29.6k | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | 29.6k | #ifdef BITSTREAM_TEMPLATE_LE | 180 | 29.6k | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | | return bc->bits >> (64 - n); | 183 | | #endif | 184 | 29.6k | } |
utvideodec.c:bits_priv_val_show_be Line | Count | Source | 176 | 3.57M | { | 177 | 3.57M | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | | #ifdef BITSTREAM_TEMPLATE_LE | 180 | | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | 3.57M | return bc->bits >> (64 - n); | 183 | 3.57M | #endif | 184 | 3.57M | } |
vmixdec.c:bits_priv_val_show_be Line | Count | Source | 176 | 2.17M | { | 177 | 2.17M | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | | #ifdef BITSTREAM_TEMPLATE_LE | 180 | | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | 2.17M | return bc->bits >> (64 - n); | 183 | 2.17M | #endif | 184 | 2.17M | } |
Unexecuted instantiation: vmixdec.c:bits_priv_val_show_le magicyuv.c:bits_priv_val_show_be Line | Count | Source | 176 | 226M | { | 177 | 226M | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | | #ifdef BITSTREAM_TEMPLATE_LE | 180 | | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | 226M | return bc->bits >> (64 - n); | 183 | 226M | #endif | 184 | 226M | } |
Unexecuted instantiation: magicyuv.c:bits_priv_val_show_le prores_raw.c:bits_priv_val_show_be Line | Count | Source | 176 | 218k | { | 177 | 218k | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | | #ifdef BITSTREAM_TEMPLATE_LE | 180 | | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | 218k | return bc->bits >> (64 - n); | 183 | 218k | #endif | 184 | 218k | } |
Unexecuted instantiation: prores_raw.c:bits_priv_val_show_le takdec.c:bits_priv_val_show_le Line | Count | Source | 176 | 64.9M | { | 177 | 64.9M | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | 64.9M | #ifdef BITSTREAM_TEMPLATE_LE | 180 | 64.9M | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | | return bc->bits >> (64 - n); | 183 | | #endif | 184 | 64.9M | } |
photocd.c:bits_priv_val_show_be Line | Count | Source | 176 | 4.74M | { | 177 | 4.74M | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | | #ifdef BITSTREAM_TEMPLATE_LE | 180 | | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | 4.74M | return bc->bits >> (64 - n); | 183 | 4.74M | #endif | 184 | 4.74M | } |
Unexecuted instantiation: photocd.c:bits_priv_val_show_le mvha.c:bits_priv_val_show_be Line | Count | Source | 176 | 1.57M | { | 177 | 1.57M | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | | #ifdef BITSTREAM_TEMPLATE_LE | 180 | | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | 1.57M | return bc->bits >> (64 - n); | 183 | 1.57M | #endif | 184 | 1.57M | } |
Unexecuted instantiation: mvha.c:bits_priv_val_show_le |
185 | | |
186 | | static inline void BS_FUNC(priv_skip_remaining)(BSCTX *bc, unsigned int n) |
187 | 4.77G | { |
188 | | #ifdef BITSTREAM_TEMPLATE_LE |
189 | | bc->bits >>= n; |
190 | | #else |
191 | | bc->bits <<= n; |
192 | | #endif |
193 | 4.77G | bc->bits_valid -= n; |
194 | 4.77G | } Unexecuted instantiation: tak_parser.c:bits_priv_skip_remaining_le tak.c:bits_priv_skip_remaining_le Line | Count | Source | 187 | 15.2M | { | 188 | 15.2M | #ifdef BITSTREAM_TEMPLATE_LE | 189 | 15.2M | bc->bits >>= n; | 190 | | #else | 191 | | bc->bits <<= n; | 192 | | #endif | 193 | 15.2M | bc->bits_valid -= n; | 194 | 15.2M | } |
sheervideo.c:bits_priv_skip_remaining_be Line | Count | Source | 187 | 4.45G | { | 188 | | #ifdef BITSTREAM_TEMPLATE_LE | 189 | | bc->bits >>= n; | 190 | | #else | 191 | 4.45G | bc->bits <<= n; | 192 | 4.45G | #endif | 193 | 4.45G | bc->bits_valid -= n; | 194 | 4.45G | } |
Unexecuted instantiation: sheervideo.c:bits_priv_skip_remaining_le utvideodec.c:bits_priv_skip_remaining_le Line | Count | Source | 187 | 29.6k | { | 188 | 29.6k | #ifdef BITSTREAM_TEMPLATE_LE | 189 | 29.6k | bc->bits >>= n; | 190 | | #else | 191 | | bc->bits <<= n; | 192 | | #endif | 193 | 29.6k | bc->bits_valid -= n; | 194 | 29.6k | } |
utvideodec.c:bits_priv_skip_remaining_be Line | Count | Source | 187 | 3.57M | { | 188 | | #ifdef BITSTREAM_TEMPLATE_LE | 189 | | bc->bits >>= n; | 190 | | #else | 191 | 3.57M | bc->bits <<= n; | 192 | 3.57M | #endif | 193 | 3.57M | bc->bits_valid -= n; | 194 | 3.57M | } |
vmixdec.c:bits_priv_skip_remaining_be Line | Count | Source | 187 | 2.17M | { | 188 | | #ifdef BITSTREAM_TEMPLATE_LE | 189 | | bc->bits >>= n; | 190 | | #else | 191 | 2.17M | bc->bits <<= n; | 192 | 2.17M | #endif | 193 | 2.17M | bc->bits_valid -= n; | 194 | 2.17M | } |
Unexecuted instantiation: vmixdec.c:bits_priv_skip_remaining_le magicyuv.c:bits_priv_skip_remaining_be Line | Count | Source | 187 | 226M | { | 188 | | #ifdef BITSTREAM_TEMPLATE_LE | 189 | | bc->bits >>= n; | 190 | | #else | 191 | 226M | bc->bits <<= n; | 192 | 226M | #endif | 193 | 226M | bc->bits_valid -= n; | 194 | 226M | } |
Unexecuted instantiation: magicyuv.c:bits_priv_skip_remaining_le prores_raw.c:bits_priv_skip_remaining_be Line | Count | Source | 187 | 67.8k | { | 188 | | #ifdef BITSTREAM_TEMPLATE_LE | 189 | | bc->bits >>= n; | 190 | | #else | 191 | 67.8k | bc->bits <<= n; | 192 | 67.8k | #endif | 193 | 67.8k | bc->bits_valid -= n; | 194 | 67.8k | } |
Unexecuted instantiation: prores_raw.c:bits_priv_skip_remaining_le takdec.c:bits_priv_skip_remaining_le Line | Count | Source | 187 | 65.7M | { | 188 | 65.7M | #ifdef BITSTREAM_TEMPLATE_LE | 189 | 65.7M | bc->bits >>= n; | 190 | | #else | 191 | | bc->bits <<= n; | 192 | | #endif | 193 | 65.7M | bc->bits_valid -= n; | 194 | 65.7M | } |
photocd.c:bits_priv_skip_remaining_be Line | Count | Source | 187 | 4.74M | { | 188 | | #ifdef BITSTREAM_TEMPLATE_LE | 189 | | bc->bits >>= n; | 190 | | #else | 191 | 4.74M | bc->bits <<= n; | 192 | 4.74M | #endif | 193 | 4.74M | bc->bits_valid -= n; | 194 | 4.74M | } |
Unexecuted instantiation: photocd.c:bits_priv_skip_remaining_le mvha.c:bits_priv_skip_remaining_be Line | Count | Source | 187 | 1.61M | { | 188 | | #ifdef BITSTREAM_TEMPLATE_LE | 189 | | bc->bits >>= n; | 190 | | #else | 191 | 1.61M | bc->bits <<= n; | 192 | 1.61M | #endif | 193 | 1.61M | bc->bits_valid -= n; | 194 | 1.61M | } |
Unexecuted instantiation: mvha.c:bits_priv_skip_remaining_le |
195 | | |
196 | | static inline uint64_t BS_FUNC(priv_val_get)(BSCTX *bc, unsigned int n) |
197 | 267M | { |
198 | 267M | uint64_t ret; |
199 | | |
200 | 267M | av_assert2(n > 0 && n < 64); |
201 | | |
202 | 267M | ret = BS_FUNC(priv_val_show)(bc, n); |
203 | 267M | BS_FUNC(priv_skip_remaining)(bc, n); |
204 | | |
205 | 267M | return ret; |
206 | 267M | } Unexecuted instantiation: tak_parser.c:bits_priv_val_get_le tak.c:bits_priv_val_get_le Line | Count | Source | 197 | 14.9M | { | 198 | 14.9M | uint64_t ret; | 199 | | | 200 | 14.9M | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 14.9M | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 14.9M | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 14.9M | return ret; | 206 | 14.9M | } |
sheervideo.c:bits_priv_val_get_be Line | Count | Source | 197 | 185M | { | 198 | 185M | uint64_t ret; | 199 | | | 200 | 185M | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 185M | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 185M | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 185M | return ret; | 206 | 185M | } |
Unexecuted instantiation: sheervideo.c:bits_priv_val_get_le utvideodec.c:bits_priv_val_get_le Line | Count | Source | 197 | 29.6k | { | 198 | 29.6k | uint64_t ret; | 199 | | | 200 | 29.6k | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 29.6k | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 29.6k | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 29.6k | return ret; | 206 | 29.6k | } |
Unexecuted instantiation: utvideodec.c:bits_priv_val_get_be vmixdec.c:bits_priv_val_get_be Line | Count | Source | 197 | 1.08M | { | 198 | 1.08M | uint64_t ret; | 199 | | | 200 | 1.08M | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 1.08M | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 1.08M | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 1.08M | return ret; | 206 | 1.08M | } |
Unexecuted instantiation: vmixdec.c:bits_priv_val_get_le magicyuv.c:bits_priv_val_get_be Line | Count | Source | 197 | 157k | { | 198 | 157k | uint64_t ret; | 199 | | | 200 | 157k | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 157k | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 157k | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 157k | return ret; | 206 | 157k | } |
Unexecuted instantiation: magicyuv.c:bits_priv_val_get_le prores_raw.c:bits_priv_val_get_be Line | Count | Source | 197 | 44.7k | { | 198 | 44.7k | uint64_t ret; | 199 | | | 200 | 44.7k | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 44.7k | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 44.7k | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 44.7k | return ret; | 206 | 44.7k | } |
Unexecuted instantiation: prores_raw.c:bits_priv_val_get_le takdec.c:bits_priv_val_get_le Line | Count | Source | 197 | 64.9M | { | 198 | 64.9M | uint64_t ret; | 199 | | | 200 | 64.9M | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 64.9M | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 64.9M | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 64.9M | return ret; | 206 | 64.9M | } |
photocd.c:bits_priv_val_get_be Line | Count | Source | 197 | 4.11k | { | 198 | 4.11k | uint64_t ret; | 199 | | | 200 | 4.11k | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 4.11k | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 4.11k | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 4.11k | return ret; | 206 | 4.11k | } |
Unexecuted instantiation: photocd.c:bits_priv_val_get_le mvha.c:bits_priv_val_get_be Line | Count | Source | 197 | 569k | { | 198 | 569k | uint64_t ret; | 199 | | | 200 | 569k | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 569k | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 569k | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 569k | return ret; | 206 | 569k | } |
Unexecuted instantiation: mvha.c:bits_priv_val_get_le |
207 | | |
208 | | /** |
209 | | * Return one bit from the buffer. |
210 | | */ |
211 | | static inline unsigned int BS_FUNC(read_bit)(BSCTX *bc) |
212 | 68.7M | { |
213 | 68.7M | if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0) |
214 | 1.93M | return 0; |
215 | | |
216 | 66.7M | return BS_FUNC(priv_val_get)(bc, 1); |
217 | 68.7M | } Unexecuted instantiation: tak_parser.c:bits_read_bit_le Line | Count | Source | 212 | 113k | { | 213 | 113k | if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0) | 214 | 1.38k | return 0; | 215 | | | 216 | 112k | return BS_FUNC(priv_val_get)(bc, 1); | 217 | 113k | } |
sheervideo.c:bits_read_bit_be Line | Count | Source | 212 | 60.3M | { | 213 | 60.3M | if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0) | 214 | 47.3k | return 0; | 215 | | | 216 | 60.3M | return BS_FUNC(priv_val_get)(bc, 1); | 217 | 60.3M | } |
Unexecuted instantiation: sheervideo.c:bits_read_bit_le Unexecuted instantiation: utvideodec.c:bits_read_bit_le Unexecuted instantiation: utvideodec.c:bits_read_bit_be Unexecuted instantiation: vmixdec.c:bits_read_bit_le Unexecuted instantiation: vmixdec.c:bits_read_bit_be Unexecuted instantiation: magicyuv.c:bits_read_bit_le Unexecuted instantiation: magicyuv.c:bits_read_bit_be prores_raw.c:bits_read_bit_be Line | Count | Source | 212 | 44.9k | { | 213 | 44.9k | if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0) | 214 | 264 | return 0; | 215 | | | 216 | 44.7k | return BS_FUNC(priv_val_get)(bc, 1); | 217 | 44.9k | } |
Unexecuted instantiation: prores_raw.c:bits_read_bit_le takdec.c:bits_read_bit_le Line | Count | Source | 212 | 7.95M | { | 213 | 7.95M | if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0) | 214 | 1.88M | return 0; | 215 | | | 216 | 6.07M | return BS_FUNC(priv_val_get)(bc, 1); | 217 | 7.95M | } |
Unexecuted instantiation: photocd.c:bits_read_bit_le Unexecuted instantiation: photocd.c:bits_read_bit_be Line | Count | Source | 212 | 249k | { | 213 | 249k | if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0) | 214 | 0 | return 0; | 215 | | | 216 | 249k | return BS_FUNC(priv_val_get)(bc, 1); | 217 | 249k | } |
Unexecuted instantiation: mvha.c:bits_read_bit_le |
218 | | |
219 | | /** |
220 | | * Return n bits from the buffer, n has to be in the 1-32 range. |
221 | | * May be faster than bits_read() when n is not a compile-time constant and is |
222 | | * known to be non-zero; |
223 | | */ |
224 | | static inline uint32_t BS_FUNC(read_nz)(BSCTX *bc, unsigned int n) |
225 | 200M | { |
226 | 200M | av_assert2(n > 0 && n <= 32); |
227 | | |
228 | 200M | if (n > bc->bits_valid) { |
229 | 151M | if (BS_FUNC(priv_refill_32)(bc) < 0) |
230 | 142M | bc->bits_valid = n; |
231 | 151M | } |
232 | | |
233 | 200M | return BS_FUNC(priv_val_get)(bc, n); |
234 | 200M | } Unexecuted instantiation: tak_parser.c:bits_read_nz_le Line | Count | Source | 225 | 14.6M | { | 226 | 14.6M | av_assert2(n > 0 && n <= 32); | 227 | | | 228 | 14.6M | if (n > bc->bits_valid) { | 229 | 83.6k | if (BS_FUNC(priv_refill_32)(bc) < 0) | 230 | 9.13k | bc->bits_valid = n; | 231 | 83.6k | } | 232 | | | 233 | 14.6M | return BS_FUNC(priv_val_get)(bc, n); | 234 | 14.6M | } |
sheervideo.c:bits_read_nz_be Line | Count | Source | 225 | 125M | { | 226 | 125M | av_assert2(n > 0 && n <= 32); | 227 | | | 228 | 125M | if (n > bc->bits_valid) { | 229 | 101M | if (BS_FUNC(priv_refill_32)(bc) < 0) | 230 | 92.4M | bc->bits_valid = n; | 231 | 101M | } | 232 | | | 233 | 125M | return BS_FUNC(priv_val_get)(bc, n); | 234 | 125M | } |
Unexecuted instantiation: sheervideo.c:bits_read_nz_le utvideodec.c:bits_read_nz_le Line | Count | Source | 225 | 29.6k | { | 226 | 29.6k | av_assert2(n > 0 && n <= 32); | 227 | | | 228 | 29.6k | if (n > bc->bits_valid) { | 229 | 2.26k | if (BS_FUNC(priv_refill_32)(bc) < 0) | 230 | 0 | bc->bits_valid = n; | 231 | 2.26k | } | 232 | | | 233 | 29.6k | return BS_FUNC(priv_val_get)(bc, n); | 234 | 29.6k | } |
Unexecuted instantiation: utvideodec.c:bits_read_nz_be vmixdec.c:bits_read_nz_be Line | Count | Source | 225 | 1.08M | { | 226 | 1.08M | av_assert2(n > 0 && n <= 32); | 227 | | | 228 | 1.08M | if (n > bc->bits_valid) { | 229 | 29.1k | if (BS_FUNC(priv_refill_32)(bc) < 0) | 230 | 4.54k | bc->bits_valid = n; | 231 | 29.1k | } | 232 | | | 233 | 1.08M | return BS_FUNC(priv_val_get)(bc, n); | 234 | 1.08M | } |
Unexecuted instantiation: vmixdec.c:bits_read_nz_le magicyuv.c:bits_read_nz_be Line | Count | Source | 225 | 157k | { | 226 | 157k | av_assert2(n > 0 && n <= 32); | 227 | | | 228 | 157k | if (n > bc->bits_valid) { | 229 | 43.6k | if (BS_FUNC(priv_refill_32)(bc) < 0) | 230 | 0 | bc->bits_valid = n; | 231 | 43.6k | } | 232 | | | 233 | 157k | return BS_FUNC(priv_val_get)(bc, n); | 234 | 157k | } |
Unexecuted instantiation: magicyuv.c:bits_read_nz_le Unexecuted instantiation: prores_raw.c:bits_read_nz_le Unexecuted instantiation: prores_raw.c:bits_read_nz_be Line | Count | Source | 225 | 58.8M | { | 226 | 58.8M | av_assert2(n > 0 && n <= 32); | 227 | | | 228 | 58.8M | if (n > bc->bits_valid) { | 229 | 50.2M | if (BS_FUNC(priv_refill_32)(bc) < 0) | 230 | 49.8M | bc->bits_valid = n; | 231 | 50.2M | } | 232 | | | 233 | 58.8M | return BS_FUNC(priv_val_get)(bc, n); | 234 | 58.8M | } |
photocd.c:bits_read_nz_be Line | Count | Source | 225 | 4.11k | { | 226 | 4.11k | av_assert2(n > 0 && n <= 32); | 227 | | | 228 | 4.11k | if (n > bc->bits_valid) { | 229 | 2 | if (BS_FUNC(priv_refill_32)(bc) < 0) | 230 | 2 | bc->bits_valid = n; | 231 | 2 | } | 232 | | | 233 | 4.11k | return BS_FUNC(priv_val_get)(bc, n); | 234 | 4.11k | } |
Unexecuted instantiation: photocd.c:bits_read_nz_le Line | Count | Source | 225 | 320k | { | 226 | 320k | av_assert2(n > 0 && n <= 32); | 227 | | | 228 | 320k | if (n > bc->bits_valid) { | 229 | 27.2k | if (BS_FUNC(priv_refill_32)(bc) < 0) | 230 | 325 | bc->bits_valid = n; | 231 | 27.2k | } | 232 | | | 233 | 320k | return BS_FUNC(priv_val_get)(bc, n); | 234 | 320k | } |
Unexecuted instantiation: mvha.c:bits_read_nz_le |
235 | | |
236 | | /** |
237 | | * Return n bits from the buffer, n has to be in the 0-32 range. |
238 | | */ |
239 | | static inline uint32_t BS_FUNC(read)(BSCTX *bc, unsigned int n) |
240 | 50.6M | { |
241 | 50.6M | av_assert2(n <= 32); |
242 | | |
243 | 50.6M | if (!n) |
244 | 0 | return 0; |
245 | | |
246 | 50.6M | return BS_FUNC(read_nz)(bc, n); |
247 | 50.6M | } Unexecuted instantiation: tak_parser.c:bits_read_le Unexecuted instantiation: tak.c:bits_read_le Unexecuted instantiation: sheervideo.c:bits_read_le Unexecuted instantiation: sheervideo.c:bits_read_be utvideodec.c:bits_read_le Line | Count | Source | 240 | 29.6k | { | 241 | 29.6k | av_assert2(n <= 32); | 242 | | | 243 | 29.6k | if (!n) | 244 | 0 | return 0; | 245 | | | 246 | 29.6k | return BS_FUNC(read_nz)(bc, n); | 247 | 29.6k | } |
Unexecuted instantiation: utvideodec.c:bits_read_be Line | Count | Source | 240 | 1.08M | { | 241 | 1.08M | av_assert2(n <= 32); | 242 | | | 243 | 1.08M | if (!n) | 244 | 0 | return 0; | 245 | | | 246 | 1.08M | return BS_FUNC(read_nz)(bc, n); | 247 | 1.08M | } |
Unexecuted instantiation: vmixdec.c:bits_read_le Unexecuted instantiation: magicyuv.c:bits_read_le Unexecuted instantiation: magicyuv.c:bits_read_be Unexecuted instantiation: prores_raw.c:bits_read_le Unexecuted instantiation: prores_raw.c:bits_read_be Line | Count | Source | 240 | 49.4M | { | 241 | 49.4M | av_assert2(n <= 32); | 242 | | | 243 | 49.4M | if (!n) | 244 | 0 | return 0; | 245 | | | 246 | 49.4M | return BS_FUNC(read_nz)(bc, n); | 247 | 49.4M | } |
Unexecuted instantiation: photocd.c:bits_read_le Unexecuted instantiation: photocd.c:bits_read_be Unexecuted instantiation: mvha.c:bits_read_le Unexecuted instantiation: mvha.c:bits_read_be |
248 | | |
249 | | /** |
250 | | * Return n bits from the buffer, n has to be in the 0-63 range. |
251 | | */ |
252 | | static inline uint64_t BS_FUNC(read_63)(BSCTX *bc, unsigned int n) |
253 | 86.8k | { |
254 | 86.8k | uint64_t ret = 0; |
255 | 86.8k | unsigned left = 0; |
256 | | |
257 | 86.8k | av_assert2(n <= 63); |
258 | | |
259 | 86.8k | if (!n) |
260 | 0 | return 0; |
261 | | |
262 | 86.8k | if (n > bc->bits_valid) { |
263 | 63.8k | left = bc->bits_valid; |
264 | 63.8k | n -= left; |
265 | | |
266 | 63.8k | if (left) |
267 | 63.8k | ret = BS_FUNC(priv_val_get)(bc, left); |
268 | | |
269 | 63.8k | if (BS_FUNC(priv_refill_64)(bc) < 0) |
270 | 506 | bc->bits_valid = n; |
271 | | |
272 | 63.8k | } |
273 | | |
274 | 86.8k | #ifdef BITSTREAM_TEMPLATE_LE |
275 | 86.8k | ret = BS_FUNC(priv_val_get)(bc, n) << left | ret; |
276 | | #else |
277 | | ret = BS_FUNC(priv_val_get)(bc, n) | ret << n; |
278 | | #endif |
279 | | |
280 | 86.8k | return ret; |
281 | 86.8k | } Unexecuted instantiation: tak_parser.c:bits_read_63_le Line | Count | Source | 253 | 86.8k | { | 254 | 86.8k | uint64_t ret = 0; | 255 | 86.8k | unsigned left = 0; | 256 | | | 257 | 86.8k | av_assert2(n <= 63); | 258 | | | 259 | 86.8k | if (!n) | 260 | 0 | return 0; | 261 | | | 262 | 86.8k | if (n > bc->bits_valid) { | 263 | 63.8k | left = bc->bits_valid; | 264 | 63.8k | n -= left; | 265 | | | 266 | 63.8k | if (left) | 267 | 63.8k | ret = BS_FUNC(priv_val_get)(bc, left); | 268 | | | 269 | 63.8k | if (BS_FUNC(priv_refill_64)(bc) < 0) | 270 | 506 | bc->bits_valid = n; | 271 | | | 272 | 63.8k | } | 273 | | | 274 | 86.8k | #ifdef BITSTREAM_TEMPLATE_LE | 275 | 86.8k | ret = BS_FUNC(priv_val_get)(bc, n) << left | ret; | 276 | | #else | 277 | | ret = BS_FUNC(priv_val_get)(bc, n) | ret << n; | 278 | | #endif | 279 | | | 280 | 86.8k | return ret; | 281 | 86.8k | } |
Unexecuted instantiation: sheervideo.c:bits_read_63_le Unexecuted instantiation: sheervideo.c:bits_read_63_be Unexecuted instantiation: utvideodec.c:bits_read_63_le Unexecuted instantiation: utvideodec.c:bits_read_63_be Unexecuted instantiation: vmixdec.c:bits_read_63_le Unexecuted instantiation: vmixdec.c:bits_read_63_be Unexecuted instantiation: magicyuv.c:bits_read_63_le Unexecuted instantiation: magicyuv.c:bits_read_63_be Unexecuted instantiation: prores_raw.c:bits_read_63_le Unexecuted instantiation: prores_raw.c:bits_read_63_be Unexecuted instantiation: takdec.c:bits_read_63_le Unexecuted instantiation: photocd.c:bits_read_63_le Unexecuted instantiation: photocd.c:bits_read_63_be Unexecuted instantiation: mvha.c:bits_read_63_le Unexecuted instantiation: mvha.c:bits_read_63_be |
282 | | |
283 | | /** |
284 | | * Return n bits from the buffer, n has to be in the 0-64 range. |
285 | | */ |
286 | | static inline uint64_t BS_FUNC(read_64)(BSCTX *bc, unsigned int n) |
287 | 86.8k | { |
288 | 86.8k | av_assert2(n <= 64); |
289 | | |
290 | 86.8k | if (n == 64) { |
291 | 0 | uint64_t ret = BS_FUNC(read_63)(bc, 63); |
292 | 0 | #ifdef BITSTREAM_TEMPLATE_LE |
293 | 0 | return ret | ((uint64_t)BS_FUNC(read_bit)(bc) << 63); |
294 | | #else |
295 | | return (ret << 1) | (uint64_t)BS_FUNC(read_bit)(bc); |
296 | | #endif |
297 | 0 | } |
298 | 86.8k | return BS_FUNC(read_63)(bc, n); |
299 | 86.8k | } Unexecuted instantiation: tak_parser.c:bits_read_64_le Line | Count | Source | 287 | 86.8k | { | 288 | 86.8k | av_assert2(n <= 64); | 289 | | | 290 | 86.8k | if (n == 64) { | 291 | 0 | uint64_t ret = BS_FUNC(read_63)(bc, 63); | 292 | 0 | #ifdef BITSTREAM_TEMPLATE_LE | 293 | 0 | return ret | ((uint64_t)BS_FUNC(read_bit)(bc) << 63); | 294 | | #else | 295 | | return (ret << 1) | (uint64_t)BS_FUNC(read_bit)(bc); | 296 | | #endif | 297 | 0 | } | 298 | 86.8k | return BS_FUNC(read_63)(bc, n); | 299 | 86.8k | } |
Unexecuted instantiation: sheervideo.c:bits_read_64_le Unexecuted instantiation: sheervideo.c:bits_read_64_be Unexecuted instantiation: utvideodec.c:bits_read_64_le Unexecuted instantiation: utvideodec.c:bits_read_64_be Unexecuted instantiation: vmixdec.c:bits_read_64_le Unexecuted instantiation: vmixdec.c:bits_read_64_be Unexecuted instantiation: magicyuv.c:bits_read_64_le Unexecuted instantiation: magicyuv.c:bits_read_64_be Unexecuted instantiation: prores_raw.c:bits_read_64_le Unexecuted instantiation: prores_raw.c:bits_read_64_be Unexecuted instantiation: takdec.c:bits_read_64_le Unexecuted instantiation: photocd.c:bits_read_64_le Unexecuted instantiation: photocd.c:bits_read_64_be Unexecuted instantiation: mvha.c:bits_read_64_le Unexecuted instantiation: mvha.c:bits_read_64_be |
300 | | |
301 | | /** |
302 | | * Return n bits from the buffer as a signed integer, n has to be in the 1-32 |
303 | | * range. May be faster than bits_read_signed() when n is not a compile-time |
304 | | * constant and is known to be non-zero; |
305 | | */ |
306 | | static inline int32_t BS_FUNC(read_signed_nz)(BSCTX *bc, unsigned int n) |
307 | 1.79M | { |
308 | 1.79M | av_assert2(n > 0 && n <= 32); |
309 | 1.79M | return sign_extend(BS_FUNC(read_nz)(bc, n), n); |
310 | 1.79M | } Unexecuted instantiation: tak_parser.c:bits_read_signed_nz_le Unexecuted instantiation: tak.c:bits_read_signed_nz_le Unexecuted instantiation: sheervideo.c:bits_read_signed_nz_le Unexecuted instantiation: sheervideo.c:bits_read_signed_nz_be Unexecuted instantiation: utvideodec.c:bits_read_signed_nz_le Unexecuted instantiation: utvideodec.c:bits_read_signed_nz_be Unexecuted instantiation: vmixdec.c:bits_read_signed_nz_le Unexecuted instantiation: vmixdec.c:bits_read_signed_nz_be Unexecuted instantiation: magicyuv.c:bits_read_signed_nz_le Unexecuted instantiation: magicyuv.c:bits_read_signed_nz_be Unexecuted instantiation: prores_raw.c:bits_read_signed_nz_le Unexecuted instantiation: prores_raw.c:bits_read_signed_nz_be takdec.c:bits_read_signed_nz_le Line | Count | Source | 307 | 1.79M | { | 308 | 1.79M | av_assert2(n > 0 && n <= 32); | 309 | 1.79M | return sign_extend(BS_FUNC(read_nz)(bc, n), n); | 310 | 1.79M | } |
Unexecuted instantiation: photocd.c:bits_read_signed_nz_le Unexecuted instantiation: photocd.c:bits_read_signed_nz_be Unexecuted instantiation: mvha.c:bits_read_signed_nz_le Unexecuted instantiation: mvha.c:bits_read_signed_nz_be |
311 | | |
312 | | /** |
313 | | * Return n bits from the buffer as a signed integer. |
314 | | * n has to be in the 0-32 range. |
315 | | */ |
316 | | static inline int32_t BS_FUNC(read_signed)(BSCTX *bc, unsigned int n) |
317 | 0 | { |
318 | 0 | av_assert2(n <= 32); |
319 | 0 |
|
320 | 0 | if (!n) |
321 | 0 | return 0; |
322 | 0 |
|
323 | 0 | return BS_FUNC(read_signed_nz)(bc, n); |
324 | 0 | } Unexecuted instantiation: tak_parser.c:bits_read_signed_le Unexecuted instantiation: tak.c:bits_read_signed_le Unexecuted instantiation: sheervideo.c:bits_read_signed_le Unexecuted instantiation: sheervideo.c:bits_read_signed_be Unexecuted instantiation: utvideodec.c:bits_read_signed_le Unexecuted instantiation: utvideodec.c:bits_read_signed_be Unexecuted instantiation: vmixdec.c:bits_read_signed_le Unexecuted instantiation: vmixdec.c:bits_read_signed_be Unexecuted instantiation: magicyuv.c:bits_read_signed_le Unexecuted instantiation: magicyuv.c:bits_read_signed_be Unexecuted instantiation: prores_raw.c:bits_read_signed_le Unexecuted instantiation: prores_raw.c:bits_read_signed_be Unexecuted instantiation: takdec.c:bits_read_signed_le Unexecuted instantiation: photocd.c:bits_read_signed_le Unexecuted instantiation: photocd.c:bits_read_signed_be Unexecuted instantiation: mvha.c:bits_read_signed_le Unexecuted instantiation: mvha.c:bits_read_signed_be |
325 | | |
326 | | /** |
327 | | * Return n bits from the buffer but do not change the buffer state. |
328 | | * n has to be in the 1-32 range. May |
329 | | */ |
330 | | static inline uint32_t BS_FUNC(peek_nz)(BSCTX *bc, unsigned int n) |
331 | 4.51G | { |
332 | 4.51G | av_assert2(n > 0 && n <= 32); |
333 | | |
334 | 4.51G | if (n > bc->bits_valid) |
335 | 17.4M | BS_FUNC(priv_refill_32)(bc); |
336 | | |
337 | 4.51G | return BS_FUNC(priv_val_show)(bc, n); |
338 | 4.51G | } Unexecuted instantiation: tak_parser.c:bits_peek_nz_le Unexecuted instantiation: tak.c:bits_peek_nz_le sheervideo.c:bits_peek_nz_be Line | Count | Source | 331 | 4.27G | { | 332 | 4.27G | av_assert2(n > 0 && n <= 32); | 333 | | | 334 | 4.27G | if (n > bc->bits_valid) | 335 | 15.2M | BS_FUNC(priv_refill_32)(bc); | 336 | | | 337 | 4.27G | return BS_FUNC(priv_val_show)(bc, n); | 338 | 4.27G | } |
Unexecuted instantiation: sheervideo.c:bits_peek_nz_le utvideodec.c:bits_peek_nz_be Line | Count | Source | 331 | 3.57M | { | 332 | 3.57M | av_assert2(n > 0 && n <= 32); | 333 | | | 334 | 3.57M | if (n > bc->bits_valid) | 335 | 133k | BS_FUNC(priv_refill_32)(bc); | 336 | | | 337 | 3.57M | return BS_FUNC(priv_val_show)(bc, n); | 338 | 3.57M | } |
Unexecuted instantiation: utvideodec.c:bits_peek_nz_le vmixdec.c:bits_peek_nz_be Line | Count | Source | 331 | 1.08M | { | 332 | 1.08M | av_assert2(n > 0 && n <= 32); | 333 | | | 334 | 1.08M | if (n > bc->bits_valid) | 335 | 175k | BS_FUNC(priv_refill_32)(bc); | 336 | | | 337 | 1.08M | return BS_FUNC(priv_val_show)(bc, n); | 338 | 1.08M | } |
Unexecuted instantiation: vmixdec.c:bits_peek_nz_le magicyuv.c:bits_peek_nz_be Line | Count | Source | 331 | 226M | { | 332 | 226M | av_assert2(n > 0 && n <= 32); | 333 | | | 334 | 226M | if (n > bc->bits_valid) | 335 | 1.45M | BS_FUNC(priv_refill_32)(bc); | 336 | | | 337 | 226M | return BS_FUNC(priv_val_show)(bc, n); | 338 | 226M | } |
Unexecuted instantiation: magicyuv.c:bits_peek_nz_le prores_raw.c:bits_peek_nz_be Line | Count | Source | 331 | 173k | { | 332 | 173k | av_assert2(n > 0 && n <= 32); | 333 | | | 334 | 173k | if (n > bc->bits_valid) | 335 | 40.4k | BS_FUNC(priv_refill_32)(bc); | 336 | | | 337 | 173k | return BS_FUNC(priv_val_show)(bc, n); | 338 | 173k | } |
Unexecuted instantiation: prores_raw.c:bits_peek_nz_le Unexecuted instantiation: takdec.c:bits_peek_nz_le photocd.c:bits_peek_nz_be Line | Count | Source | 331 | 4.74M | { | 332 | 4.74M | av_assert2(n > 0 && n <= 32); | 333 | | | 334 | 4.74M | if (n > bc->bits_valid) | 335 | 308k | BS_FUNC(priv_refill_32)(bc); | 336 | | | 337 | 4.74M | return BS_FUNC(priv_val_show)(bc, n); | 338 | 4.74M | } |
Unexecuted instantiation: photocd.c:bits_peek_nz_le Line | Count | Source | 331 | 1.00M | { | 332 | 1.00M | av_assert2(n > 0 && n <= 32); | 333 | | | 334 | 1.00M | if (n > bc->bits_valid) | 335 | 80.3k | BS_FUNC(priv_refill_32)(bc); | 336 | | | 337 | 1.00M | return BS_FUNC(priv_val_show)(bc, n); | 338 | 1.00M | } |
Unexecuted instantiation: mvha.c:bits_peek_nz_le |
339 | | |
340 | | /** |
341 | | * Return n bits from the buffer but do not change the buffer state. |
342 | | * n has to be in the 0-32 range. |
343 | | */ |
344 | | static inline uint32_t BS_FUNC(peek)(BSCTX *bc, unsigned int n) |
345 | 4.51G | { |
346 | 4.51G | av_assert2(n <= 32); |
347 | | |
348 | 4.51G | if (!n) |
349 | 0 | return 0; |
350 | | |
351 | 4.51G | return BS_FUNC(peek_nz)(bc, n); |
352 | 4.51G | } Unexecuted instantiation: tak_parser.c:bits_peek_le Unexecuted instantiation: tak.c:bits_peek_le sheervideo.c:bits_peek_be Line | Count | Source | 345 | 4.27G | { | 346 | 4.27G | av_assert2(n <= 32); | 347 | | | 348 | 4.27G | if (!n) | 349 | 0 | return 0; | 350 | | | 351 | 4.27G | return BS_FUNC(peek_nz)(bc, n); | 352 | 4.27G | } |
Unexecuted instantiation: sheervideo.c:bits_peek_le utvideodec.c:bits_peek_be Line | Count | Source | 345 | 3.57M | { | 346 | 3.57M | av_assert2(n <= 32); | 347 | | | 348 | 3.57M | if (!n) | 349 | 0 | return 0; | 350 | | | 351 | 3.57M | return BS_FUNC(peek_nz)(bc, n); | 352 | 3.57M | } |
Unexecuted instantiation: utvideodec.c:bits_peek_le Line | Count | Source | 345 | 1.08M | { | 346 | 1.08M | av_assert2(n <= 32); | 347 | | | 348 | 1.08M | if (!n) | 349 | 0 | return 0; | 350 | | | 351 | 1.08M | return BS_FUNC(peek_nz)(bc, n); | 352 | 1.08M | } |
Unexecuted instantiation: vmixdec.c:bits_peek_le Line | Count | Source | 345 | 226M | { | 346 | 226M | av_assert2(n <= 32); | 347 | | | 348 | 226M | if (!n) | 349 | 0 | return 0; | 350 | | | 351 | 226M | return BS_FUNC(peek_nz)(bc, n); | 352 | 226M | } |
Unexecuted instantiation: magicyuv.c:bits_peek_le prores_raw.c:bits_peek_be Line | Count | Source | 345 | 173k | { | 346 | 173k | av_assert2(n <= 32); | 347 | | | 348 | 173k | if (!n) | 349 | 0 | return 0; | 350 | | | 351 | 173k | return BS_FUNC(peek_nz)(bc, n); | 352 | 173k | } |
Unexecuted instantiation: prores_raw.c:bits_peek_le Unexecuted instantiation: takdec.c:bits_peek_le Line | Count | Source | 345 | 4.74M | { | 346 | 4.74M | av_assert2(n <= 32); | 347 | | | 348 | 4.74M | if (!n) | 349 | 0 | return 0; | 350 | | | 351 | 4.74M | return BS_FUNC(peek_nz)(bc, n); | 352 | 4.74M | } |
Unexecuted instantiation: photocd.c:bits_peek_le Line | Count | Source | 345 | 1.00M | { | 346 | 1.00M | av_assert2(n <= 32); | 347 | | | 348 | 1.00M | if (!n) | 349 | 0 | return 0; | 350 | | | 351 | 1.00M | return BS_FUNC(peek_nz)(bc, n); | 352 | 1.00M | } |
Unexecuted instantiation: mvha.c:bits_peek_le |
353 | | |
354 | | /** |
355 | | * Return n bits from the buffer as a signed integer, do not change the buffer |
356 | | * state. n has to be in the 1-32 range. May be faster than bits_peek_signed() |
357 | | * when n is not a compile-time constant and is known to be non-zero; |
358 | | */ |
359 | | static inline int BS_FUNC(peek_signed_nz)(BSCTX *bc, unsigned int n) |
360 | 0 | { |
361 | 0 | av_assert2(n > 0 && n <= 32); |
362 | 0 | return sign_extend(BS_FUNC(peek_nz)(bc, n), n); |
363 | 0 | } Unexecuted instantiation: tak_parser.c:bits_peek_signed_nz_le Unexecuted instantiation: tak.c:bits_peek_signed_nz_le Unexecuted instantiation: sheervideo.c:bits_peek_signed_nz_le Unexecuted instantiation: sheervideo.c:bits_peek_signed_nz_be Unexecuted instantiation: utvideodec.c:bits_peek_signed_nz_le Unexecuted instantiation: utvideodec.c:bits_peek_signed_nz_be Unexecuted instantiation: vmixdec.c:bits_peek_signed_nz_le Unexecuted instantiation: vmixdec.c:bits_peek_signed_nz_be Unexecuted instantiation: magicyuv.c:bits_peek_signed_nz_le Unexecuted instantiation: magicyuv.c:bits_peek_signed_nz_be Unexecuted instantiation: prores_raw.c:bits_peek_signed_nz_le Unexecuted instantiation: prores_raw.c:bits_peek_signed_nz_be Unexecuted instantiation: takdec.c:bits_peek_signed_nz_le Unexecuted instantiation: photocd.c:bits_peek_signed_nz_le Unexecuted instantiation: photocd.c:bits_peek_signed_nz_be Unexecuted instantiation: mvha.c:bits_peek_signed_nz_le Unexecuted instantiation: mvha.c:bits_peek_signed_nz_be |
364 | | |
365 | | /** |
366 | | * Return n bits from the buffer as a signed integer, |
367 | | * do not change the buffer state. |
368 | | * n has to be in the 0-32 range. |
369 | | */ |
370 | | static inline int BS_FUNC(peek_signed)(BSCTX *bc, unsigned int n) |
371 | 0 | { |
372 | 0 | av_assert2(n <= 32); |
373 | 0 |
|
374 | 0 | if (!n) |
375 | 0 | return 0; |
376 | 0 |
|
377 | 0 | return BS_FUNC(peek_signed_nz)(bc, n); |
378 | 0 | } Unexecuted instantiation: tak_parser.c:bits_peek_signed_le Unexecuted instantiation: tak.c:bits_peek_signed_le Unexecuted instantiation: sheervideo.c:bits_peek_signed_le Unexecuted instantiation: sheervideo.c:bits_peek_signed_be Unexecuted instantiation: utvideodec.c:bits_peek_signed_le Unexecuted instantiation: utvideodec.c:bits_peek_signed_be Unexecuted instantiation: vmixdec.c:bits_peek_signed_le Unexecuted instantiation: vmixdec.c:bits_peek_signed_be Unexecuted instantiation: magicyuv.c:bits_peek_signed_le Unexecuted instantiation: magicyuv.c:bits_peek_signed_be Unexecuted instantiation: prores_raw.c:bits_peek_signed_le Unexecuted instantiation: prores_raw.c:bits_peek_signed_be Unexecuted instantiation: takdec.c:bits_peek_signed_le Unexecuted instantiation: photocd.c:bits_peek_signed_le Unexecuted instantiation: photocd.c:bits_peek_signed_be Unexecuted instantiation: mvha.c:bits_peek_signed_le Unexecuted instantiation: mvha.c:bits_peek_signed_be |
379 | | |
380 | | /** |
381 | | * Skip n bits in the buffer. |
382 | | */ |
383 | | static inline void BS_FUNC(skip)(BSCTX *bc, unsigned int n) |
384 | 7.78M | { |
385 | 7.78M | if (n < bc->bits_valid) |
386 | 2.47M | BS_FUNC(priv_skip_remaining)(bc, n); |
387 | 5.30M | else { |
388 | 5.30M | n -= bc->bits_valid; |
389 | 5.30M | bc->bits = 0; |
390 | 5.30M | bc->bits_valid = 0; |
391 | | |
392 | 5.30M | if (n >= 64) { |
393 | 0 | unsigned int skip = n / 8; |
394 | |
|
395 | 0 | n -= skip * 8; |
396 | 0 | bc->ptr += skip; |
397 | 0 | } |
398 | 5.30M | BS_FUNC(priv_refill_64)(bc); |
399 | 5.30M | if (n) |
400 | 732k | BS_FUNC(priv_skip_remaining)(bc, n); |
401 | 5.30M | } |
402 | 7.78M | } Unexecuted instantiation: tak_parser.c:bits_skip_le Line | Count | Source | 384 | 4.80M | { | 385 | 4.80M | if (n < bc->bits_valid) | 386 | 216k | BS_FUNC(priv_skip_remaining)(bc, n); | 387 | 4.58M | else { | 388 | 4.58M | n -= bc->bits_valid; | 389 | 4.58M | bc->bits = 0; | 390 | 4.58M | bc->bits_valid = 0; | 391 | | | 392 | 4.58M | if (n >= 64) { | 393 | 0 | unsigned int skip = n / 8; | 394 | |
| 395 | 0 | n -= skip * 8; | 396 | 0 | bc->ptr += skip; | 397 | 0 | } | 398 | 4.58M | BS_FUNC(priv_refill_64)(bc); | 399 | 4.58M | if (n) | 400 | 67.8k | BS_FUNC(priv_skip_remaining)(bc, n); | 401 | 4.58M | } | 402 | 4.80M | } |
Unexecuted instantiation: sheervideo.c:bits_skip_le Unexecuted instantiation: sheervideo.c:bits_skip_be Unexecuted instantiation: utvideodec.c:bits_skip_le Unexecuted instantiation: utvideodec.c:bits_skip_be Line | Count | Source | 384 | 1.09M | { | 385 | 1.09M | if (n < bc->bits_valid) | 386 | 1.08M | BS_FUNC(priv_skip_remaining)(bc, n); | 387 | 6.29k | else { | 388 | 6.29k | n -= bc->bits_valid; | 389 | 6.29k | bc->bits = 0; | 390 | 6.29k | bc->bits_valid = 0; | 391 | | | 392 | 6.29k | if (n >= 64) { | 393 | 0 | unsigned int skip = n / 8; | 394 | |
| 395 | 0 | n -= skip * 8; | 396 | 0 | bc->ptr += skip; | 397 | 0 | } | 398 | 6.29k | BS_FUNC(priv_refill_64)(bc); | 399 | 6.29k | if (n) | 400 | 3.57k | BS_FUNC(priv_skip_remaining)(bc, n); | 401 | 6.29k | } | 402 | 1.09M | } |
Unexecuted instantiation: vmixdec.c:bits_skip_le Unexecuted instantiation: magicyuv.c:bits_skip_le Unexecuted instantiation: magicyuv.c:bits_skip_be prores_raw.c:bits_skip_be Line | Count | Source | 384 | 23.8k | { | 385 | 23.8k | if (n < bc->bits_valid) | 386 | 22.2k | BS_FUNC(priv_skip_remaining)(bc, n); | 387 | 1.61k | else { | 388 | 1.61k | n -= bc->bits_valid; | 389 | 1.61k | bc->bits = 0; | 390 | 1.61k | bc->bits_valid = 0; | 391 | | | 392 | 1.61k | if (n >= 64) { | 393 | 0 | unsigned int skip = n / 8; | 394 | |
| 395 | 0 | n -= skip * 8; | 396 | 0 | bc->ptr += skip; | 397 | 0 | } | 398 | 1.61k | BS_FUNC(priv_refill_64)(bc); | 399 | 1.61k | if (n) | 400 | 920 | BS_FUNC(priv_skip_remaining)(bc, n); | 401 | 1.61k | } | 402 | 23.8k | } |
Unexecuted instantiation: prores_raw.c:bits_skip_le Line | Count | Source | 384 | 863k | { | 385 | 863k | if (n < bc->bits_valid) | 386 | 150k | BS_FUNC(priv_skip_remaining)(bc, n); | 387 | 713k | else { | 388 | 713k | n -= bc->bits_valid; | 389 | 713k | bc->bits = 0; | 390 | 713k | bc->bits_valid = 0; | 391 | | | 392 | 713k | if (n >= 64) { | 393 | 0 | unsigned int skip = n / 8; | 394 | |
| 395 | 0 | n -= skip * 8; | 396 | 0 | bc->ptr += skip; | 397 | 0 | } | 398 | 713k | BS_FUNC(priv_refill_64)(bc); | 399 | 713k | if (n) | 400 | 659k | BS_FUNC(priv_skip_remaining)(bc, n); | 401 | 713k | } | 402 | 863k | } |
Line | Count | Source | 384 | 960k | { | 385 | 960k | if (n < bc->bits_valid) | 386 | 959k | BS_FUNC(priv_skip_remaining)(bc, n); | 387 | 991 | else { | 388 | 991 | n -= bc->bits_valid; | 389 | 991 | bc->bits = 0; | 390 | 991 | bc->bits_valid = 0; | 391 | | | 392 | 991 | if (n >= 64) { | 393 | 0 | unsigned int skip = n / 8; | 394 | |
| 395 | 0 | n -= skip * 8; | 396 | 0 | bc->ptr += skip; | 397 | 0 | } | 398 | 991 | BS_FUNC(priv_refill_64)(bc); | 399 | 991 | if (n) | 400 | 258 | BS_FUNC(priv_skip_remaining)(bc, n); | 401 | 991 | } | 402 | 960k | } |
Unexecuted instantiation: photocd.c:bits_skip_le Line | Count | Source | 384 | 35.0k | { | 385 | 35.0k | if (n < bc->bits_valid) | 386 | 35.0k | BS_FUNC(priv_skip_remaining)(bc, n); | 387 | 0 | else { | 388 | 0 | n -= bc->bits_valid; | 389 | 0 | bc->bits = 0; | 390 | 0 | bc->bits_valid = 0; | 391 | |
| 392 | 0 | if (n >= 64) { | 393 | 0 | unsigned int skip = n / 8; | 394 | |
| 395 | 0 | n -= skip * 8; | 396 | 0 | bc->ptr += skip; | 397 | 0 | } | 398 | 0 | BS_FUNC(priv_refill_64)(bc); | 399 | 0 | if (n) | 400 | 0 | BS_FUNC(priv_skip_remaining)(bc, n); | 401 | 0 | } | 402 | 35.0k | } |
Unexecuted instantiation: mvha.c:bits_skip_le |
403 | | |
404 | | /** |
405 | | * Seek to the given bit position. |
406 | | */ |
407 | | static inline void BS_FUNC(seek)(BSCTX *bc, unsigned pos) |
408 | 0 | { |
409 | 0 | bc->ptr = bc->buffer; |
410 | 0 | bc->bits = 0; |
411 | 0 | bc->bits_valid = 0; |
412 | 0 |
|
413 | 0 | BS_FUNC(skip)(bc, pos); |
414 | 0 | } Unexecuted instantiation: tak_parser.c:bits_seek_le Unexecuted instantiation: tak.c:bits_seek_le Unexecuted instantiation: sheervideo.c:bits_seek_le Unexecuted instantiation: sheervideo.c:bits_seek_be Unexecuted instantiation: utvideodec.c:bits_seek_le Unexecuted instantiation: utvideodec.c:bits_seek_be Unexecuted instantiation: vmixdec.c:bits_seek_le Unexecuted instantiation: vmixdec.c:bits_seek_be Unexecuted instantiation: magicyuv.c:bits_seek_le Unexecuted instantiation: magicyuv.c:bits_seek_be Unexecuted instantiation: prores_raw.c:bits_seek_le Unexecuted instantiation: prores_raw.c:bits_seek_be Unexecuted instantiation: takdec.c:bits_seek_le Unexecuted instantiation: photocd.c:bits_seek_le Unexecuted instantiation: photocd.c:bits_seek_be Unexecuted instantiation: mvha.c:bits_seek_le Unexecuted instantiation: mvha.c:bits_seek_be |
415 | | |
416 | | /** |
417 | | * Skip bits to a byte boundary. |
418 | | */ |
419 | | static inline const uint8_t *BS_FUNC(align)(BSCTX *bc) |
420 | 839k | { |
421 | 839k | unsigned int n = -BS_FUNC(tell)(bc) & 7; |
422 | 839k | if (n) |
423 | 169k | BS_FUNC(skip)(bc, n); |
424 | 839k | return bc->buffer + (BS_FUNC(tell)(bc) >> 3); |
425 | 839k | } Unexecuted instantiation: tak_parser.c:bits_align_le Line | Count | Source | 420 | 61.8k | { | 421 | 61.8k | unsigned int n = -BS_FUNC(tell)(bc) & 7; | 422 | 61.8k | if (n) | 423 | 60.4k | BS_FUNC(skip)(bc, n); | 424 | 61.8k | return bc->buffer + (BS_FUNC(tell)(bc) >> 3); | 425 | 61.8k | } |
Unexecuted instantiation: sheervideo.c:bits_align_le Unexecuted instantiation: sheervideo.c:bits_align_be Unexecuted instantiation: utvideodec.c:bits_align_le Unexecuted instantiation: utvideodec.c:bits_align_be Line | Count | Source | 420 | 16.3k | { | 421 | 16.3k | unsigned int n = -BS_FUNC(tell)(bc) & 7; | 422 | 16.3k | if (n) | 423 | 6.53k | BS_FUNC(skip)(bc, n); | 424 | 16.3k | return bc->buffer + (BS_FUNC(tell)(bc) >> 3); | 425 | 16.3k | } |
Unexecuted instantiation: vmixdec.c:bits_align_le Unexecuted instantiation: magicyuv.c:bits_align_le Unexecuted instantiation: magicyuv.c:bits_align_be Unexecuted instantiation: prores_raw.c:bits_align_le Unexecuted instantiation: prores_raw.c:bits_align_be Line | Count | Source | 420 | 761k | { | 421 | 761k | unsigned int n = -BS_FUNC(tell)(bc) & 7; | 422 | 761k | if (n) | 423 | 102k | BS_FUNC(skip)(bc, n); | 424 | 761k | return bc->buffer + (BS_FUNC(tell)(bc) >> 3); | 425 | 761k | } |
Unexecuted instantiation: photocd.c:bits_align_le Unexecuted instantiation: photocd.c:bits_align_be Unexecuted instantiation: mvha.c:bits_align_le Unexecuted instantiation: mvha.c:bits_align_be |
426 | | |
427 | | /** |
428 | | * Read MPEG-1 dc-style VLC (sign bit + mantissa with no MSB). |
429 | | * If MSB not set it is negative. |
430 | | * @param n length in bits |
431 | | */ |
432 | | static inline int BS_FUNC(read_xbits)(BSCTX *bc, unsigned int n) |
433 | 0 | { |
434 | 0 | int32_t cache = BS_FUNC(peek)(bc, 32); |
435 | 0 | int sign = ~cache >> 31; |
436 | 0 | BS_FUNC(priv_skip_remaining)(bc, n); |
437 | 0 |
|
438 | 0 | return ((((uint32_t)(sign ^ cache)) >> (32 - n)) ^ sign) - sign; |
439 | 0 | } Unexecuted instantiation: tak_parser.c:bits_read_xbits_le Unexecuted instantiation: tak.c:bits_read_xbits_le Unexecuted instantiation: sheervideo.c:bits_read_xbits_le Unexecuted instantiation: sheervideo.c:bits_read_xbits_be Unexecuted instantiation: utvideodec.c:bits_read_xbits_le Unexecuted instantiation: utvideodec.c:bits_read_xbits_be Unexecuted instantiation: vmixdec.c:bits_read_xbits_le Unexecuted instantiation: vmixdec.c:bits_read_xbits_be Unexecuted instantiation: magicyuv.c:bits_read_xbits_le Unexecuted instantiation: magicyuv.c:bits_read_xbits_be Unexecuted instantiation: prores_raw.c:bits_read_xbits_le Unexecuted instantiation: prores_raw.c:bits_read_xbits_be Unexecuted instantiation: takdec.c:bits_read_xbits_le Unexecuted instantiation: photocd.c:bits_read_xbits_le Unexecuted instantiation: photocd.c:bits_read_xbits_be Unexecuted instantiation: mvha.c:bits_read_xbits_le Unexecuted instantiation: mvha.c:bits_read_xbits_be |
440 | | |
441 | | /** |
442 | | * Return decoded truncated unary code for the values 0, 1, 2. |
443 | | */ |
444 | | static inline int BS_FUNC(decode012)(BSCTX *bc) |
445 | 0 | { |
446 | 0 | if (!BS_FUNC(read_bit)(bc)) |
447 | 0 | return 0; |
448 | 0 | else |
449 | 0 | return BS_FUNC(read_bit)(bc) + 1; |
450 | 0 | } Unexecuted instantiation: tak_parser.c:bits_decode012_le Unexecuted instantiation: tak.c:bits_decode012_le Unexecuted instantiation: sheervideo.c:bits_decode012_le Unexecuted instantiation: sheervideo.c:bits_decode012_be Unexecuted instantiation: utvideodec.c:bits_decode012_le Unexecuted instantiation: utvideodec.c:bits_decode012_be Unexecuted instantiation: vmixdec.c:bits_decode012_le Unexecuted instantiation: vmixdec.c:bits_decode012_be Unexecuted instantiation: magicyuv.c:bits_decode012_le Unexecuted instantiation: magicyuv.c:bits_decode012_be Unexecuted instantiation: prores_raw.c:bits_decode012_le Unexecuted instantiation: prores_raw.c:bits_decode012_be Unexecuted instantiation: takdec.c:bits_decode012_le Unexecuted instantiation: photocd.c:bits_decode012_le Unexecuted instantiation: photocd.c:bits_decode012_be Unexecuted instantiation: mvha.c:bits_decode012_le Unexecuted instantiation: mvha.c:bits_decode012_be |
451 | | |
452 | | /** |
453 | | * Return decoded truncated unary code for the values 2, 1, 0. |
454 | | */ |
455 | | static inline int BS_FUNC(decode210)(BSCTX *bc) |
456 | 0 | { |
457 | 0 | if (BS_FUNC(read_bit)(bc)) |
458 | 0 | return 0; |
459 | 0 | else |
460 | 0 | return 2 - BS_FUNC(read_bit)(bc); |
461 | 0 | } Unexecuted instantiation: tak_parser.c:bits_decode210_le Unexecuted instantiation: tak.c:bits_decode210_le Unexecuted instantiation: sheervideo.c:bits_decode210_le Unexecuted instantiation: sheervideo.c:bits_decode210_be Unexecuted instantiation: utvideodec.c:bits_decode210_le Unexecuted instantiation: utvideodec.c:bits_decode210_be Unexecuted instantiation: vmixdec.c:bits_decode210_le Unexecuted instantiation: vmixdec.c:bits_decode210_be Unexecuted instantiation: magicyuv.c:bits_decode210_le Unexecuted instantiation: magicyuv.c:bits_decode210_be Unexecuted instantiation: prores_raw.c:bits_decode210_le Unexecuted instantiation: prores_raw.c:bits_decode210_be Unexecuted instantiation: takdec.c:bits_decode210_le Unexecuted instantiation: photocd.c:bits_decode210_le Unexecuted instantiation: photocd.c:bits_decode210_be Unexecuted instantiation: mvha.c:bits_decode210_le Unexecuted instantiation: mvha.c:bits_decode210_be |
462 | | |
463 | | /* Read sign bit and flip the sign of the provided value accordingly. */ |
464 | | static inline int BS_FUNC(apply_sign)(BSCTX *bc, int val) |
465 | 0 | { |
466 | 0 | int sign = BS_FUNC(read_signed)(bc, 1); |
467 | 0 | return (val ^ sign) - sign; |
468 | 0 | } Unexecuted instantiation: tak_parser.c:bits_apply_sign_le Unexecuted instantiation: tak.c:bits_apply_sign_le Unexecuted instantiation: sheervideo.c:bits_apply_sign_le Unexecuted instantiation: sheervideo.c:bits_apply_sign_be Unexecuted instantiation: utvideodec.c:bits_apply_sign_le Unexecuted instantiation: utvideodec.c:bits_apply_sign_be Unexecuted instantiation: vmixdec.c:bits_apply_sign_le Unexecuted instantiation: vmixdec.c:bits_apply_sign_be Unexecuted instantiation: magicyuv.c:bits_apply_sign_le Unexecuted instantiation: magicyuv.c:bits_apply_sign_be Unexecuted instantiation: prores_raw.c:bits_apply_sign_le Unexecuted instantiation: prores_raw.c:bits_apply_sign_be Unexecuted instantiation: takdec.c:bits_apply_sign_le Unexecuted instantiation: photocd.c:bits_apply_sign_le Unexecuted instantiation: photocd.c:bits_apply_sign_be Unexecuted instantiation: mvha.c:bits_apply_sign_le Unexecuted instantiation: mvha.c:bits_apply_sign_be |
469 | | |
470 | | static inline int BS_FUNC(skip_1stop_8data)(BSCTX *s) |
471 | 0 | { |
472 | 0 | if (BS_FUNC(left)(s) <= 0) |
473 | 0 | return AVERROR_INVALIDDATA; |
474 | 0 |
|
475 | 0 | while (BS_FUNC(read_bit)(s)) { |
476 | 0 | BS_FUNC(skip)(s, 8); |
477 | 0 | if (BS_FUNC(left)(s) <= 0) |
478 | 0 | return AVERROR_INVALIDDATA; |
479 | 0 | } |
480 | 0 |
|
481 | 0 | return 0; |
482 | 0 | } Unexecuted instantiation: tak_parser.c:bits_skip_1stop_8data_le Unexecuted instantiation: tak.c:bits_skip_1stop_8data_le Unexecuted instantiation: sheervideo.c:bits_skip_1stop_8data_le Unexecuted instantiation: sheervideo.c:bits_skip_1stop_8data_be Unexecuted instantiation: utvideodec.c:bits_skip_1stop_8data_le Unexecuted instantiation: utvideodec.c:bits_skip_1stop_8data_be Unexecuted instantiation: vmixdec.c:bits_skip_1stop_8data_le Unexecuted instantiation: vmixdec.c:bits_skip_1stop_8data_be Unexecuted instantiation: magicyuv.c:bits_skip_1stop_8data_le Unexecuted instantiation: magicyuv.c:bits_skip_1stop_8data_be Unexecuted instantiation: prores_raw.c:bits_skip_1stop_8data_le Unexecuted instantiation: prores_raw.c:bits_skip_1stop_8data_be Unexecuted instantiation: takdec.c:bits_skip_1stop_8data_le Unexecuted instantiation: photocd.c:bits_skip_1stop_8data_le Unexecuted instantiation: photocd.c:bits_skip_1stop_8data_be Unexecuted instantiation: mvha.c:bits_skip_1stop_8data_le Unexecuted instantiation: mvha.c:bits_skip_1stop_8data_be |
483 | | |
484 | | /** |
485 | | * Return the LUT element for the given bitstream configuration. |
486 | | */ |
487 | | static inline int BS_FUNC(priv_set_idx)(BSCTX *bc, int code, int *n, |
488 | | int *nb_bits, const VLCElem *table) |
489 | 2.08M | { |
490 | 2.08M | unsigned idx; |
491 | | |
492 | 2.08M | *nb_bits = -*n; |
493 | 2.08M | idx = BS_FUNC(peek)(bc, *nb_bits) + code; |
494 | 2.08M | *n = table[idx].len; |
495 | | |
496 | 2.08M | return table[idx].sym; |
497 | 2.08M | } Unexecuted instantiation: tak_parser.c:bits_priv_set_idx_le Unexecuted instantiation: tak.c:bits_priv_set_idx_le sheervideo.c:bits_priv_set_idx_be Line | Count | Source | 489 | 1.77M | { | 490 | 1.77M | unsigned idx; | 491 | | | 492 | 1.77M | *nb_bits = -*n; | 493 | 1.77M | idx = BS_FUNC(peek)(bc, *nb_bits) + code; | 494 | 1.77M | *n = table[idx].len; | 495 | | | 496 | 1.77M | return table[idx].sym; | 497 | 1.77M | } |
Unexecuted instantiation: sheervideo.c:bits_priv_set_idx_le utvideodec.c:bits_priv_set_idx_be Line | Count | Source | 489 | 72.1k | { | 490 | 72.1k | unsigned idx; | 491 | | | 492 | 72.1k | *nb_bits = -*n; | 493 | 72.1k | idx = BS_FUNC(peek)(bc, *nb_bits) + code; | 494 | 72.1k | *n = table[idx].len; | 495 | | | 496 | 72.1k | return table[idx].sym; | 497 | 72.1k | } |
Unexecuted instantiation: utvideodec.c:bits_priv_set_idx_le Unexecuted instantiation: vmixdec.c:bits_priv_set_idx_le Unexecuted instantiation: vmixdec.c:bits_priv_set_idx_be magicyuv.c:bits_priv_set_idx_be Line | Count | Source | 489 | 229k | { | 490 | 229k | unsigned idx; | 491 | | | 492 | 229k | *nb_bits = -*n; | 493 | 229k | idx = BS_FUNC(peek)(bc, *nb_bits) + code; | 494 | 229k | *n = table[idx].len; | 495 | | | 496 | 229k | return table[idx].sym; | 497 | 229k | } |
Unexecuted instantiation: magicyuv.c:bits_priv_set_idx_le Unexecuted instantiation: prores_raw.c:bits_priv_set_idx_le Unexecuted instantiation: prores_raw.c:bits_priv_set_idx_be Unexecuted instantiation: takdec.c:bits_priv_set_idx_le photocd.c:bits_priv_set_idx_be Line | Count | Source | 489 | 1.76k | { | 490 | 1.76k | unsigned idx; | 491 | | | 492 | 1.76k | *nb_bits = -*n; | 493 | 1.76k | idx = BS_FUNC(peek)(bc, *nb_bits) + code; | 494 | 1.76k | *n = table[idx].len; | 495 | | | 496 | 1.76k | return table[idx].sym; | 497 | 1.76k | } |
Unexecuted instantiation: photocd.c:bits_priv_set_idx_le mvha.c:bits_priv_set_idx_be Line | Count | Source | 489 | 9.41k | { | 490 | 9.41k | unsigned idx; | 491 | | | 492 | 9.41k | *nb_bits = -*n; | 493 | 9.41k | idx = BS_FUNC(peek)(bc, *nb_bits) + code; | 494 | 9.41k | *n = table[idx].len; | 495 | | | 496 | 9.41k | return table[idx].sym; | 497 | 9.41k | } |
Unexecuted instantiation: mvha.c:bits_priv_set_idx_le |
498 | | |
499 | | /** |
500 | | * Parse a vlc code. |
501 | | * @param bits is the number of bits which will be read at once, must be |
502 | | * identical to nb_bits in vlc_init() |
503 | | * @param max_depth is the number of times bits bits must be read to completely |
504 | | * read the longest vlc code |
505 | | * = (max_vlc_length + bits - 1) / bits |
506 | | * If the vlc code is invalid and max_depth=1, then no bits will be removed. |
507 | | * If the vlc code is invalid and max_depth>1, then the number of bits removed |
508 | | * is undefined. |
509 | | */ |
510 | | static inline int BS_FUNC(read_vlc)(BSCTX *bc, const VLCElem *table, |
511 | | int bits, int max_depth) |
512 | 4.50G | { |
513 | 4.50G | int nb_bits; |
514 | 4.50G | unsigned idx = BS_FUNC(peek)(bc, bits); |
515 | 4.50G | int code = table[idx].sym; |
516 | 4.50G | int n = table[idx].len; |
517 | | |
518 | 4.50G | if (max_depth > 1 && n < 0) { |
519 | 1.88M | BS_FUNC(priv_skip_remaining)(bc, bits); |
520 | 1.88M | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); |
521 | 1.88M | if (max_depth > 2 && n < 0) { |
522 | 59.2k | BS_FUNC(priv_skip_remaining)(bc, nb_bits); |
523 | 59.2k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); |
524 | 59.2k | } |
525 | 1.88M | } |
526 | 4.50G | BS_FUNC(priv_skip_remaining)(bc, n); |
527 | | |
528 | 4.50G | return code; |
529 | 4.50G | } Unexecuted instantiation: tak_parser.c:bits_read_vlc_le Unexecuted instantiation: tak.c:bits_read_vlc_le sheervideo.c:bits_read_vlc_be Line | Count | Source | 512 | 4.27G | { | 513 | 4.27G | int nb_bits; | 514 | 4.27G | unsigned idx = BS_FUNC(peek)(bc, bits); | 515 | 4.27G | int code = table[idx].sym; | 516 | 4.27G | int n = table[idx].len; | 517 | | | 518 | 4.27G | if (max_depth > 1 && n < 0) { | 519 | 1.77M | BS_FUNC(priv_skip_remaining)(bc, bits); | 520 | 1.77M | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 521 | 1.77M | if (max_depth > 2 && n < 0) { | 522 | 0 | BS_FUNC(priv_skip_remaining)(bc, nb_bits); | 523 | 0 | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 524 | 0 | } | 525 | 1.77M | } | 526 | 4.27G | BS_FUNC(priv_skip_remaining)(bc, n); | 527 | | | 528 | 4.27G | return code; | 529 | 4.27G | } |
Unexecuted instantiation: sheervideo.c:bits_read_vlc_le utvideodec.c:bits_read_vlc_be Line | Count | Source | 512 | 2.94M | { | 513 | 2.94M | int nb_bits; | 514 | 2.94M | unsigned idx = BS_FUNC(peek)(bc, bits); | 515 | 2.94M | int code = table[idx].sym; | 516 | 2.94M | int n = table[idx].len; | 517 | | | 518 | 2.94M | if (max_depth > 1 && n < 0) { | 519 | 26.1k | BS_FUNC(priv_skip_remaining)(bc, bits); | 520 | 26.1k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 521 | 26.1k | if (max_depth > 2 && n < 0) { | 522 | 24.8k | BS_FUNC(priv_skip_remaining)(bc, nb_bits); | 523 | 24.8k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 524 | 24.8k | } | 525 | 26.1k | } | 526 | 2.94M | BS_FUNC(priv_skip_remaining)(bc, n); | 527 | | | 528 | 2.94M | return code; | 529 | 2.94M | } |
Unexecuted instantiation: utvideodec.c:bits_read_vlc_le Unexecuted instantiation: vmixdec.c:bits_read_vlc_le Unexecuted instantiation: vmixdec.c:bits_read_vlc_be magicyuv.c:bits_read_vlc_be Line | Count | Source | 512 | 225M | { | 513 | 225M | int nb_bits; | 514 | 225M | unsigned idx = BS_FUNC(peek)(bc, bits); | 515 | 225M | int code = table[idx].sym; | 516 | 225M | int n = table[idx].len; | 517 | | | 518 | 225M | if (max_depth > 1 && n < 0) { | 519 | 77.6k | BS_FUNC(priv_skip_remaining)(bc, bits); | 520 | 77.6k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 521 | 77.6k | if (max_depth > 2 && n < 0) { | 522 | 34.4k | BS_FUNC(priv_skip_remaining)(bc, nb_bits); | 523 | 34.4k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 524 | 34.4k | } | 525 | 77.6k | } | 526 | 225M | BS_FUNC(priv_skip_remaining)(bc, n); | 527 | | | 528 | 225M | return code; | 529 | 225M | } |
Unexecuted instantiation: magicyuv.c:bits_read_vlc_le Unexecuted instantiation: prores_raw.c:bits_read_vlc_le Unexecuted instantiation: prores_raw.c:bits_read_vlc_be Unexecuted instantiation: takdec.c:bits_read_vlc_le photocd.c:bits_read_vlc_be Line | Count | Source | 512 | 3.77M | { | 513 | 3.77M | int nb_bits; | 514 | 3.77M | unsigned idx = BS_FUNC(peek)(bc, bits); | 515 | 3.77M | int code = table[idx].sym; | 516 | 3.77M | int n = table[idx].len; | 517 | | | 518 | 3.77M | if (max_depth > 1 && n < 0) { | 519 | 1.76k | BS_FUNC(priv_skip_remaining)(bc, bits); | 520 | 1.76k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 521 | 1.76k | if (max_depth > 2 && n < 0) { | 522 | 0 | BS_FUNC(priv_skip_remaining)(bc, nb_bits); | 523 | 0 | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 524 | 0 | } | 525 | 1.76k | } | 526 | 3.77M | BS_FUNC(priv_skip_remaining)(bc, n); | 527 | | | 528 | 3.77M | return code; | 529 | 3.77M | } |
Unexecuted instantiation: photocd.c:bits_read_vlc_le Line | Count | Source | 512 | 998k | { | 513 | 998k | int nb_bits; | 514 | 998k | unsigned idx = BS_FUNC(peek)(bc, bits); | 515 | 998k | int code = table[idx].sym; | 516 | 998k | int n = table[idx].len; | 517 | | | 518 | 998k | if (max_depth > 1 && n < 0) { | 519 | 9.41k | BS_FUNC(priv_skip_remaining)(bc, bits); | 520 | 9.41k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 521 | 9.41k | if (max_depth > 2 && n < 0) { | 522 | 0 | BS_FUNC(priv_skip_remaining)(bc, nb_bits); | 523 | 0 | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 524 | 0 | } | 525 | 9.41k | } | 526 | 998k | BS_FUNC(priv_skip_remaining)(bc, n); | 527 | | | 528 | 998k | return code; | 529 | 998k | } |
Unexecuted instantiation: mvha.c:bits_read_vlc_le |
530 | | |
531 | | /** |
532 | | * Parse a vlc / vlc_multi code. |
533 | | * @param bits is the number of bits which will be read at once, must be |
534 | | * identical to nb_bits in vlc_init() |
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 | | * @param dst the parsed symbol(s) will be stored here. Up to 8 bytes are written |
539 | | * @returns number of symbols parsed |
540 | | * If the vlc code is invalid and max_depth=1, then no bits will be removed. |
541 | | * If the vlc code is invalid and max_depth>1, then the number of bits removed |
542 | | * is undefined. |
543 | | */ |
544 | | static inline int BS_FUNC(read_vlc_multi)(BSCTX *bc, uint8_t dst[8], |
545 | | const VLC_MULTI_ELEM *const Jtable, |
546 | | const VLCElem *const table, |
547 | | const int bits, const int max_depth, |
548 | | const int symbols_size) |
549 | 1.26M | { |
550 | 1.26M | unsigned idx = BS_FUNC(peek)(bc, bits); |
551 | 1.26M | int ret, nb_bits, code, n = Jtable[idx].len; |
552 | 1.26M | if (Jtable[idx].num) { |
553 | 1.17M | AV_COPY64U(dst, Jtable[idx].val8); |
554 | 1.17M | ret = Jtable[idx].num; |
555 | 1.17M | } else { |
556 | 89.2k | code = table[idx].sym; |
557 | 89.2k | n = table[idx].len; |
558 | 89.2k | if (max_depth > 1 && n < 0) { |
559 | 83.8k | BS_FUNC(priv_skip_remaining)(bc, bits); |
560 | 83.8k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); |
561 | 83.8k | if (max_depth > 2 && n < 0) { |
562 | 54.8k | BS_FUNC(priv_skip_remaining)(bc, nb_bits); |
563 | 54.8k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); |
564 | 54.8k | } |
565 | 83.8k | } |
566 | 89.2k | if (symbols_size == 1) |
567 | 35.1k | *dst = code; |
568 | 54.1k | else |
569 | 89.2k | AV_WN16(dst, code); |
570 | 89.2k | ret = n > 0; |
571 | 89.2k | } |
572 | 1.26M | BS_FUNC(priv_skip_remaining)(bc, n); |
573 | | |
574 | 1.26M | return ret; |
575 | 1.26M | } Unexecuted instantiation: tak_parser.c:bits_read_vlc_multi_le Unexecuted instantiation: tak.c:bits_read_vlc_multi_le Unexecuted instantiation: sheervideo.c:bits_read_vlc_multi_le Unexecuted instantiation: sheervideo.c:bits_read_vlc_multi_be utvideodec.c:bits_read_vlc_multi_be Line | Count | Source | 549 | 560k | { | 550 | 560k | unsigned idx = BS_FUNC(peek)(bc, bits); | 551 | 560k | int ret, nb_bits, code, n = Jtable[idx].len; | 552 | 560k | if (Jtable[idx].num) { | 553 | 544k | AV_COPY64U(dst, Jtable[idx].val8); | 554 | 544k | ret = Jtable[idx].num; | 555 | 544k | } else { | 556 | 15.5k | code = table[idx].sym; | 557 | 15.5k | n = table[idx].len; | 558 | 15.5k | if (max_depth > 1 && n < 0) { | 559 | 12.8k | BS_FUNC(priv_skip_remaining)(bc, bits); | 560 | 12.8k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 561 | 12.8k | if (max_depth > 2 && n < 0) { | 562 | 8.35k | BS_FUNC(priv_skip_remaining)(bc, nb_bits); | 563 | 8.35k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 564 | 8.35k | } | 565 | 12.8k | } | 566 | 15.5k | if (symbols_size == 1) | 567 | 11.2k | *dst = code; | 568 | 4.30k | else | 569 | 15.5k | AV_WN16(dst, code); | 570 | 15.5k | ret = n > 0; | 571 | 15.5k | } | 572 | 560k | BS_FUNC(priv_skip_remaining)(bc, n); | 573 | | | 574 | 560k | return ret; | 575 | 560k | } |
Unexecuted instantiation: utvideodec.c:bits_read_vlc_multi_le Unexecuted instantiation: vmixdec.c:bits_read_vlc_multi_le Unexecuted instantiation: vmixdec.c:bits_read_vlc_multi_be magicyuv.c:bits_read_vlc_multi_be Line | Count | Source | 549 | 702k | { | 550 | 702k | unsigned idx = BS_FUNC(peek)(bc, bits); | 551 | 702k | int ret, nb_bits, code, n = Jtable[idx].len; | 552 | 702k | if (Jtable[idx].num) { | 553 | 628k | AV_COPY64U(dst, Jtable[idx].val8); | 554 | 628k | ret = Jtable[idx].num; | 555 | 628k | } else { | 556 | 73.7k | code = table[idx].sym; | 557 | 73.7k | n = table[idx].len; | 558 | 73.7k | if (max_depth > 1 && n < 0) { | 559 | 70.9k | BS_FUNC(priv_skip_remaining)(bc, bits); | 560 | 70.9k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 561 | 70.9k | if (max_depth > 2 && n < 0) { | 562 | 46.4k | BS_FUNC(priv_skip_remaining)(bc, nb_bits); | 563 | 46.4k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 564 | 46.4k | } | 565 | 70.9k | } | 566 | 73.7k | if (symbols_size == 1) | 567 | 23.9k | *dst = code; | 568 | 49.8k | else | 569 | 73.7k | AV_WN16(dst, code); | 570 | 73.7k | ret = n > 0; | 571 | 73.7k | } | 572 | 702k | BS_FUNC(priv_skip_remaining)(bc, n); | 573 | | | 574 | 702k | return ret; | 575 | 702k | } |
Unexecuted instantiation: magicyuv.c:bits_read_vlc_multi_le Unexecuted instantiation: prores_raw.c:bits_read_vlc_multi_le Unexecuted instantiation: prores_raw.c:bits_read_vlc_multi_be Unexecuted instantiation: takdec.c:bits_read_vlc_multi_le Unexecuted instantiation: photocd.c:bits_read_vlc_multi_le Unexecuted instantiation: photocd.c:bits_read_vlc_multi_be Unexecuted instantiation: mvha.c:bits_read_vlc_multi_le Unexecuted instantiation: mvha.c:bits_read_vlc_multi_be |
576 | | |
577 | | #undef BSCTX |
578 | | #undef BS_FUNC |
579 | | #undef BS_JOIN3 |
580 | | #undef BS_JOIN |
581 | | #undef BS_SUFFIX_UPPER |
582 | | #undef BS_SUFFIX_LOWER |