/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 | 15.4G | #define BS_JOIN(x, y, z) x ## y ## z |
30 | 15.4G | #define BS_JOIN3(x, y, z) BS_JOIN(x, y, z) |
31 | 15.4G | #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.3M | { |
52 | | #if !UNCHECKED_BITSTREAM_READER |
53 | 12.3M | if (bc->ptr >= bc->buffer_end) |
54 | 2.67M | return -1; |
55 | 9.33M | #endif |
56 | | |
57 | | #ifdef BITSTREAM_TEMPLATE_LE |
58 | 9.35M | bc->bits = AV_RL64(bc->ptr); |
59 | | #else |
60 | 347k | bc->bits = AV_RB64(bc->ptr); |
61 | | #endif |
62 | 337k | bc->ptr += 8; |
63 | 337k | bc->bits_valid = 64; |
64 | | |
65 | 337k | return 0; |
66 | 12.3M | } 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.68M | { | 52 | 4.68M | #if !UNCHECKED_BITSTREAM_READER | 53 | 4.68M | if (bc->ptr >= bc->buffer_end) | 54 | 6.76k | return -1; | 55 | 4.68M | #endif | 56 | | | 57 | 4.68M | #ifdef BITSTREAM_TEMPLATE_LE | 58 | 4.68M | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | | bc->bits = AV_RB64(bc->ptr); | 61 | | #endif | 62 | 4.68M | bc->ptr += 8; | 63 | 4.68M | bc->bits_valid = 64; | 64 | | | 65 | 4.68M | return 0; | 66 | 4.68M | } |
sheervideo.c:bits_priv_refill_64_be Line | Count | Source | 51 | 184k | { | 52 | 184k | #if !UNCHECKED_BITSTREAM_READER | 53 | 184k | if (bc->ptr >= bc->buffer_end) | 54 | 31.7k | return -1; | 55 | 153k | #endif | 56 | | | 57 | | #ifdef BITSTREAM_TEMPLATE_LE | 58 | | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | 153k | bc->bits = AV_RB64(bc->ptr); | 61 | 153k | #endif | 62 | 153k | bc->ptr += 8; | 63 | 153k | bc->bits_valid = 64; | 64 | | | 65 | 153k | return 0; | 66 | 184k | } |
Unexecuted instantiation: sheervideo.c:bits_priv_refill_64_le utvideodec.c:bits_priv_refill_64_le Line | Count | Source | 51 | 13.6k | { | 52 | | #if !UNCHECKED_BITSTREAM_READER | 53 | | if (bc->ptr >= bc->buffer_end) | 54 | | return -1; | 55 | | #endif | 56 | | | 57 | 13.6k | #ifdef BITSTREAM_TEMPLATE_LE | 58 | 13.6k | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | | bc->bits = AV_RB64(bc->ptr); | 61 | | #endif | 62 | 13.6k | bc->ptr += 8; | 63 | 13.6k | bc->bits_valid = 64; | 64 | | | 65 | 13.6k | return 0; | 66 | 13.6k | } |
utvideodec.c:bits_priv_refill_64_be Line | Count | Source | 51 | 9.89k | { | 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 | 9.89k | bc->bits = AV_RB64(bc->ptr); | 61 | 9.89k | #endif | 62 | 9.89k | bc->ptr += 8; | 63 | 9.89k | bc->bits_valid = 64; | 64 | | | 65 | 9.89k | return 0; | 66 | 9.89k | } |
vmixdec.c:bits_priv_refill_64_be Line | Count | Source | 51 | 290k | { | 52 | 290k | #if !UNCHECKED_BITSTREAM_READER | 53 | 290k | if (bc->ptr >= bc->buffer_end) | 54 | 260k | return -1; | 55 | 30.3k | #endif | 56 | | | 57 | | #ifdef BITSTREAM_TEMPLATE_LE | 58 | | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | 30.3k | bc->bits = AV_RB64(bc->ptr); | 61 | 30.3k | #endif | 62 | 30.3k | bc->ptr += 8; | 63 | 30.3k | bc->bits_valid = 64; | 64 | | | 65 | 30.3k | return 0; | 66 | 290k | } |
Unexecuted instantiation: vmixdec.c:bits_priv_refill_64_le magicyuv.c:bits_priv_refill_64_be Line | Count | Source | 51 | 61.4k | { | 52 | 61.4k | #if !UNCHECKED_BITSTREAM_READER | 53 | 61.4k | if (bc->ptr >= bc->buffer_end) | 54 | 2.58k | return -1; | 55 | 58.8k | #endif | 56 | | | 57 | | #ifdef BITSTREAM_TEMPLATE_LE | 58 | | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | 58.8k | bc->bits = AV_RB64(bc->ptr); | 61 | 58.8k | #endif | 62 | 58.8k | bc->ptr += 8; | 63 | 58.8k | bc->bits_valid = 64; | 64 | | | 65 | 58.8k | return 0; | 66 | 61.4k | } |
Unexecuted instantiation: magicyuv.c:bits_priv_refill_64_le prores_raw.c:bits_priv_refill_64_be Line | Count | Source | 51 | 171k | { | 52 | 171k | #if !UNCHECKED_BITSTREAM_READER | 53 | 171k | if (bc->ptr >= bc->buffer_end) | 54 | 140k | return -1; | 55 | 30.6k | #endif | 56 | | | 57 | | #ifdef BITSTREAM_TEMPLATE_LE | 58 | | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | 30.6k | bc->bits = AV_RB64(bc->ptr); | 61 | 30.6k | #endif | 62 | 30.6k | bc->ptr += 8; | 63 | 30.6k | bc->bits_valid = 64; | 64 | | | 65 | 30.6k | return 0; | 66 | 171k | } |
Unexecuted instantiation: prores_raw.c:bits_priv_refill_64_le takdec.c:bits_priv_refill_64_le Line | Count | Source | 51 | 3.25M | { | 52 | 3.25M | #if !UNCHECKED_BITSTREAM_READER | 53 | 3.25M | if (bc->ptr >= bc->buffer_end) | 54 | 2.23M | return -1; | 55 | 1.02M | #endif | 56 | | | 57 | 1.02M | #ifdef BITSTREAM_TEMPLATE_LE | 58 | 1.02M | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | | bc->bits = AV_RB64(bc->ptr); | 61 | | #endif | 62 | 1.02M | bc->ptr += 8; | 63 | 1.02M | bc->bits_valid = 64; | 64 | | | 65 | 1.02M | return 0; | 66 | 3.25M | } |
photocd.c:bits_priv_refill_64_be Line | Count | Source | 51 | 1.41k | { | 52 | 1.41k | #if !UNCHECKED_BITSTREAM_READER | 53 | 1.41k | if (bc->ptr >= bc->buffer_end) | 54 | 79 | return -1; | 55 | 1.33k | #endif | 56 | | | 57 | | #ifdef BITSTREAM_TEMPLATE_LE | 58 | | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | 1.33k | bc->bits = AV_RB64(bc->ptr); | 61 | 1.33k | #endif | 62 | 1.33k | bc->ptr += 8; | 63 | 1.33k | bc->bits_valid = 64; | 64 | | | 65 | 1.33k | return 0; | 66 | 1.41k | } |
Unexecuted instantiation: photocd.c:bits_priv_refill_64_le mvha.c:bits_priv_refill_64_be Line | Count | Source | 51 | 62.9k | { | 52 | 62.9k | #if !UNCHECKED_BITSTREAM_READER | 53 | 62.9k | if (bc->ptr >= bc->buffer_end) | 54 | 0 | return -1; | 55 | 62.9k | #endif | 56 | | | 57 | | #ifdef BITSTREAM_TEMPLATE_LE | 58 | | bc->bits = AV_RL64(bc->ptr); | 59 | | #else | 60 | 62.9k | bc->bits = AV_RB64(bc->ptr); | 61 | 62.9k | #endif | 62 | 62.9k | bc->ptr += 8; | 63 | 62.9k | bc->bits_valid = 64; | 64 | | | 65 | 62.9k | return 0; | 66 | 62.9k | } |
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 | 149M | return -1; |
80 | 451k | #endif |
81 | | |
82 | | #ifdef BITSTREAM_TEMPLATE_LE |
83 | 453k | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; |
84 | | #else |
85 | 19.8M | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); |
86 | | #endif |
87 | 19.7M | bc->ptr += 4; |
88 | 19.7M | bc->bits_valid += 32; |
89 | | |
90 | 19.7M | 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 | 71.8k | { | 77 | 71.8k | #if !UNCHECKED_BITSTREAM_READER | 78 | 71.8k | if (bc->ptr >= bc->buffer_end) | 79 | 9.16k | return -1; | 80 | 62.6k | #endif | 81 | | | 82 | 62.6k | #ifdef BITSTREAM_TEMPLATE_LE | 83 | 62.6k | 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 | 62.6k | bc->ptr += 4; | 88 | 62.6k | bc->bits_valid += 32; | 89 | | | 90 | 62.6k | return 0; | 91 | 71.8k | } |
sheervideo.c:bits_priv_refill_32_be Line | Count | Source | 76 | 123M | { | 77 | 123M | #if !UNCHECKED_BITSTREAM_READER | 78 | 123M | if (bc->ptr >= bc->buffer_end) | 79 | 104M | return -1; | 80 | 18.8M | #endif | 81 | | | 82 | | #ifdef BITSTREAM_TEMPLATE_LE | 83 | | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; | 84 | | #else | 85 | 18.8M | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); | 86 | 18.8M | #endif | 87 | 18.8M | bc->ptr += 4; | 88 | 18.8M | bc->bits_valid += 32; | 89 | | | 90 | 18.8M | return 0; | 91 | 123M | } |
Unexecuted instantiation: sheervideo.c:bits_priv_refill_32_le utvideodec.c:bits_priv_refill_32_le Line | Count | Source | 76 | 2.20k | { | 77 | | #if !UNCHECKED_BITSTREAM_READER | 78 | | if (bc->ptr >= bc->buffer_end) | 79 | | return -1; | 80 | | #endif | 81 | | | 82 | 2.20k | #ifdef BITSTREAM_TEMPLATE_LE | 83 | 2.20k | 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.20k | bc->ptr += 4; | 88 | 2.20k | bc->bits_valid += 32; | 89 | | | 90 | 2.20k | return 0; | 91 | 2.20k | } |
utvideodec.c:bits_priv_refill_32_be Line | Count | Source | 76 | 123k | { | 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 | 123k | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); | 86 | 123k | #endif | 87 | 123k | bc->ptr += 4; | 88 | 123k | bc->bits_valid += 32; | 89 | | | 90 | 123k | return 0; | 91 | 123k | } |
vmixdec.c:bits_priv_refill_32_be Line | Count | Source | 76 | 252k | { | 77 | 252k | #if !UNCHECKED_BITSTREAM_READER | 78 | 252k | if (bc->ptr >= bc->buffer_end) | 79 | 52.5k | return -1; | 80 | 199k | #endif | 81 | | | 82 | | #ifdef BITSTREAM_TEMPLATE_LE | 83 | | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; | 84 | | #else | 85 | 199k | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); | 86 | 199k | #endif | 87 | 199k | bc->ptr += 4; | 88 | 199k | bc->bits_valid += 32; | 89 | | | 90 | 199k | return 0; | 91 | 252k | } |
Unexecuted instantiation: vmixdec.c:bits_priv_refill_32_le magicyuv.c:bits_priv_refill_32_be Line | Count | Source | 76 | 2.11M | { | 77 | 2.11M | #if !UNCHECKED_BITSTREAM_READER | 78 | 2.11M | if (bc->ptr >= bc->buffer_end) | 79 | 1.88M | return -1; | 80 | 224k | #endif | 81 | | | 82 | | #ifdef BITSTREAM_TEMPLATE_LE | 83 | | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; | 84 | | #else | 85 | 224k | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); | 86 | 224k | #endif | 87 | 224k | bc->ptr += 4; | 88 | 224k | bc->bits_valid += 32; | 89 | | | 90 | 224k | return 0; | 91 | 2.11M | } |
Unexecuted instantiation: magicyuv.c:bits_priv_refill_32_le prores_raw.c:bits_priv_refill_32_be Line | Count | Source | 76 | 200k | { | 77 | 200k | #if !UNCHECKED_BITSTREAM_READER | 78 | 200k | if (bc->ptr >= bc->buffer_end) | 79 | 188k | return -1; | 80 | 11.0k | #endif | 81 | | | 82 | | #ifdef BITSTREAM_TEMPLATE_LE | 83 | | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; | 84 | | #else | 85 | 11.0k | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); | 86 | 11.0k | #endif | 87 | 11.0k | bc->ptr += 4; | 88 | 11.0k | bc->bits_valid += 32; | 89 | | | 90 | 11.0k | return 0; | 91 | 200k | } |
Unexecuted instantiation: prores_raw.c:bits_priv_refill_32_le takdec.c:bits_priv_refill_32_le Line | Count | Source | 76 | 43.1M | { | 77 | 43.1M | #if !UNCHECKED_BITSTREAM_READER | 78 | 43.1M | if (bc->ptr >= bc->buffer_end) | 79 | 42.7M | return -1; | 80 | 389k | #endif | 81 | | | 82 | 389k | #ifdef BITSTREAM_TEMPLATE_LE | 83 | 389k | 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 | 389k | bc->ptr += 4; | 88 | 389k | bc->bits_valid += 32; | 89 | | | 90 | 389k | return 0; | 91 | 43.1M | } |
photocd.c:bits_priv_refill_32_be Line | Count | Source | 76 | 309k | { | 77 | 309k | #if !UNCHECKED_BITSTREAM_READER | 78 | 309k | if (bc->ptr >= bc->buffer_end) | 79 | 390 | return -1; | 80 | 308k | #endif | 81 | | | 82 | | #ifdef BITSTREAM_TEMPLATE_LE | 83 | | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; | 84 | | #else | 85 | 308k | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); | 86 | 308k | #endif | 87 | 308k | bc->ptr += 4; | 88 | 308k | bc->bits_valid += 32; | 89 | | | 90 | 308k | return 0; | 91 | 309k | } |
Unexecuted instantiation: photocd.c:bits_priv_refill_32_le mvha.c:bits_priv_refill_32_be Line | Count | Source | 76 | 121k | { | 77 | 121k | #if !UNCHECKED_BITSTREAM_READER | 78 | 121k | if (bc->ptr >= bc->buffer_end) | 79 | 2.26k | return -1; | 80 | 119k | #endif | 81 | | | 82 | | #ifdef BITSTREAM_TEMPLATE_LE | 83 | | bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; | 84 | | #else | 85 | 119k | bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); | 86 | 119k | #endif | 87 | 119k | bc->ptr += 4; | 88 | 119k | bc->bits_valid += 32; | 89 | | | 90 | 119k | return 0; | 91 | 121k | } |
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.34M | { |
104 | 5.34M | unsigned int buffer_size; |
105 | | |
106 | 5.34M | 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.34M | buffer_size = (bit_size + 7) >> 3; |
114 | | |
115 | 5.34M | bc->buffer = buffer; |
116 | 5.34M | bc->buffer_end = buffer + buffer_size; |
117 | 5.34M | bc->ptr = bc->buffer; |
118 | 5.34M | bc->size_in_bits = bit_size; |
119 | 5.34M | bc->bits_valid = 0; |
120 | 5.34M | bc->bits = 0; |
121 | | |
122 | 5.34M | BS_FUNC(priv_refill_64)(bc); |
123 | | |
124 | 5.34M | return 0; |
125 | 5.34M | } 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 | 131k | { | 104 | 131k | unsigned int buffer_size; | 105 | | | 106 | 131k | 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 | 131k | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 131k | bc->buffer = buffer; | 116 | 131k | bc->buffer_end = buffer + buffer_size; | 117 | 131k | bc->ptr = bc->buffer; | 118 | 131k | bc->size_in_bits = bit_size; | 119 | 131k | bc->bits_valid = 0; | 120 | 131k | bc->bits = 0; | 121 | | | 122 | 131k | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 131k | return 0; | 125 | 131k | } |
Unexecuted instantiation: sheervideo.c:bits_init_le utvideodec.c:bits_init_le Line | Count | Source | 103 | 13.6k | { | 104 | 13.6k | unsigned int buffer_size; | 105 | | | 106 | 13.6k | 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 | 13.6k | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 13.6k | bc->buffer = buffer; | 116 | 13.6k | bc->buffer_end = buffer + buffer_size; | 117 | 13.6k | bc->ptr = bc->buffer; | 118 | 13.6k | bc->size_in_bits = bit_size; | 119 | 13.6k | bc->bits_valid = 0; | 120 | 13.6k | bc->bits = 0; | 121 | | | 122 | 13.6k | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 13.6k | return 0; | 125 | 13.6k | } |
utvideodec.c:bits_init_be Line | Count | Source | 103 | 9.89k | { | 104 | 9.89k | unsigned int buffer_size; | 105 | | | 106 | 9.89k | 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 | 9.89k | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 9.89k | bc->buffer = buffer; | 116 | 9.89k | bc->buffer_end = buffer + buffer_size; | 117 | 9.89k | bc->ptr = bc->buffer; | 118 | 9.89k | bc->size_in_bits = bit_size; | 119 | 9.89k | bc->bits_valid = 0; | 120 | 9.89k | bc->bits = 0; | 121 | | | 122 | 9.89k | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 9.89k | return 0; | 125 | 9.89k | } |
Line | Count | Source | 103 | 284k | { | 104 | 284k | unsigned int buffer_size; | 105 | | | 106 | 284k | 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 | 284k | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 284k | bc->buffer = buffer; | 116 | 284k | bc->buffer_end = buffer + buffer_size; | 117 | 284k | bc->ptr = bc->buffer; | 118 | 284k | bc->size_in_bits = bit_size; | 119 | 284k | bc->bits_valid = 0; | 120 | 284k | bc->bits = 0; | 121 | | | 122 | 284k | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 284k | return 0; | 125 | 284k | } |
Unexecuted instantiation: vmixdec.c:bits_init_le Line | Count | Source | 103 | 61.4k | { | 104 | 61.4k | unsigned int buffer_size; | 105 | | | 106 | 61.4k | 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 | 61.4k | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 61.4k | bc->buffer = buffer; | 116 | 61.4k | bc->buffer_end = buffer + buffer_size; | 117 | 61.4k | bc->ptr = bc->buffer; | 118 | 61.4k | bc->size_in_bits = bit_size; | 119 | 61.4k | bc->bits_valid = 0; | 120 | 61.4k | bc->bits = 0; | 121 | | | 122 | 61.4k | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 61.4k | return 0; | 125 | 61.4k | } |
Unexecuted instantiation: magicyuv.c:bits_init_le prores_raw.c:bits_init_be Line | Count | Source | 103 | 167k | { | 104 | 167k | unsigned int buffer_size; | 105 | | | 106 | 167k | 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 | 167k | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 167k | bc->buffer = buffer; | 116 | 167k | bc->buffer_end = buffer + buffer_size; | 117 | 167k | bc->ptr = bc->buffer; | 118 | 167k | bc->size_in_bits = bit_size; | 119 | 167k | bc->bits_valid = 0; | 120 | 167k | bc->bits = 0; | 121 | | | 122 | 167k | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 167k | return 0; | 125 | 167k | } |
Unexecuted instantiation: prores_raw.c:bits_init_le Line | Count | Source | 103 | 988k | { | 104 | 988k | unsigned int buffer_size; | 105 | | | 106 | 988k | 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 | 988k | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 988k | bc->buffer = buffer; | 116 | 988k | bc->buffer_end = buffer + buffer_size; | 117 | 988k | bc->ptr = bc->buffer; | 118 | 988k | bc->size_in_bits = bit_size; | 119 | 988k | bc->bits_valid = 0; | 120 | 988k | bc->bits = 0; | 121 | | | 122 | 988k | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 988k | return 0; | 125 | 988k | } |
Line | Count | Source | 103 | 426 | { | 104 | 426 | unsigned int buffer_size; | 105 | | | 106 | 426 | 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 | 426 | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 426 | bc->buffer = buffer; | 116 | 426 | bc->buffer_end = buffer + buffer_size; | 117 | 426 | bc->ptr = bc->buffer; | 118 | 426 | bc->size_in_bits = bit_size; | 119 | 426 | bc->bits_valid = 0; | 120 | 426 | bc->bits = 0; | 121 | | | 122 | 426 | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 426 | return 0; | 125 | 426 | } |
Unexecuted instantiation: photocd.c:bits_init_le Line | Count | Source | 103 | 57.6k | { | 104 | 57.6k | unsigned int buffer_size; | 105 | | | 106 | 57.6k | 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 | 57.6k | buffer_size = (bit_size + 7) >> 3; | 114 | | | 115 | 57.6k | bc->buffer = buffer; | 116 | 57.6k | bc->buffer_end = buffer + buffer_size; | 117 | 57.6k | bc->ptr = bc->buffer; | 118 | 57.6k | bc->size_in_bits = bit_size; | 119 | 57.6k | bc->bits_valid = 0; | 120 | 57.6k | bc->bits = 0; | 121 | | | 122 | 57.6k | BS_FUNC(priv_refill_64)(bc); | 123 | | | 124 | 57.6k | return 0; | 125 | 57.6k | } |
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.33M | { |
138 | 5.33M | if (byte_size > INT_MAX / 8) |
139 | 0 | return AVERROR_INVALIDDATA; |
140 | 5.33M | return BS_FUNC(init)(bc, buffer, byte_size * 8); |
141 | 5.33M | } 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 | 131k | { | 138 | 131k | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 131k | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 131k | } |
Unexecuted instantiation: sheervideo.c:bits_init8_le utvideodec.c:bits_init8_le Line | Count | Source | 137 | 13.6k | { | 138 | 13.6k | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 13.6k | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 13.6k | } |
Unexecuted instantiation: utvideodec.c:bits_init8_be Line | Count | Source | 137 | 284k | { | 138 | 284k | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 284k | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 284k | } |
Unexecuted instantiation: vmixdec.c:bits_init8_le Line | Count | Source | 137 | 61.4k | { | 138 | 61.4k | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 61.4k | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 61.4k | } |
Unexecuted instantiation: magicyuv.c:bits_init8_le prores_raw.c:bits_init8_be Line | Count | Source | 137 | 167k | { | 138 | 167k | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 167k | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 167k | } |
Unexecuted instantiation: prores_raw.c:bits_init8_le Line | Count | Source | 137 | 988k | { | 138 | 988k | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 988k | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 988k | } |
Line | Count | Source | 137 | 426 | { | 138 | 426 | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 426 | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 426 | } |
Unexecuted instantiation: photocd.c:bits_init8_le Line | Count | Source | 137 | 57.6k | { | 138 | 57.6k | if (byte_size > INT_MAX / 8) | 139 | 0 | return AVERROR_INVALIDDATA; | 140 | 57.6k | return BS_FUNC(init)(bc, buffer, byte_size * 8); | 141 | 57.6k | } |
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.75M | { |
148 | 6.75M | return (bc->ptr - bc->buffer) * 8 - bc->bits_valid; |
149 | 6.75M | } 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 | 154k | { | 148 | 154k | return (bc->ptr - bc->buffer) * 8 - bc->bits_valid; | 149 | 154k | } |
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 | 40.1k | { | 148 | 40.1k | return (bc->ptr - bc->buffer) * 8 - bc->bits_valid; | 149 | 40.1k | } |
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.96M | { | 148 | 2.96M | return (bc->ptr - bc->buffer) * 8 - bc->bits_valid; | 149 | 2.96M | } |
Line | Count | Source | 147 | 79 | { | 148 | 79 | return (bc->ptr - bc->buffer) * 8 - bc->bits_valid; | 149 | 79 | } |
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 | 206M | { |
172 | 206M | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; |
173 | 206M | } Unexecuted instantiation: tak_parser.c:bits_left_le Line | Count | Source | 171 | 4.57M | { | 172 | 4.57M | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; | 173 | 4.57M | } |
Unexecuted instantiation: sheervideo.c:bits_left_le Unexecuted instantiation: sheervideo.c:bits_left_be utvideodec.c:bits_left_be Line | Count | Source | 171 | 8.67M | { | 172 | 8.67M | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; | 173 | 8.67M | } |
Unexecuted instantiation: utvideodec.c:bits_left_le Line | Count | Source | 171 | 1.08M | { | 172 | 1.08M | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; | 173 | 1.08M | } |
Unexecuted instantiation: vmixdec.c:bits_left_le Line | Count | Source | 171 | 185M | { | 172 | 185M | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; | 173 | 185M | } |
Unexecuted instantiation: magicyuv.c:bits_left_le prores_raw.c:bits_left_be Line | Count | Source | 171 | 765k | { | 172 | 765k | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; | 173 | 765k | } |
Unexecuted instantiation: prores_raw.c:bits_left_le Line | Count | Source | 171 | 933k | { | 172 | 933k | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; | 173 | 933k | } |
Line | Count | Source | 171 | 5.10M | { | 172 | 5.10M | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; | 173 | 5.10M | } |
Unexecuted instantiation: photocd.c:bits_left_le Line | Count | Source | 171 | 587k | { | 172 | 587k | return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; | 173 | 587k | } |
Unexecuted instantiation: mvha.c:bits_left_le |
174 | | |
175 | | static inline uint64_t BS_FUNC(priv_val_show)(BSCTX *bc, unsigned int n) |
176 | 3.86G | { |
177 | 3.86G | 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 | 3.86G | } Unexecuted instantiation: tak_parser.c:bits_priv_val_show_le tak.c:bits_priv_val_show_le Line | Count | Source | 176 | 15.0M | { | 177 | 15.0M | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | 15.0M | #ifdef BITSTREAM_TEMPLATE_LE | 180 | 15.0M | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | | return bc->bits >> (64 - n); | 183 | | #endif | 184 | 15.0M | } |
sheervideo.c:bits_priv_val_show_be Line | Count | Source | 176 | 3.70G | { | 177 | 3.70G | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | | #ifdef BITSTREAM_TEMPLATE_LE | 180 | | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | 3.70G | return bc->bits >> (64 - n); | 183 | 3.70G | #endif | 184 | 3.70G | } |
Unexecuted instantiation: sheervideo.c:bits_priv_val_show_le utvideodec.c:bits_priv_val_show_le Line | Count | Source | 176 | 33.5k | { | 177 | 33.5k | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | 33.5k | #ifdef BITSTREAM_TEMPLATE_LE | 180 | 33.5k | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | | return bc->bits >> (64 - n); | 183 | | #endif | 184 | 33.5k | } |
utvideodec.c:bits_priv_val_show_be Line | Count | Source | 176 | 6.96M | { | 177 | 6.96M | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | | #ifdef BITSTREAM_TEMPLATE_LE | 180 | | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | 6.96M | return bc->bits >> (64 - n); | 183 | 6.96M | #endif | 184 | 6.96M | } |
vmixdec.c:bits_priv_val_show_be Line | Count | Source | 176 | 2.76M | { | 177 | 2.76M | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | | #ifdef BITSTREAM_TEMPLATE_LE | 180 | | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | 2.76M | return bc->bits >> (64 - n); | 183 | 2.76M | #endif | 184 | 2.76M | } |
Unexecuted instantiation: vmixdec.c:bits_priv_val_show_le magicyuv.c:bits_priv_val_show_be Line | Count | Source | 176 | 72.8M | { | 177 | 72.8M | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | | #ifdef BITSTREAM_TEMPLATE_LE | 180 | | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | 72.8M | return bc->bits >> (64 - n); | 183 | 72.8M | #endif | 184 | 72.8M | } |
Unexecuted instantiation: magicyuv.c:bits_priv_val_show_le prores_raw.c:bits_priv_val_show_be Line | Count | Source | 176 | 1.24M | { | 177 | 1.24M | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | | #ifdef BITSTREAM_TEMPLATE_LE | 180 | | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | 1.24M | return bc->bits >> (64 - n); | 183 | 1.24M | #endif | 184 | 1.24M | } |
Unexecuted instantiation: prores_raw.c:bits_priv_val_show_le takdec.c:bits_priv_val_show_le Line | Count | Source | 176 | 57.4M | { | 177 | 57.4M | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | 57.4M | #ifdef BITSTREAM_TEMPLATE_LE | 180 | 57.4M | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | | return bc->bits >> (64 - n); | 183 | | #endif | 184 | 57.4M | } |
photocd.c:bits_priv_val_show_be Line | Count | Source | 176 | 5.11M | { | 177 | 5.11M | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | | #ifdef BITSTREAM_TEMPLATE_LE | 180 | | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | 5.11M | return bc->bits >> (64 - n); | 183 | 5.11M | #endif | 184 | 5.11M | } |
Unexecuted instantiation: photocd.c:bits_priv_val_show_le mvha.c:bits_priv_val_show_be Line | Count | Source | 176 | 1.76M | { | 177 | 1.76M | av_assert2(n > 0 && n <= 64); | 178 | | | 179 | | #ifdef BITSTREAM_TEMPLATE_LE | 180 | | return bc->bits & (UINT64_MAX >> (64 - n)); | 181 | | #else | 182 | 1.76M | return bc->bits >> (64 - n); | 183 | 1.76M | #endif | 184 | 1.76M | } |
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 | 3.86G | { |
188 | | #ifdef BITSTREAM_TEMPLATE_LE |
189 | | bc->bits >>= n; |
190 | | #else |
191 | | bc->bits <<= n; |
192 | | #endif |
193 | 3.86G | bc->bits_valid -= n; |
194 | 3.86G | } Unexecuted instantiation: tak_parser.c:bits_priv_skip_remaining_le tak.c:bits_priv_skip_remaining_le Line | Count | Source | 187 | 15.4M | { | 188 | 15.4M | #ifdef BITSTREAM_TEMPLATE_LE | 189 | 15.4M | bc->bits >>= n; | 190 | | #else | 191 | | bc->bits <<= n; | 192 | | #endif | 193 | 15.4M | bc->bits_valid -= n; | 194 | 15.4M | } |
sheervideo.c:bits_priv_skip_remaining_be Line | Count | Source | 187 | 3.70G | { | 188 | | #ifdef BITSTREAM_TEMPLATE_LE | 189 | | bc->bits >>= n; | 190 | | #else | 191 | 3.70G | bc->bits <<= n; | 192 | 3.70G | #endif | 193 | 3.70G | bc->bits_valid -= n; | 194 | 3.70G | } |
Unexecuted instantiation: sheervideo.c:bits_priv_skip_remaining_le utvideodec.c:bits_priv_skip_remaining_le Line | Count | Source | 187 | 33.5k | { | 188 | 33.5k | #ifdef BITSTREAM_TEMPLATE_LE | 189 | 33.5k | bc->bits >>= n; | 190 | | #else | 191 | | bc->bits <<= n; | 192 | | #endif | 193 | 33.5k | bc->bits_valid -= n; | 194 | 33.5k | } |
utvideodec.c:bits_priv_skip_remaining_be Line | Count | Source | 187 | 6.96M | { | 188 | | #ifdef BITSTREAM_TEMPLATE_LE | 189 | | bc->bits >>= n; | 190 | | #else | 191 | 6.96M | bc->bits <<= n; | 192 | 6.96M | #endif | 193 | 6.96M | bc->bits_valid -= n; | 194 | 6.96M | } |
vmixdec.c:bits_priv_skip_remaining_be Line | Count | Source | 187 | 2.77M | { | 188 | | #ifdef BITSTREAM_TEMPLATE_LE | 189 | | bc->bits >>= n; | 190 | | #else | 191 | 2.77M | bc->bits <<= n; | 192 | 2.77M | #endif | 193 | 2.77M | bc->bits_valid -= n; | 194 | 2.77M | } |
Unexecuted instantiation: vmixdec.c:bits_priv_skip_remaining_le magicyuv.c:bits_priv_skip_remaining_be Line | Count | Source | 187 | 72.8M | { | 188 | | #ifdef BITSTREAM_TEMPLATE_LE | 189 | | bc->bits >>= n; | 190 | | #else | 191 | 72.8M | bc->bits <<= n; | 192 | 72.8M | #endif | 193 | 72.8M | bc->bits_valid -= n; | 194 | 72.8M | } |
Unexecuted instantiation: magicyuv.c:bits_priv_skip_remaining_le prores_raw.c:bits_priv_skip_remaining_be Line | Count | Source | 187 | 415k | { | 188 | | #ifdef BITSTREAM_TEMPLATE_LE | 189 | | bc->bits >>= n; | 190 | | #else | 191 | 415k | bc->bits <<= n; | 192 | 415k | #endif | 193 | 415k | bc->bits_valid -= n; | 194 | 415k | } |
Unexecuted instantiation: prores_raw.c:bits_priv_skip_remaining_le takdec.c:bits_priv_skip_remaining_le Line | Count | Source | 187 | 58.3M | { | 188 | 58.3M | #ifdef BITSTREAM_TEMPLATE_LE | 189 | 58.3M | bc->bits >>= n; | 190 | | #else | 191 | | bc->bits <<= n; | 192 | | #endif | 193 | 58.3M | bc->bits_valid -= n; | 194 | 58.3M | } |
photocd.c:bits_priv_skip_remaining_be Line | Count | Source | 187 | 5.10M | { | 188 | | #ifdef BITSTREAM_TEMPLATE_LE | 189 | | bc->bits >>= n; | 190 | | #else | 191 | 5.10M | bc->bits <<= n; | 192 | 5.10M | #endif | 193 | 5.10M | bc->bits_valid -= n; | 194 | 5.10M | } |
Unexecuted instantiation: photocd.c:bits_priv_skip_remaining_le mvha.c:bits_priv_skip_remaining_be Line | Count | Source | 187 | 1.82M | { | 188 | | #ifdef BITSTREAM_TEMPLATE_LE | 189 | | bc->bits >>= n; | 190 | | #else | 191 | 1.82M | bc->bits <<= n; | 192 | 1.82M | #endif | 193 | 1.82M | bc->bits_valid -= n; | 194 | 1.82M | } |
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 | 285M | { |
198 | 285M | uint64_t ret; |
199 | | |
200 | 285M | av_assert2(n > 0 && n < 64); |
201 | | |
202 | 285M | ret = BS_FUNC(priv_val_show)(bc, n); |
203 | 285M | BS_FUNC(priv_skip_remaining)(bc, n); |
204 | | |
205 | 285M | return ret; |
206 | 285M | } Unexecuted instantiation: tak_parser.c:bits_priv_val_get_le tak.c:bits_priv_val_get_le Line | Count | Source | 197 | 15.0M | { | 198 | 15.0M | uint64_t ret; | 199 | | | 200 | 15.0M | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 15.0M | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 15.0M | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 15.0M | return ret; | 206 | 15.0M | } |
sheervideo.c:bits_priv_val_get_be Line | Count | Source | 197 | 210M | { | 198 | 210M | uint64_t ret; | 199 | | | 200 | 210M | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 210M | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 210M | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 210M | return ret; | 206 | 210M | } |
Unexecuted instantiation: sheervideo.c:bits_priv_val_get_le utvideodec.c:bits_priv_val_get_le Line | Count | Source | 197 | 33.5k | { | 198 | 33.5k | uint64_t ret; | 199 | | | 200 | 33.5k | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 33.5k | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 33.5k | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 33.5k | return ret; | 206 | 33.5k | } |
Unexecuted instantiation: utvideodec.c:bits_priv_val_get_be vmixdec.c:bits_priv_val_get_be Line | Count | Source | 197 | 1.38M | { | 198 | 1.38M | uint64_t ret; | 199 | | | 200 | 1.38M | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 1.38M | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 1.38M | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 1.38M | return ret; | 206 | 1.38M | } |
Unexecuted instantiation: vmixdec.c:bits_priv_val_get_le magicyuv.c:bits_priv_val_get_be Line | Count | Source | 197 | 151k | { | 198 | 151k | uint64_t ret; | 199 | | | 200 | 151k | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 151k | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 151k | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 151k | return ret; | 206 | 151k | } |
Unexecuted instantiation: magicyuv.c:bits_priv_val_get_le prores_raw.c:bits_priv_val_get_be Line | Count | Source | 197 | 302k | { | 198 | 302k | uint64_t ret; | 199 | | | 200 | 302k | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 302k | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 302k | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 302k | return ret; | 206 | 302k | } |
Unexecuted instantiation: prores_raw.c:bits_priv_val_get_le takdec.c:bits_priv_val_get_le Line | Count | Source | 197 | 57.4M | { | 198 | 57.4M | uint64_t ret; | 199 | | | 200 | 57.4M | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 57.4M | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 57.4M | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 57.4M | return ret; | 206 | 57.4M | } |
photocd.c:bits_priv_val_get_be Line | Count | Source | 197 | 3.83k | { | 198 | 3.83k | uint64_t ret; | 199 | | | 200 | 3.83k | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 3.83k | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 3.83k | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 3.83k | return ret; | 206 | 3.83k | } |
Unexecuted instantiation: photocd.c:bits_priv_val_get_le mvha.c:bits_priv_val_get_be Line | Count | Source | 197 | 753k | { | 198 | 753k | uint64_t ret; | 199 | | | 200 | 753k | av_assert2(n > 0 && n < 64); | 201 | | | 202 | 753k | ret = BS_FUNC(priv_val_show)(bc, n); | 203 | 753k | BS_FUNC(priv_skip_remaining)(bc, n); | 204 | | | 205 | 753k | return ret; | 206 | 753k | } |
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 | 88.8M | { |
213 | 88.8M | if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0) |
214 | 1.52M | return 0; |
215 | | |
216 | 87.2M | return BS_FUNC(priv_val_get)(bc, 1); |
217 | 88.8M | } Unexecuted instantiation: tak_parser.c:bits_read_bit_le Line | Count | Source | 212 | 126k | { | 213 | 126k | if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0) | 214 | 1.43k | return 0; | 215 | | | 216 | 125k | return BS_FUNC(priv_val_get)(bc, 1); | 217 | 126k | } |
sheervideo.c:bits_read_bit_be Line | Count | Source | 212 | 80.6M | { | 213 | 80.6M | if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0) | 214 | 31.7k | return 0; | 215 | | | 216 | 80.6M | return BS_FUNC(priv_val_get)(bc, 1); | 217 | 80.6M | } |
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 | 303k | { | 213 | 303k | if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0) | 214 | 718 | return 0; | 215 | | | 216 | 302k | return BS_FUNC(priv_val_get)(bc, 1); | 217 | 303k | } |
Unexecuted instantiation: prores_raw.c:bits_read_bit_le takdec.c:bits_read_bit_le Line | Count | Source | 212 | 7.39M | { | 213 | 7.39M | if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0) | 214 | 1.49M | return 0; | 215 | | | 216 | 5.90M | return BS_FUNC(priv_val_get)(bc, 1); | 217 | 7.39M | } |
Unexecuted instantiation: photocd.c:bits_read_bit_le Unexecuted instantiation: photocd.c:bits_read_bit_be Line | Count | Source | 212 | 319k | { | 213 | 319k | if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0) | 214 | 0 | return 0; | 215 | | | 216 | 319k | return BS_FUNC(priv_val_get)(bc, 1); | 217 | 319k | } |
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 | 198M | { |
226 | 198M | av_assert2(n > 0 && n <= 32); |
227 | | |
228 | 198M | if (n > bc->bits_valid) { |
229 | 154M | if (BS_FUNC(priv_refill_32)(bc) < 0) |
230 | 146M | bc->bits_valid = n; |
231 | 154M | } |
232 | | |
233 | 198M | return BS_FUNC(priv_val_get)(bc, n); |
234 | 198M | } Unexecuted instantiation: tak_parser.c:bits_read_nz_le Line | Count | Source | 225 | 14.7M | { | 226 | 14.7M | av_assert2(n > 0 && n <= 32); | 227 | | | 228 | 14.7M | if (n > bc->bits_valid) { | 229 | 71.8k | if (BS_FUNC(priv_refill_32)(bc) < 0) | 230 | 9.16k | bc->bits_valid = n; | 231 | 71.8k | } | 232 | | | 233 | 14.7M | return BS_FUNC(priv_val_get)(bc, n); | 234 | 14.7M | } |
sheervideo.c:bits_read_nz_be Line | Count | Source | 225 | 129M | { | 226 | 129M | av_assert2(n > 0 && n <= 32); | 227 | | | 228 | 129M | if (n > bc->bits_valid) { | 229 | 110M | if (BS_FUNC(priv_refill_32)(bc) < 0) | 230 | 103M | bc->bits_valid = n; | 231 | 110M | } | 232 | | | 233 | 129M | return BS_FUNC(priv_val_get)(bc, n); | 234 | 129M | } |
Unexecuted instantiation: sheervideo.c:bits_read_nz_le utvideodec.c:bits_read_nz_le Line | Count | Source | 225 | 33.5k | { | 226 | 33.5k | av_assert2(n > 0 && n <= 32); | 227 | | | 228 | 33.5k | if (n > bc->bits_valid) { | 229 | 2.20k | if (BS_FUNC(priv_refill_32)(bc) < 0) | 230 | 0 | bc->bits_valid = n; | 231 | 2.20k | } | 232 | | | 233 | 33.5k | return BS_FUNC(priv_val_get)(bc, n); | 234 | 33.5k | } |
Unexecuted instantiation: utvideodec.c:bits_read_nz_be vmixdec.c:bits_read_nz_be Line | Count | Source | 225 | 1.38M | { | 226 | 1.38M | av_assert2(n > 0 && n <= 32); | 227 | | | 228 | 1.38M | if (n > bc->bits_valid) { | 229 | 32.7k | if (BS_FUNC(priv_refill_32)(bc) < 0) | 230 | 3.65k | bc->bits_valid = n; | 231 | 32.7k | } | 232 | | | 233 | 1.38M | return BS_FUNC(priv_val_get)(bc, n); | 234 | 1.38M | } |
Unexecuted instantiation: vmixdec.c:bits_read_nz_le magicyuv.c:bits_read_nz_be Line | Count | Source | 225 | 151k | { | 226 | 151k | av_assert2(n > 0 && n <= 32); | 227 | | | 228 | 151k | if (n > bc->bits_valid) { | 229 | 40.9k | if (BS_FUNC(priv_refill_32)(bc) < 0) | 230 | 0 | bc->bits_valid = n; | 231 | 40.9k | } | 232 | | | 233 | 151k | return BS_FUNC(priv_val_get)(bc, n); | 234 | 151k | } |
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 | 51.5M | { | 226 | 51.5M | av_assert2(n > 0 && n <= 32); | 227 | | | 228 | 51.5M | if (n > bc->bits_valid) { | 229 | 43.1M | if (BS_FUNC(priv_refill_32)(bc) < 0) | 230 | 42.7M | bc->bits_valid = n; | 231 | 43.1M | } | 232 | | | 233 | 51.5M | return BS_FUNC(priv_val_get)(bc, n); | 234 | 51.5M | } |
photocd.c:bits_read_nz_be Line | Count | Source | 225 | 3.83k | { | 226 | 3.83k | av_assert2(n > 0 && n <= 32); | 227 | | | 228 | 3.83k | 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 | 3.83k | return BS_FUNC(priv_val_get)(bc, n); | 234 | 3.83k | } |
Unexecuted instantiation: photocd.c:bits_read_nz_le Line | Count | Source | 225 | 434k | { | 226 | 434k | av_assert2(n > 0 && n <= 32); | 227 | | | 228 | 434k | if (n > bc->bits_valid) { | 229 | 32.6k | if (BS_FUNC(priv_refill_32)(bc) < 0) | 230 | 364 | bc->bits_valid = n; | 231 | 32.6k | } | 232 | | | 233 | 434k | return BS_FUNC(priv_val_get)(bc, n); | 234 | 434k | } |
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 | 43.6M | { |
241 | 43.6M | av_assert2(n <= 32); |
242 | | |
243 | 43.6M | if (!n) |
244 | 0 | return 0; |
245 | | |
246 | 43.6M | return BS_FUNC(read_nz)(bc, n); |
247 | 43.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 | 33.5k | { | 241 | 33.5k | av_assert2(n <= 32); | 242 | | | 243 | 33.5k | if (!n) | 244 | 0 | return 0; | 245 | | | 246 | 33.5k | return BS_FUNC(read_nz)(bc, n); | 247 | 33.5k | } |
Unexecuted instantiation: utvideodec.c:bits_read_be Line | Count | Source | 240 | 1.38M | { | 241 | 1.38M | av_assert2(n <= 32); | 242 | | | 243 | 1.38M | if (!n) | 244 | 0 | return 0; | 245 | | | 246 | 1.38M | return BS_FUNC(read_nz)(bc, n); | 247 | 1.38M | } |
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 | 42.2M | { | 241 | 42.2M | av_assert2(n <= 32); | 242 | | | 243 | 42.2M | if (!n) | 244 | 0 | return 0; | 245 | | | 246 | 42.2M | return BS_FUNC(read_nz)(bc, n); | 247 | 42.2M | } |
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 | 102k | { |
254 | 102k | uint64_t ret = 0; |
255 | 102k | unsigned left = 0; |
256 | | |
257 | 102k | av_assert2(n <= 63); |
258 | | |
259 | 102k | if (!n) |
260 | 0 | return 0; |
261 | | |
262 | 102k | if (n > bc->bits_valid) { |
263 | 80.0k | left = bc->bits_valid; |
264 | 80.0k | n -= left; |
265 | | |
266 | 80.0k | if (left) |
267 | 80.0k | ret = BS_FUNC(priv_val_get)(bc, left); |
268 | | |
269 | 80.0k | if (BS_FUNC(priv_refill_64)(bc) < 0) |
270 | 520 | bc->bits_valid = n; |
271 | | |
272 | 80.0k | } |
273 | | |
274 | 102k | #ifdef BITSTREAM_TEMPLATE_LE |
275 | 102k | 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 | 102k | return ret; |
281 | 102k | } Unexecuted instantiation: tak_parser.c:bits_read_63_le Line | Count | Source | 253 | 102k | { | 254 | 102k | uint64_t ret = 0; | 255 | 102k | unsigned left = 0; | 256 | | | 257 | 102k | av_assert2(n <= 63); | 258 | | | 259 | 102k | if (!n) | 260 | 0 | return 0; | 261 | | | 262 | 102k | if (n > bc->bits_valid) { | 263 | 80.0k | left = bc->bits_valid; | 264 | 80.0k | n -= left; | 265 | | | 266 | 80.0k | if (left) | 267 | 80.0k | ret = BS_FUNC(priv_val_get)(bc, left); | 268 | | | 269 | 80.0k | if (BS_FUNC(priv_refill_64)(bc) < 0) | 270 | 520 | bc->bits_valid = n; | 271 | | | 272 | 80.0k | } | 273 | | | 274 | 102k | #ifdef BITSTREAM_TEMPLATE_LE | 275 | 102k | 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 | 102k | return ret; | 281 | 102k | } |
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 | 102k | { |
288 | 102k | av_assert2(n <= 64); |
289 | | |
290 | 102k | 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 | 102k | return BS_FUNC(read_63)(bc, n); |
299 | 102k | } Unexecuted instantiation: tak_parser.c:bits_read_64_le Line | Count | Source | 287 | 102k | { | 288 | 102k | av_assert2(n <= 64); | 289 | | | 290 | 102k | 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 | 102k | return BS_FUNC(read_63)(bc, n); | 299 | 102k | } |
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.82M | { |
308 | 1.82M | av_assert2(n > 0 && n <= 32); |
309 | 1.82M | return sign_extend(BS_FUNC(read_nz)(bc, n), n); |
310 | 1.82M | } 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.82M | { | 308 | 1.82M | av_assert2(n > 0 && n <= 32); | 309 | 1.82M | return sign_extend(BS_FUNC(read_nz)(bc, n), n); | 310 | 1.82M | } |
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 | 3.58G | { |
332 | 3.58G | av_assert2(n > 0 && n <= 32); |
333 | | |
334 | 3.58G | if (n > bc->bits_valid) |
335 | 15.3M | BS_FUNC(priv_refill_32)(bc); |
336 | | |
337 | 3.58G | return BS_FUNC(priv_val_show)(bc, n); |
338 | 3.58G | } 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 | 3.49G | { | 332 | 3.49G | av_assert2(n > 0 && n <= 32); | 333 | | | 334 | 3.49G | if (n > bc->bits_valid) | 335 | 12.3M | BS_FUNC(priv_refill_32)(bc); | 336 | | | 337 | 3.49G | return BS_FUNC(priv_val_show)(bc, n); | 338 | 3.49G | } |
Unexecuted instantiation: sheervideo.c:bits_peek_nz_le utvideodec.c:bits_peek_nz_be Line | Count | Source | 331 | 6.96M | { | 332 | 6.96M | av_assert2(n > 0 && n <= 32); | 333 | | | 334 | 6.96M | if (n > bc->bits_valid) | 335 | 123k | BS_FUNC(priv_refill_32)(bc); | 336 | | | 337 | 6.96M | return BS_FUNC(priv_val_show)(bc, n); | 338 | 6.96M | } |
Unexecuted instantiation: utvideodec.c:bits_peek_nz_le vmixdec.c:bits_peek_nz_be Line | Count | Source | 331 | 1.38M | { | 332 | 1.38M | av_assert2(n > 0 && n <= 32); | 333 | | | 334 | 1.38M | if (n > bc->bits_valid) | 335 | 219k | BS_FUNC(priv_refill_32)(bc); | 336 | | | 337 | 1.38M | return BS_FUNC(priv_val_show)(bc, n); | 338 | 1.38M | } |
Unexecuted instantiation: vmixdec.c:bits_peek_nz_le magicyuv.c:bits_peek_nz_be Line | Count | Source | 331 | 72.6M | { | 332 | 72.6M | av_assert2(n > 0 && n <= 32); | 333 | | | 334 | 72.6M | if (n > bc->bits_valid) | 335 | 2.07M | BS_FUNC(priv_refill_32)(bc); | 336 | | | 337 | 72.6M | return BS_FUNC(priv_val_show)(bc, n); | 338 | 72.6M | } |
Unexecuted instantiation: magicyuv.c:bits_peek_nz_le prores_raw.c:bits_peek_nz_be Line | Count | Source | 331 | 940k | { | 332 | 940k | av_assert2(n > 0 && n <= 32); | 333 | | | 334 | 940k | if (n > bc->bits_valid) | 335 | 200k | BS_FUNC(priv_refill_32)(bc); | 336 | | | 337 | 940k | return BS_FUNC(priv_val_show)(bc, n); | 338 | 940k | } |
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 | 5.11M | { | 332 | 5.11M | av_assert2(n > 0 && n <= 32); | 333 | | | 334 | 5.11M | if (n > bc->bits_valid) | 335 | 309k | BS_FUNC(priv_refill_32)(bc); | 336 | | | 337 | 5.11M | return BS_FUNC(priv_val_show)(bc, n); | 338 | 5.11M | } |
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 | 88.9k | 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 | 3.58G | { |
346 | 3.58G | av_assert2(n <= 32); |
347 | | |
348 | 3.58G | if (!n) |
349 | 0 | return 0; |
350 | | |
351 | 3.58G | return BS_FUNC(peek_nz)(bc, n); |
352 | 3.58G | } Unexecuted instantiation: tak_parser.c:bits_peek_le Unexecuted instantiation: tak.c:bits_peek_le sheervideo.c:bits_peek_be Line | Count | Source | 345 | 3.49G | { | 346 | 3.49G | av_assert2(n <= 32); | 347 | | | 348 | 3.49G | if (!n) | 349 | 0 | return 0; | 350 | | | 351 | 3.49G | return BS_FUNC(peek_nz)(bc, n); | 352 | 3.49G | } |
Unexecuted instantiation: sheervideo.c:bits_peek_le utvideodec.c:bits_peek_be Line | Count | Source | 345 | 6.96M | { | 346 | 6.96M | av_assert2(n <= 32); | 347 | | | 348 | 6.96M | if (!n) | 349 | 0 | return 0; | 350 | | | 351 | 6.96M | return BS_FUNC(peek_nz)(bc, n); | 352 | 6.96M | } |
Unexecuted instantiation: utvideodec.c:bits_peek_le Line | Count | Source | 345 | 1.38M | { | 346 | 1.38M | av_assert2(n <= 32); | 347 | | | 348 | 1.38M | if (!n) | 349 | 0 | return 0; | 350 | | | 351 | 1.38M | return BS_FUNC(peek_nz)(bc, n); | 352 | 1.38M | } |
Unexecuted instantiation: vmixdec.c:bits_peek_le Line | Count | Source | 345 | 72.6M | { | 346 | 72.6M | av_assert2(n <= 32); | 347 | | | 348 | 72.6M | if (!n) | 349 | 0 | return 0; | 350 | | | 351 | 72.6M | return BS_FUNC(peek_nz)(bc, n); | 352 | 72.6M | } |
Unexecuted instantiation: magicyuv.c:bits_peek_le prores_raw.c:bits_peek_be Line | Count | Source | 345 | 940k | { | 346 | 940k | av_assert2(n <= 32); | 347 | | | 348 | 940k | if (!n) | 349 | 0 | return 0; | 350 | | | 351 | 940k | return BS_FUNC(peek_nz)(bc, n); | 352 | 940k | } |
Unexecuted instantiation: prores_raw.c:bits_peek_le Unexecuted instantiation: takdec.c:bits_peek_le Line | Count | Source | 345 | 5.11M | { | 346 | 5.11M | av_assert2(n <= 32); | 347 | | | 348 | 5.11M | if (!n) | 349 | 0 | return 0; | 350 | | | 351 | 5.11M | return BS_FUNC(peek_nz)(bc, n); | 352 | 5.11M | } |
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 | 8.82M | { |
385 | 8.82M | if (n < bc->bits_valid) |
386 | 3.46M | BS_FUNC(priv_skip_remaining)(bc, n); |
387 | 5.35M | else { |
388 | 5.35M | n -= bc->bits_valid; |
389 | 5.35M | bc->bits = 0; |
390 | 5.35M | bc->bits_valid = 0; |
391 | | |
392 | 5.35M | 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.35M | BS_FUNC(priv_refill_64)(bc); |
399 | 5.35M | if (n) |
400 | 745k | BS_FUNC(priv_skip_remaining)(bc, n); |
401 | 5.35M | } |
402 | 8.82M | } Unexecuted instantiation: tak_parser.c:bits_skip_le Line | Count | Source | 384 | 4.85M | { | 385 | 4.85M | if (n < bc->bits_valid) | 386 | 251k | BS_FUNC(priv_skip_remaining)(bc, n); | 387 | 4.60M | else { | 388 | 4.60M | n -= bc->bits_valid; | 389 | 4.60M | bc->bits = 0; | 390 | 4.60M | bc->bits_valid = 0; | 391 | | | 392 | 4.60M | 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.60M | BS_FUNC(priv_refill_64)(bc); | 399 | 4.60M | if (n) | 400 | 73.7k | BS_FUNC(priv_skip_remaining)(bc, n); | 401 | 4.60M | } | 402 | 4.85M | } |
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.39M | { | 385 | 1.39M | if (n < bc->bits_valid) | 386 | 1.38M | BS_FUNC(priv_skip_remaining)(bc, n); | 387 | 5.43k | else { | 388 | 5.43k | n -= bc->bits_valid; | 389 | 5.43k | bc->bits = 0; | 390 | 5.43k | bc->bits_valid = 0; | 391 | | | 392 | 5.43k | 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.43k | BS_FUNC(priv_refill_64)(bc); | 399 | 5.43k | if (n) | 400 | 2.92k | BS_FUNC(priv_skip_remaining)(bc, n); | 401 | 5.43k | } | 402 | 1.39M | } |
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 | 113k | { | 385 | 113k | if (n < bc->bits_valid) | 386 | 110k | BS_FUNC(priv_skip_remaining)(bc, n); | 387 | 3.33k | else { | 388 | 3.33k | n -= bc->bits_valid; | 389 | 3.33k | bc->bits = 0; | 390 | 3.33k | bc->bits_valid = 0; | 391 | | | 392 | 3.33k | if (n >= 64) { | 393 | 0 | unsigned int skip = n / 8; | 394 | |
| 395 | 0 | n -= skip * 8; | 396 | 0 | bc->ptr += skip; | 397 | 0 | } | 398 | 3.33k | BS_FUNC(priv_refill_64)(bc); | 399 | 3.33k | if (n) | 400 | 1.97k | BS_FUNC(priv_skip_remaining)(bc, n); | 401 | 3.33k | } | 402 | 113k | } |
Unexecuted instantiation: prores_raw.c:bits_skip_le Line | Count | Source | 384 | 957k | { | 385 | 957k | if (n < bc->bits_valid) | 386 | 215k | BS_FUNC(priv_skip_remaining)(bc, n); | 387 | 742k | else { | 388 | 742k | n -= bc->bits_valid; | 389 | 742k | bc->bits = 0; | 390 | 742k | bc->bits_valid = 0; | 391 | | | 392 | 742k | if (n >= 64) { | 393 | 0 | unsigned int skip = n / 8; | 394 | |
| 395 | 0 | n -= skip * 8; | 396 | 0 | bc->ptr += skip; | 397 | 0 | } | 398 | 742k | BS_FUNC(priv_refill_64)(bc); | 399 | 742k | if (n) | 400 | 666k | BS_FUNC(priv_skip_remaining)(bc, n); | 401 | 742k | } | 402 | 957k | } |
Line | Count | Source | 384 | 1.44M | { | 385 | 1.44M | if (n < bc->bits_valid) | 386 | 1.44M | BS_FUNC(priv_skip_remaining)(bc, n); | 387 | 988 | else { | 388 | 988 | n -= bc->bits_valid; | 389 | 988 | bc->bits = 0; | 390 | 988 | bc->bits_valid = 0; | 391 | | | 392 | 988 | if (n >= 64) { | 393 | 0 | unsigned int skip = n / 8; | 394 | |
| 395 | 0 | n -= skip * 8; | 396 | 0 | bc->ptr += skip; | 397 | 0 | } | 398 | 988 | BS_FUNC(priv_refill_64)(bc); | 399 | 988 | if (n) | 400 | 305 | BS_FUNC(priv_skip_remaining)(bc, n); | 401 | 988 | } | 402 | 1.44M | } |
Unexecuted instantiation: photocd.c:bits_skip_le Line | Count | Source | 384 | 57.6k | { | 385 | 57.6k | if (n < bc->bits_valid) | 386 | 57.6k | 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 | 57.6k | } |
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 | 909k | { |
421 | 909k | unsigned int n = -BS_FUNC(tell)(bc) & 7; |
422 | 909k | if (n) |
423 | 232k | BS_FUNC(skip)(bc, n); |
424 | 909k | return bc->buffer + (BS_FUNC(tell)(bc) >> 3); |
425 | 909k | } Unexecuted instantiation: tak_parser.c:bits_align_le Line | Count | Source | 420 | 77.1k | { | 421 | 77.1k | unsigned int n = -BS_FUNC(tell)(bc) & 7; | 422 | 77.1k | if (n) | 423 | 76.2k | BS_FUNC(skip)(bc, n); | 424 | 77.1k | return bc->buffer + (BS_FUNC(tell)(bc) >> 3); | 425 | 77.1k | } |
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 | 20.0k | { | 421 | 20.0k | unsigned int n = -BS_FUNC(tell)(bc) & 7; | 422 | 20.0k | if (n) | 423 | 10.4k | BS_FUNC(skip)(bc, n); | 424 | 20.0k | return bc->buffer + (BS_FUNC(tell)(bc) >> 3); | 425 | 20.0k | } |
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 | 811k | { | 421 | 811k | unsigned int n = -BS_FUNC(tell)(bc) & 7; | 422 | 811k | if (n) | 423 | 145k | BS_FUNC(skip)(bc, n); | 424 | 811k | return bc->buffer + (BS_FUNC(tell)(bc) >> 3); | 425 | 811k | } |
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.06M | { |
490 | 2.06M | unsigned idx; |
491 | | |
492 | 2.06M | *nb_bits = -*n; |
493 | 2.06M | idx = BS_FUNC(peek)(bc, *nb_bits) + code; |
494 | 2.06M | *n = table[idx].len; |
495 | | |
496 | 2.06M | return table[idx].sym; |
497 | 2.06M | } 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.54M | { | 490 | 1.54M | unsigned idx; | 491 | | | 492 | 1.54M | *nb_bits = -*n; | 493 | 1.54M | idx = BS_FUNC(peek)(bc, *nb_bits) + code; | 494 | 1.54M | *n = table[idx].len; | 495 | | | 496 | 1.54M | return table[idx].sym; | 497 | 1.54M | } |
Unexecuted instantiation: sheervideo.c:bits_priv_set_idx_le utvideodec.c:bits_priv_set_idx_be Line | Count | Source | 489 | 73.4k | { | 490 | 73.4k | unsigned idx; | 491 | | | 492 | 73.4k | *nb_bits = -*n; | 493 | 73.4k | idx = BS_FUNC(peek)(bc, *nb_bits) + code; | 494 | 73.4k | *n = table[idx].len; | 495 | | | 496 | 73.4k | return table[idx].sym; | 497 | 73.4k | } |
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 | 227k | { | 490 | 227k | unsigned idx; | 491 | | | 492 | 227k | *nb_bits = -*n; | 493 | 227k | idx = BS_FUNC(peek)(bc, *nb_bits) + code; | 494 | 227k | *n = table[idx].len; | 495 | | | 496 | 227k | return table[idx].sym; | 497 | 227k | } |
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 | 216k | { | 490 | 216k | unsigned idx; | 491 | | | 492 | 216k | *nb_bits = -*n; | 493 | 216k | idx = BS_FUNC(peek)(bc, *nb_bits) + code; | 494 | 216k | *n = table[idx].len; | 495 | | | 496 | 216k | return table[idx].sym; | 497 | 216k | } |
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 | 3.57G | { |
513 | 3.57G | int nb_bits; |
514 | 3.57G | unsigned idx = BS_FUNC(peek)(bc, bits); |
515 | 3.57G | int code = table[idx].sym; |
516 | 3.57G | int n = table[idx].len; |
517 | | |
518 | 3.57G | if (max_depth > 1 && n < 0) { |
519 | 1.84M | BS_FUNC(priv_skip_remaining)(bc, bits); |
520 | 1.84M | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); |
521 | 1.84M | if (max_depth > 2 && n < 0) { |
522 | 46.6k | BS_FUNC(priv_skip_remaining)(bc, nb_bits); |
523 | 46.6k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); |
524 | 46.6k | } |
525 | 1.84M | } |
526 | 3.57G | BS_FUNC(priv_skip_remaining)(bc, n); |
527 | | |
528 | 3.57G | return code; |
529 | 3.57G | } 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 | 3.49G | { | 513 | 3.49G | int nb_bits; | 514 | 3.49G | unsigned idx = BS_FUNC(peek)(bc, bits); | 515 | 3.49G | int code = table[idx].sym; | 516 | 3.49G | int n = table[idx].len; | 517 | | | 518 | 3.49G | if (max_depth > 1 && n < 0) { | 519 | 1.54M | BS_FUNC(priv_skip_remaining)(bc, bits); | 520 | 1.54M | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 521 | 1.54M | 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.54M | } | 526 | 3.49G | BS_FUNC(priv_skip_remaining)(bc, n); | 527 | | | 528 | 3.49G | return code; | 529 | 3.49G | } |
Unexecuted instantiation: sheervideo.c:bits_read_vlc_le utvideodec.c:bits_read_vlc_be Line | Count | Source | 512 | 6.48M | { | 513 | 6.48M | int nb_bits; | 514 | 6.48M | unsigned idx = BS_FUNC(peek)(bc, bits); | 515 | 6.48M | int code = table[idx].sym; | 516 | 6.48M | int n = table[idx].len; | 517 | | | 518 | 6.48M | if (max_depth > 1 && n < 0) { | 519 | 24.0k | BS_FUNC(priv_skip_remaining)(bc, bits); | 520 | 24.0k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 521 | 24.0k | if (max_depth > 2 && n < 0) { | 522 | 22.3k | BS_FUNC(priv_skip_remaining)(bc, nb_bits); | 523 | 22.3k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 524 | 22.3k | } | 525 | 24.0k | } | 526 | 6.48M | BS_FUNC(priv_skip_remaining)(bc, n); | 527 | | | 528 | 6.48M | return code; | 529 | 6.48M | } |
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 | 72.0M | { | 513 | 72.0M | int nb_bits; | 514 | 72.0M | unsigned idx = BS_FUNC(peek)(bc, bits); | 515 | 72.0M | int code = table[idx].sym; | 516 | 72.0M | int n = table[idx].len; | 517 | | | 518 | 72.0M | if (max_depth > 1 && n < 0) { | 519 | 56.9k | BS_FUNC(priv_skip_remaining)(bc, bits); | 520 | 56.9k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 521 | 56.9k | if (max_depth > 2 && n < 0) { | 522 | 24.3k | BS_FUNC(priv_skip_remaining)(bc, nb_bits); | 523 | 24.3k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 524 | 24.3k | } | 525 | 56.9k | } | 526 | 72.0M | BS_FUNC(priv_skip_remaining)(bc, n); | 527 | | | 528 | 72.0M | return code; | 529 | 72.0M | } |
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.66M | { | 513 | 3.66M | int nb_bits; | 514 | 3.66M | unsigned idx = BS_FUNC(peek)(bc, bits); | 515 | 3.66M | int code = table[idx].sym; | 516 | 3.66M | int n = table[idx].len; | 517 | | | 518 | 3.66M | 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.66M | BS_FUNC(priv_skip_remaining)(bc, n); | 527 | | | 528 | 3.66M | return code; | 529 | 3.66M | } |
Unexecuted instantiation: photocd.c:bits_read_vlc_le Line | Count | Source | 512 | 793k | { | 513 | 793k | int nb_bits; | 514 | 793k | unsigned idx = BS_FUNC(peek)(bc, bits); | 515 | 793k | int code = table[idx].sym; | 516 | 793k | int n = table[idx].len; | 517 | | | 518 | 793k | if (max_depth > 1 && n < 0) { | 519 | 216k | BS_FUNC(priv_skip_remaining)(bc, bits); | 520 | 216k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 521 | 216k | 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 | 216k | } | 526 | 793k | BS_FUNC(priv_skip_remaining)(bc, n); | 527 | | | 528 | 793k | return code; | 529 | 793k | } |
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 | 841k | { |
550 | 841k | unsigned idx = BS_FUNC(peek)(bc, bits); |
551 | 841k | int ret, nb_bits, code, n = Jtable[idx].len; |
552 | 841k | if (Jtable[idx].num) { |
553 | 703k | AV_COPY64U(dst, Jtable[idx].val8); |
554 | 703k | ret = Jtable[idx].num; |
555 | 703k | } else { |
556 | 138k | code = table[idx].sym; |
557 | 138k | n = table[idx].len; |
558 | 138k | if (max_depth > 1 && n < 0) { |
559 | 132k | BS_FUNC(priv_skip_remaining)(bc, bits); |
560 | 132k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); |
561 | 132k | if (max_depth > 2 && n < 0) { |
562 | 40.4k | BS_FUNC(priv_skip_remaining)(bc, nb_bits); |
563 | 40.4k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); |
564 | 40.4k | } |
565 | 132k | } |
566 | 138k | if (symbols_size == 1) |
567 | 45.2k | *dst = code; |
568 | 92.7k | else |
569 | 138k | AV_WN16(dst, code); |
570 | 138k | ret = n > 0; |
571 | 138k | } |
572 | 841k | BS_FUNC(priv_skip_remaining)(bc, n); |
573 | | |
574 | 841k | return ret; |
575 | 841k | } 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 | 408k | { | 550 | 408k | unsigned idx = BS_FUNC(peek)(bc, bits); | 551 | 408k | int ret, nb_bits, code, n = Jtable[idx].len; | 552 | 408k | if (Jtable[idx].num) { | 553 | 390k | AV_COPY64U(dst, Jtable[idx].val8); | 554 | 390k | ret = Jtable[idx].num; | 555 | 390k | } else { | 556 | 18.5k | code = table[idx].sym; | 557 | 18.5k | n = table[idx].len; | 558 | 18.5k | if (max_depth > 1 && n < 0) { | 559 | 14.3k | BS_FUNC(priv_skip_remaining)(bc, bits); | 560 | 14.3k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 561 | 14.3k | if (max_depth > 2 && n < 0) { | 562 | 12.6k | BS_FUNC(priv_skip_remaining)(bc, nb_bits); | 563 | 12.6k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 564 | 12.6k | } | 565 | 14.3k | } | 566 | 18.5k | if (symbols_size == 1) | 567 | 15.7k | *dst = code; | 568 | 2.82k | else | 569 | 18.5k | AV_WN16(dst, code); | 570 | 18.5k | ret = n > 0; | 571 | 18.5k | } | 572 | 408k | BS_FUNC(priv_skip_remaining)(bc, n); | 573 | | | 574 | 408k | return ret; | 575 | 408k | } |
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 | 432k | { | 550 | 432k | unsigned idx = BS_FUNC(peek)(bc, bits); | 551 | 432k | int ret, nb_bits, code, n = Jtable[idx].len; | 552 | 432k | if (Jtable[idx].num) { | 553 | 313k | AV_COPY64U(dst, Jtable[idx].val8); | 554 | 313k | ret = Jtable[idx].num; | 555 | 313k | } else { | 556 | 119k | code = table[idx].sym; | 557 | 119k | n = table[idx].len; | 558 | 119k | if (max_depth > 1 && n < 0) { | 559 | 117k | BS_FUNC(priv_skip_remaining)(bc, bits); | 560 | 117k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 561 | 117k | if (max_depth > 2 && n < 0) { | 562 | 27.7k | BS_FUNC(priv_skip_remaining)(bc, nb_bits); | 563 | 27.7k | code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); | 564 | 27.7k | } | 565 | 117k | } | 566 | 119k | if (symbols_size == 1) | 567 | 29.5k | *dst = code; | 568 | 89.9k | else | 569 | 119k | AV_WN16(dst, code); | 570 | 119k | ret = n > 0; | 571 | 119k | } | 572 | 432k | BS_FUNC(priv_skip_remaining)(bc, n); | 573 | | | 574 | 432k | return ret; | 575 | 432k | } |
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 |