Coverage Report

Created: 2026-10-28 08:13

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/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
14.9G
#define BS_JOIN(x, y, z) x ## y ## z
30
14.9G
#define BS_JOIN3(x, y, z) BS_JOIN(x, y, z)
31
14.9G
#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
11.7M
{
52
#if !UNCHECKED_BITSTREAM_READER
53
11.7M
    if (bc->ptr >= bc->buffer_end)
54
3.75M
        return -1;
55
7.52M
#endif
56
57
#ifdef BITSTREAM_TEMPLATE_LE
58
7.53M
    bc->bits       = AV_RL64(bc->ptr);
59
#else
60
483k
    bc->bits       = AV_RB64(bc->ptr);
61
#endif
62
474k
    bc->ptr       += 8;
63
474k
    bc->bits_valid = 64;
64
65
474k
    return 0;
66
11.7M
}
tak_parser.c:bits_priv_refill_64_le
Line
Count
Source
51
3.07M
{
52
3.07M
#if !UNCHECKED_BITSTREAM_READER
53
3.07M
    if (bc->ptr >= bc->buffer_end)
54
0
        return -1;
55
3.07M
#endif
56
57
3.07M
#ifdef BITSTREAM_TEMPLATE_LE
58
3.07M
    bc->bits       = AV_RL64(bc->ptr);
59
#else
60
    bc->bits       = AV_RB64(bc->ptr);
61
#endif
62
3.07M
    bc->ptr       += 8;
63
3.07M
    bc->bits_valid = 64;
64
65
3.07M
    return 0;
66
3.07M
}
tak.c:bits_priv_refill_64_le
Line
Count
Source
51
3.78M
{
52
3.78M
#if !UNCHECKED_BITSTREAM_READER
53
3.78M
    if (bc->ptr >= bc->buffer_end)
54
6.30k
        return -1;
55
3.77M
#endif
56
57
3.77M
#ifdef BITSTREAM_TEMPLATE_LE
58
3.77M
    bc->bits       = AV_RL64(bc->ptr);
59
#else
60
    bc->bits       = AV_RB64(bc->ptr);
61
#endif
62
3.77M
    bc->ptr       += 8;
63
3.77M
    bc->bits_valid = 64;
64
65
3.77M
    return 0;
66
3.78M
}
sheervideo.c:bits_priv_refill_64_be
Line
Count
Source
51
139k
{
52
139k
#if !UNCHECKED_BITSTREAM_READER
53
139k
    if (bc->ptr >= bc->buffer_end)
54
14.2k
        return -1;
55
125k
#endif
56
57
#ifdef BITSTREAM_TEMPLATE_LE
58
    bc->bits       = AV_RL64(bc->ptr);
59
#else
60
125k
    bc->bits       = AV_RB64(bc->ptr);
61
125k
#endif
62
125k
    bc->ptr       += 8;
63
125k
    bc->bits_valid = 64;
64
65
125k
    return 0;
66
139k
}
Unexecuted instantiation: sheervideo.c:bits_priv_refill_64_le
utvideodec.c:bits_priv_refill_64_le
Line
Count
Source
51
10.8k
{
52
#if !UNCHECKED_BITSTREAM_READER
53
    if (bc->ptr >= bc->buffer_end)
54
        return -1;
55
#endif
56
57
10.8k
#ifdef BITSTREAM_TEMPLATE_LE
58
10.8k
    bc->bits       = AV_RL64(bc->ptr);
59
#else
60
    bc->bits       = AV_RB64(bc->ptr);
61
#endif
62
10.8k
    bc->ptr       += 8;
63
10.8k
    bc->bits_valid = 64;
64
65
10.8k
    return 0;
66
10.8k
}
utvideodec.c:bits_priv_refill_64_be
Line
Count
Source
51
9.68k
{
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.68k
    bc->bits       = AV_RB64(bc->ptr);
61
9.68k
#endif
62
9.68k
    bc->ptr       += 8;
63
9.68k
    bc->bits_valid = 64;
64
65
9.68k
    return 0;
66
9.68k
}
vmixdec.c:bits_priv_refill_64_be
Line
Count
Source
51
212k
{
52
212k
#if !UNCHECKED_BITSTREAM_READER
53
212k
    if (bc->ptr >= bc->buffer_end)
54
189k
        return -1;
55
23.3k
#endif
56
57
#ifdef BITSTREAM_TEMPLATE_LE
58
    bc->bits       = AV_RL64(bc->ptr);
59
#else
60
23.3k
    bc->bits       = AV_RB64(bc->ptr);
61
23.3k
#endif
62
23.3k
    bc->ptr       += 8;
63
23.3k
    bc->bits_valid = 64;
64
65
23.3k
    return 0;
66
212k
}
Unexecuted instantiation: vmixdec.c:bits_priv_refill_64_le
magicyuv.c:bits_priv_refill_64_be
Line
Count
Source
51
97.7k
{
52
97.7k
#if !UNCHECKED_BITSTREAM_READER
53
97.7k
    if (bc->ptr >= bc->buffer_end)
54
2.67k
        return -1;
55
95.1k
#endif
56
57
#ifdef BITSTREAM_TEMPLATE_LE
58
    bc->bits       = AV_RL64(bc->ptr);
59
#else
60
95.1k
    bc->bits       = AV_RB64(bc->ptr);
61
95.1k
#endif
62
95.1k
    bc->ptr       += 8;
63
95.1k
    bc->bits_valid = 64;
64
65
95.1k
    return 0;
66
97.7k
}
Unexecuted instantiation: magicyuv.c:bits_priv_refill_64_le
prores_raw.c:bits_priv_refill_64_be
Line
Count
Source
51
459k
{
52
459k
#if !UNCHECKED_BITSTREAM_READER
53
459k
    if (bc->ptr >= bc->buffer_end)
54
351k
        return -1;
55
107k
#endif
56
57
#ifdef BITSTREAM_TEMPLATE_LE
58
    bc->bits       = AV_RL64(bc->ptr);
59
#else
60
107k
    bc->bits       = AV_RB64(bc->ptr);
61
107k
#endif
62
107k
    bc->ptr       += 8;
63
107k
    bc->bits_valid = 64;
64
65
107k
    return 0;
66
459k
}
Unexecuted instantiation: prores_raw.c:bits_priv_refill_64_le
takdec.c:bits_priv_refill_64_le
Line
Count
Source
51
2.36M
{
52
2.36M
#if !UNCHECKED_BITSTREAM_READER
53
2.36M
    if (bc->ptr >= bc->buffer_end)
54
1.68M
        return -1;
55
674k
#endif
56
57
674k
#ifdef BITSTREAM_TEMPLATE_LE
58
674k
    bc->bits       = AV_RL64(bc->ptr);
59
#else
60
    bc->bits       = AV_RB64(bc->ptr);
61
#endif
62
674k
    bc->ptr       += 8;
63
674k
    bc->bits_valid = 64;
64
65
674k
    return 0;
66
2.36M
}
photocd.c:bits_priv_refill_64_be
Line
Count
Source
51
1.34k
{
52
1.34k
#if !UNCHECKED_BITSTREAM_READER
53
1.34k
    if (bc->ptr >= bc->buffer_end)
54
75
        return -1;
55
1.27k
#endif
56
57
#ifdef BITSTREAM_TEMPLATE_LE
58
    bc->bits       = AV_RL64(bc->ptr);
59
#else
60
1.27k
    bc->bits       = AV_RB64(bc->ptr);
61
1.27k
#endif
62
1.27k
    bc->ptr       += 8;
63
1.27k
    bc->bits_valid = 64;
64
65
1.27k
    return 0;
66
1.34k
}
Unexecuted instantiation: photocd.c:bits_priv_refill_64_le
proresdec.c:bits_priv_refill_64_be
Line
Count
Source
51
1.58M
{
52
1.58M
#if !UNCHECKED_BITSTREAM_READER
53
1.58M
    if (bc->ptr >= bc->buffer_end)
54
1.50M
        return -1;
55
77.4k
#endif
56
57
#ifdef BITSTREAM_TEMPLATE_LE
58
    bc->bits       = AV_RL64(bc->ptr);
59
#else
60
77.4k
    bc->bits       = AV_RB64(bc->ptr);
61
77.4k
#endif
62
77.4k
    bc->ptr       += 8;
63
77.4k
    bc->bits_valid = 64;
64
65
77.4k
    return 0;
66
1.58M
}
Unexecuted instantiation: proresdec.c:bits_priv_refill_64_le
Unexecuted instantiation: rw2dec.c:bits_priv_refill_64_le
mvha.c:bits_priv_refill_64_be
Line
Count
Source
51
43.7k
{
52
43.7k
#if !UNCHECKED_BITSTREAM_READER
53
43.7k
    if (bc->ptr >= bc->buffer_end)
54
0
        return -1;
55
43.7k
#endif
56
57
#ifdef BITSTREAM_TEMPLATE_LE
58
    bc->bits       = AV_RL64(bc->ptr);
59
#else
60
43.7k
    bc->bits       = AV_RB64(bc->ptr);
61
43.7k
#endif
62
43.7k
    bc->ptr       += 8;
63
43.7k
    bc->bits_valid = 64;
64
65
43.7k
    return 0;
66
43.7k
}
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
151M
{
77
#if !UNCHECKED_BITSTREAM_READER
78
151M
    if (bc->ptr >= bc->buffer_end)
79
131M
        return -1;
80
357k
#endif
81
82
#ifdef BITSTREAM_TEMPLATE_LE
83
359k
    bc->bits      |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid;
84
#else
85
19.6M
    bc->bits      |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid);
86
#endif
87
19.5M
    bc->ptr        += 4;
88
19.5M
    bc->bits_valid += 32;
89
90
19.5M
    return 0;
91
151M
}
Unexecuted instantiation: tak_parser.c:bits_priv_refill_32_le
tak.c:bits_priv_refill_32_le
Line
Count
Source
76
60.1k
{
77
60.1k
#if !UNCHECKED_BITSTREAM_READER
78
60.1k
    if (bc->ptr >= bc->buffer_end)
79
8.46k
        return -1;
80
51.7k
#endif
81
82
51.7k
#ifdef BITSTREAM_TEMPLATE_LE
83
51.7k
    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
51.7k
    bc->ptr        += 4;
88
51.7k
    bc->bits_valid += 32;
89
90
51.7k
    return 0;
91
60.1k
}
sheervideo.c:bits_priv_refill_32_be
Line
Count
Source
76
106M
{
77
106M
#if !UNCHECKED_BITSTREAM_READER
78
106M
    if (bc->ptr >= bc->buffer_end)
79
87.6M
        return -1;
80
18.4M
#endif
81
82
#ifdef BITSTREAM_TEMPLATE_LE
83
    bc->bits      |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid;
84
#else
85
18.4M
    bc->bits      |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid);
86
18.4M
#endif
87
18.4M
    bc->ptr        += 4;
88
18.4M
    bc->bits_valid += 32;
89
90
18.4M
    return 0;
91
106M
}
Unexecuted instantiation: sheervideo.c:bits_priv_refill_32_le
utvideodec.c:bits_priv_refill_32_le
Line
Count
Source
76
2.35k
{
77
#if !UNCHECKED_BITSTREAM_READER
78
    if (bc->ptr >= bc->buffer_end)
79
        return -1;
80
#endif
81
82
2.35k
#ifdef BITSTREAM_TEMPLATE_LE
83
2.35k
    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.35k
    bc->ptr        += 4;
88
2.35k
    bc->bits_valid += 32;
89
90
2.35k
    return 0;
91
2.35k
}
utvideodec.c:bits_priv_refill_32_be
Line
Count
Source
76
176k
{
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
176k
    bc->bits      |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid);
86
176k
#endif
87
176k
    bc->ptr        += 4;
88
176k
    bc->bits_valid += 32;
89
90
176k
    return 0;
91
176k
}
vmixdec.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
50.8k
        return -1;
80
149k
#endif
81
82
#ifdef BITSTREAM_TEMPLATE_LE
83
    bc->bits      |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid;
84
#else
85
149k
    bc->bits      |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid);
86
149k
#endif
87
149k
    bc->ptr        += 4;
88
149k
    bc->bits_valid += 32;
89
90
149k
    return 0;
91
200k
}
Unexecuted instantiation: vmixdec.c:bits_priv_refill_32_le
magicyuv.c:bits_priv_refill_32_be
Line
Count
Source
76
4.01M
{
77
4.01M
#if !UNCHECKED_BITSTREAM_READER
78
4.01M
    if (bc->ptr >= bc->buffer_end)
79
3.76M
        return -1;
80
248k
#endif
81
82
#ifdef BITSTREAM_TEMPLATE_LE
83
    bc->bits      |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid;
84
#else
85
248k
    bc->bits      |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid);
86
248k
#endif
87
248k
    bc->ptr        += 4;
88
248k
    bc->bits_valid += 32;
89
90
248k
    return 0;
91
4.01M
}
Unexecuted instantiation: magicyuv.c:bits_priv_refill_32_le
prores_raw.c:bits_priv_refill_32_be
Line
Count
Source
76
551k
{
77
551k
#if !UNCHECKED_BITSTREAM_READER
78
551k
    if (bc->ptr >= bc->buffer_end)
79
488k
        return -1;
80
63.1k
#endif
81
82
#ifdef BITSTREAM_TEMPLATE_LE
83
    bc->bits      |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid;
84
#else
85
63.1k
    bc->bits      |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid);
86
63.1k
#endif
87
63.1k
    bc->ptr        += 4;
88
63.1k
    bc->bits_valid += 32;
89
90
63.1k
    return 0;
91
551k
}
Unexecuted instantiation: prores_raw.c:bits_priv_refill_32_le
takdec.c:bits_priv_refill_32_le
Line
Count
Source
76
35.4M
{
77
35.4M
#if !UNCHECKED_BITSTREAM_READER
78
35.4M
    if (bc->ptr >= bc->buffer_end)
79
35.1M
        return -1;
80
305k
#endif
81
82
305k
#ifdef BITSTREAM_TEMPLATE_LE
83
305k
    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
305k
    bc->ptr        += 4;
88
305k
    bc->bits_valid += 32;
89
90
305k
    return 0;
91
35.4M
}
photocd.c:bits_priv_refill_32_be
Line
Count
Source
76
288k
{
77
288k
#if !UNCHECKED_BITSTREAM_READER
78
288k
    if (bc->ptr >= bc->buffer_end)
79
349
        return -1;
80
288k
#endif
81
82
#ifdef BITSTREAM_TEMPLATE_LE
83
    bc->bits      |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid;
84
#else
85
288k
    bc->bits      |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid);
86
288k
#endif
87
288k
    bc->ptr        += 4;
88
288k
    bc->bits_valid += 32;
89
90
288k
    return 0;
91
288k
}
Unexecuted instantiation: photocd.c:bits_priv_refill_32_le
proresdec.c:bits_priv_refill_32_be
Line
Count
Source
76
4.99M
{
77
4.99M
#if !UNCHECKED_BITSTREAM_READER
78
4.99M
    if (bc->ptr >= bc->buffer_end)
79
4.77M
        return -1;
80
225k
#endif
81
82
#ifdef BITSTREAM_TEMPLATE_LE
83
    bc->bits      |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid;
84
#else
85
225k
    bc->bits      |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid);
86
225k
#endif
87
225k
    bc->ptr        += 4;
88
225k
    bc->bits_valid += 32;
89
90
225k
    return 0;
91
4.99M
}
Unexecuted instantiation: proresdec.c:bits_priv_refill_32_le
Unexecuted instantiation: rw2dec.c:bits_priv_refill_32_le
mvha.c:bits_priv_refill_32_be
Line
Count
Source
76
125k
{
77
125k
#if !UNCHECKED_BITSTREAM_READER
78
125k
    if (bc->ptr >= bc->buffer_end)
79
4.01k
        return -1;
80
121k
#endif
81
82
#ifdef BITSTREAM_TEMPLATE_LE
83
    bc->bits      |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid;
84
#else
85
121k
    bc->bits      |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid);
86
121k
#endif
87
121k
    bc->ptr        += 4;
88
121k
    bc->bits_valid += 32;
89
90
121k
    return 0;
91
125k
}
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
4.70M
{
104
4.70M
    unsigned int buffer_size;
105
106
4.70M
    if (bit_size > INT_MAX - 7 || !buffer) {
107
0
        bc->buffer     = NULL;
108
0
        bc->ptr        = NULL;
109
0
        bc->bits_valid = 0;
110
0
        return AVERROR_INVALIDDATA;
111
0
    }
112
113
4.70M
    buffer_size = (bit_size + 7) >> 3;
114
115
4.70M
    bc->buffer       = buffer;
116
4.70M
    bc->buffer_end   = buffer + buffer_size;
117
4.70M
    bc->ptr          = bc->buffer;
118
4.70M
    bc->size_in_bits = bit_size;
119
4.70M
    bc->bits_valid   = 0;
120
4.70M
    bc->bits         = 0;
121
122
4.70M
    BS_FUNC(priv_refill_64)(bc);
123
124
4.70M
    return 0;
125
4.70M
}
tak_parser.c:bits_init_le
Line
Count
Source
103
3.07M
{
104
3.07M
    unsigned int buffer_size;
105
106
3.07M
    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.07M
    buffer_size = (bit_size + 7) >> 3;
114
115
3.07M
    bc->buffer       = buffer;
116
3.07M
    bc->buffer_end   = buffer + buffer_size;
117
3.07M
    bc->ptr          = bc->buffer;
118
3.07M
    bc->size_in_bits = bit_size;
119
3.07M
    bc->bits_valid   = 0;
120
3.07M
    bc->bits         = 0;
121
122
3.07M
    BS_FUNC(priv_refill_64)(bc);
123
124
3.07M
    return 0;
125
3.07M
}
tak.c:bits_init_le
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
102k
{
104
102k
    unsigned int buffer_size;
105
106
102k
    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
102k
    buffer_size = (bit_size + 7) >> 3;
114
115
102k
    bc->buffer       = buffer;
116
102k
    bc->buffer_end   = buffer + buffer_size;
117
102k
    bc->ptr          = bc->buffer;
118
102k
    bc->size_in_bits = bit_size;
119
102k
    bc->bits_valid   = 0;
120
102k
    bc->bits         = 0;
121
122
102k
    BS_FUNC(priv_refill_64)(bc);
123
124
102k
    return 0;
125
102k
}
Unexecuted instantiation: sheervideo.c:bits_init_le
utvideodec.c:bits_init_le
Line
Count
Source
103
10.8k
{
104
10.8k
    unsigned int buffer_size;
105
106
10.8k
    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
10.8k
    buffer_size = (bit_size + 7) >> 3;
114
115
10.8k
    bc->buffer       = buffer;
116
10.8k
    bc->buffer_end   = buffer + buffer_size;
117
10.8k
    bc->ptr          = bc->buffer;
118
10.8k
    bc->size_in_bits = bit_size;
119
10.8k
    bc->bits_valid   = 0;
120
10.8k
    bc->bits         = 0;
121
122
10.8k
    BS_FUNC(priv_refill_64)(bc);
123
124
10.8k
    return 0;
125
10.8k
}
utvideodec.c:bits_init_be
Line
Count
Source
103
9.68k
{
104
9.68k
    unsigned int buffer_size;
105
106
9.68k
    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.68k
    buffer_size = (bit_size + 7) >> 3;
114
115
9.68k
    bc->buffer       = buffer;
116
9.68k
    bc->buffer_end   = buffer + buffer_size;
117
9.68k
    bc->ptr          = bc->buffer;
118
9.68k
    bc->size_in_bits = bit_size;
119
9.68k
    bc->bits_valid   = 0;
120
9.68k
    bc->bits         = 0;
121
122
9.68k
    BS_FUNC(priv_refill_64)(bc);
123
124
9.68k
    return 0;
125
9.68k
}
vmixdec.c:bits_init_be
Line
Count
Source
103
207k
{
104
207k
    unsigned int buffer_size;
105
106
207k
    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
207k
    buffer_size = (bit_size + 7) >> 3;
114
115
207k
    bc->buffer       = buffer;
116
207k
    bc->buffer_end   = buffer + buffer_size;
117
207k
    bc->ptr          = bc->buffer;
118
207k
    bc->size_in_bits = bit_size;
119
207k
    bc->bits_valid   = 0;
120
207k
    bc->bits         = 0;
121
122
207k
    BS_FUNC(priv_refill_64)(bc);
123
124
207k
    return 0;
125
207k
}
Unexecuted instantiation: vmixdec.c:bits_init_le
magicyuv.c:bits_init_be
Line
Count
Source
103
97.7k
{
104
97.7k
    unsigned int buffer_size;
105
106
97.7k
    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
97.7k
    buffer_size = (bit_size + 7) >> 3;
114
115
97.7k
    bc->buffer       = buffer;
116
97.7k
    bc->buffer_end   = buffer + buffer_size;
117
97.7k
    bc->ptr          = bc->buffer;
118
97.7k
    bc->size_in_bits = bit_size;
119
97.7k
    bc->bits_valid   = 0;
120
97.7k
    bc->bits         = 0;
121
122
97.7k
    BS_FUNC(priv_refill_64)(bc);
123
124
97.7k
    return 0;
125
97.7k
}
Unexecuted instantiation: magicyuv.c:bits_init_le
prores_raw.c:bits_init_be
Line
Count
Source
103
443k
{
104
443k
    unsigned int buffer_size;
105
106
443k
    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
443k
    buffer_size = (bit_size + 7) >> 3;
114
115
443k
    bc->buffer       = buffer;
116
443k
    bc->buffer_end   = buffer + buffer_size;
117
443k
    bc->ptr          = bc->buffer;
118
443k
    bc->size_in_bits = bit_size;
119
443k
    bc->bits_valid   = 0;
120
443k
    bc->bits         = 0;
121
122
443k
    BS_FUNC(priv_refill_64)(bc);
123
124
443k
    return 0;
125
443k
}
Unexecuted instantiation: prores_raw.c:bits_init_le
takdec.c:bits_init_le
Line
Count
Source
103
642k
{
104
642k
    unsigned int buffer_size;
105
106
642k
    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
642k
    buffer_size = (bit_size + 7) >> 3;
114
115
642k
    bc->buffer       = buffer;
116
642k
    bc->buffer_end   = buffer + buffer_size;
117
642k
    bc->ptr          = bc->buffer;
118
642k
    bc->size_in_bits = bit_size;
119
642k
    bc->bits_valid   = 0;
120
642k
    bc->bits         = 0;
121
122
642k
    BS_FUNC(priv_refill_64)(bc);
123
124
642k
    return 0;
125
642k
}
photocd.c:bits_init_be
Line
Count
Source
103
402
{
104
402
    unsigned int buffer_size;
105
106
402
    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
402
    buffer_size = (bit_size + 7) >> 3;
114
115
402
    bc->buffer       = buffer;
116
402
    bc->buffer_end   = buffer + buffer_size;
117
402
    bc->ptr          = bc->buffer;
118
402
    bc->size_in_bits = bit_size;
119
402
    bc->bits_valid   = 0;
120
402
    bc->bits         = 0;
121
122
402
    BS_FUNC(priv_refill_64)(bc);
123
124
402
    return 0;
125
402
}
Unexecuted instantiation: photocd.c:bits_init_le
proresdec.c:bits_init_be
Line
Count
Source
103
73.5k
{
104
73.5k
    unsigned int buffer_size;
105
106
73.5k
    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
73.5k
    buffer_size = (bit_size + 7) >> 3;
114
115
73.5k
    bc->buffer       = buffer;
116
73.5k
    bc->buffer_end   = buffer + buffer_size;
117
73.5k
    bc->ptr          = bc->buffer;
118
73.5k
    bc->size_in_bits = bit_size;
119
73.5k
    bc->bits_valid   = 0;
120
73.5k
    bc->bits         = 0;
121
122
73.5k
    BS_FUNC(priv_refill_64)(bc);
123
124
73.5k
    return 0;
125
73.5k
}
Unexecuted instantiation: proresdec.c:bits_init_le
Unexecuted instantiation: rw2dec.c:bits_init_le
mvha.c:bits_init_be
Line
Count
Source
103
38.4k
{
104
38.4k
    unsigned int buffer_size;
105
106
38.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
38.4k
    buffer_size = (bit_size + 7) >> 3;
114
115
38.4k
    bc->buffer       = buffer;
116
38.4k
    bc->buffer_end   = buffer + buffer_size;
117
38.4k
    bc->ptr          = bc->buffer;
118
38.4k
    bc->size_in_bits = bit_size;
119
38.4k
    bc->bits_valid   = 0;
120
38.4k
    bc->bits         = 0;
121
122
38.4k
    BS_FUNC(priv_refill_64)(bc);
123
124
38.4k
    return 0;
125
38.4k
}
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
4.61M
{
138
4.61M
    if (byte_size > INT_MAX / 8)
139
0
        return AVERROR_INVALIDDATA;
140
4.61M
    return BS_FUNC(init)(bc, buffer, byte_size * 8);
141
4.61M
}
tak_parser.c:bits_init8_le
Line
Count
Source
137
3.07M
{
138
3.07M
    if (byte_size > INT_MAX / 8)
139
0
        return AVERROR_INVALIDDATA;
140
3.07M
    return BS_FUNC(init)(bc, buffer, byte_size * 8);
141
3.07M
}
tak.c:bits_init8_le
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
102k
{
138
102k
    if (byte_size > INT_MAX / 8)
139
0
        return AVERROR_INVALIDDATA;
140
102k
    return BS_FUNC(init)(bc, buffer, byte_size * 8);
141
102k
}
Unexecuted instantiation: sheervideo.c:bits_init8_le
utvideodec.c:bits_init8_le
Line
Count
Source
137
10.8k
{
138
10.8k
    if (byte_size > INT_MAX / 8)
139
0
        return AVERROR_INVALIDDATA;
140
10.8k
    return BS_FUNC(init)(bc, buffer, byte_size * 8);
141
10.8k
}
Unexecuted instantiation: utvideodec.c:bits_init8_be
vmixdec.c:bits_init8_be
Line
Count
Source
137
207k
{
138
207k
    if (byte_size > INT_MAX / 8)
139
0
        return AVERROR_INVALIDDATA;
140
207k
    return BS_FUNC(init)(bc, buffer, byte_size * 8);
141
207k
}
Unexecuted instantiation: vmixdec.c:bits_init8_le
magicyuv.c:bits_init8_be
Line
Count
Source
137
97.7k
{
138
97.7k
    if (byte_size > INT_MAX / 8)
139
0
        return AVERROR_INVALIDDATA;
140
97.7k
    return BS_FUNC(init)(bc, buffer, byte_size * 8);
141
97.7k
}
Unexecuted instantiation: magicyuv.c:bits_init8_le
prores_raw.c:bits_init8_be
Line
Count
Source
137
443k
{
138
443k
    if (byte_size > INT_MAX / 8)
139
0
        return AVERROR_INVALIDDATA;
140
443k
    return BS_FUNC(init)(bc, buffer, byte_size * 8);
141
443k
}
Unexecuted instantiation: prores_raw.c:bits_init8_le
takdec.c:bits_init8_le
Line
Count
Source
137
642k
{
138
642k
    if (byte_size > INT_MAX / 8)
139
0
        return AVERROR_INVALIDDATA;
140
642k
    return BS_FUNC(init)(bc, buffer, byte_size * 8);
141
642k
}
photocd.c:bits_init8_be
Line
Count
Source
137
402
{
138
402
    if (byte_size > INT_MAX / 8)
139
0
        return AVERROR_INVALIDDATA;
140
402
    return BS_FUNC(init)(bc, buffer, byte_size * 8);
141
402
}
Unexecuted instantiation: photocd.c:bits_init8_le
Unexecuted instantiation: proresdec.c:bits_init8_le
Unexecuted instantiation: proresdec.c:bits_init8_be
Unexecuted instantiation: rw2dec.c:bits_init8_le
mvha.c:bits_init8_be
Line
Count
Source
137
38.4k
{
138
38.4k
    if (byte_size > INT_MAX / 8)
139
0
        return AVERROR_INVALIDDATA;
140
38.4k
    return BS_FUNC(init)(bc, buffer, byte_size * 8);
141
38.4k
}
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
5.18M
{
148
5.18M
    return (bc->ptr - bc->buffer) * 8 - bc->bits_valid;
149
5.18M
}
tak_parser.c:bits_tell_le
Line
Count
Source
147
3.04M
{
148
3.04M
    return (bc->ptr - bc->buffer) * 8 - bc->bits_valid;
149
3.04M
}
tak.c:bits_tell_le
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
vmixdec.c:bits_tell_be
Line
Count
Source
147
40.3k
{
148
40.3k
    return (bc->ptr - bc->buffer) * 8 - bc->bits_valid;
149
40.3k
}
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
takdec.c:bits_tell_le
Line
Count
Source
147
1.94M
{
148
1.94M
    return (bc->ptr - bc->buffer) * 8 - bc->bits_valid;
149
1.94M
}
photocd.c:bits_tell_be
Line
Count
Source
147
67
{
148
67
    return (bc->ptr - bc->buffer) * 8 - bc->bits_valid;
149
67
}
Unexecuted instantiation: photocd.c:bits_tell_le
Unexecuted instantiation: proresdec.c:bits_tell_le
Unexecuted instantiation: proresdec.c:bits_tell_be
Unexecuted instantiation: rw2dec.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: proresdec.c:bits_size_le
Unexecuted instantiation: proresdec.c:bits_size_be
Unexecuted instantiation: rw2dec.c:bits_size_le
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: proresdec.c:bits_bytesize_le
Unexecuted instantiation: proresdec.c:bits_bytesize_be
Unexecuted instantiation: rw2dec.c:bits_bytesize_le
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
240M
{
172
240M
    return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid;
173
240M
}
Unexecuted instantiation: tak_parser.c:bits_left_le
tak.c:bits_left_le
Line
Count
Source
171
3.68M
{
172
3.68M
    return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid;
173
3.68M
}
Unexecuted instantiation: sheervideo.c:bits_left_le
Unexecuted instantiation: sheervideo.c:bits_left_be
utvideodec.c:bits_left_be
Line
Count
Source
171
5.85M
{
172
5.85M
    return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid;
173
5.85M
}
Unexecuted instantiation: utvideodec.c:bits_left_le
vmixdec.c:bits_left_be
Line
Count
Source
171
880k
{
172
880k
    return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid;
173
880k
}
Unexecuted instantiation: vmixdec.c:bits_left_le
magicyuv.c:bits_left_be
Line
Count
Source
171
219M
{
172
219M
    return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid;
173
219M
}
Unexecuted instantiation: magicyuv.c:bits_left_le
prores_raw.c:bits_left_be
Line
Count
Source
171
1.38M
{
172
1.38M
    return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid;
173
1.38M
}
Unexecuted instantiation: prores_raw.c:bits_left_le
takdec.c:bits_left_le
Line
Count
Source
171
600k
{
172
600k
    return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid;
173
600k
}
photocd.c:bits_left_be
Line
Count
Source
171
4.40M
{
172
4.40M
    return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid;
173
4.40M
}
Unexecuted instantiation: photocd.c:bits_left_le
proresdec.c:bits_left_be
Line
Count
Source
171
2.66M
{
172
2.66M
    return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid;
173
2.66M
}
Unexecuted instantiation: proresdec.c:bits_left_le
Unexecuted instantiation: rw2dec.c:bits_left_le
mvha.c:bits_left_be
Line
Count
Source
171
582k
{
172
582k
    return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid;
173
582k
}
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.75G
{
177
3.75G
    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.75G
}
Unexecuted instantiation: tak_parser.c:bits_priv_val_show_le
tak.c:bits_priv_val_show_le
Line
Count
Source
176
12.2M
{
177
12.2M
    av_assert2(n > 0 && n <= 64);
178
179
12.2M
#ifdef BITSTREAM_TEMPLATE_LE
180
12.2M
    return bc->bits & (UINT64_MAX >> (64 - n));
181
#else
182
    return bc->bits >> (64 - n);
183
#endif
184
12.2M
}
sheervideo.c:bits_priv_val_show_be
Line
Count
Source
176
3.57G
{
177
3.57G
    av_assert2(n > 0 && n <= 64);
178
179
#ifdef BITSTREAM_TEMPLATE_LE
180
    return bc->bits & (UINT64_MAX >> (64 - n));
181
#else
182
3.57G
    return bc->bits >> (64 - n);
183
3.57G
#endif
184
3.57G
}
Unexecuted instantiation: sheervideo.c:bits_priv_val_show_le
utvideodec.c:bits_priv_val_show_le
Line
Count
Source
176
35.8k
{
177
35.8k
    av_assert2(n > 0 && n <= 64);
178
179
35.8k
#ifdef BITSTREAM_TEMPLATE_LE
180
35.8k
    return bc->bits & (UINT64_MAX >> (64 - n));
181
#else
182
    return bc->bits >> (64 - n);
183
#endif
184
35.8k
}
utvideodec.c:bits_priv_val_show_be
Line
Count
Source
176
4.26M
{
177
4.26M
    av_assert2(n > 0 && n <= 64);
178
179
#ifdef BITSTREAM_TEMPLATE_LE
180
    return bc->bits & (UINT64_MAX >> (64 - n));
181
#else
182
4.26M
    return bc->bits >> (64 - n);
183
4.26M
#endif
184
4.26M
}
vmixdec.c:bits_priv_val_show_be
Line
Count
Source
176
2.27M
{
177
2.27M
    av_assert2(n > 0 && n <= 64);
178
179
#ifdef BITSTREAM_TEMPLATE_LE
180
    return bc->bits & (UINT64_MAX >> (64 - n));
181
#else
182
2.27M
    return bc->bits >> (64 - n);
183
2.27M
#endif
184
2.27M
}
Unexecuted instantiation: vmixdec.c:bits_priv_val_show_le
magicyuv.c:bits_priv_val_show_be
Line
Count
Source
176
95.8M
{
177
95.8M
    av_assert2(n > 0 && n <= 64);
178
179
#ifdef BITSTREAM_TEMPLATE_LE
180
    return bc->bits & (UINT64_MAX >> (64 - n));
181
#else
182
95.8M
    return bc->bits >> (64 - n);
183
95.8M
#endif
184
95.8M
}
Unexecuted instantiation: magicyuv.c:bits_priv_val_show_le
prores_raw.c:bits_priv_val_show_be
Line
Count
Source
176
1.81M
{
177
1.81M
    av_assert2(n > 0 && n <= 64);
178
179
#ifdef BITSTREAM_TEMPLATE_LE
180
    return bc->bits & (UINT64_MAX >> (64 - n));
181
#else
182
1.81M
    return bc->bits >> (64 - n);
183
1.81M
#endif
184
1.81M
}
Unexecuted instantiation: prores_raw.c:bits_priv_val_show_le
takdec.c:bits_priv_val_show_le
Line
Count
Source
176
45.1M
{
177
45.1M
    av_assert2(n > 0 && n <= 64);
178
179
45.1M
#ifdef BITSTREAM_TEMPLATE_LE
180
45.1M
    return bc->bits & (UINT64_MAX >> (64 - n));
181
#else
182
    return bc->bits >> (64 - n);
183
#endif
184
45.1M
}
photocd.c:bits_priv_val_show_be
Line
Count
Source
176
4.41M
{
177
4.41M
    av_assert2(n > 0 && n <= 64);
178
179
#ifdef BITSTREAM_TEMPLATE_LE
180
    return bc->bits & (UINT64_MAX >> (64 - n));
181
#else
182
4.41M
    return bc->bits >> (64 - n);
183
4.41M
#endif
184
4.41M
}
Unexecuted instantiation: photocd.c:bits_priv_val_show_le
proresdec.c:bits_priv_val_show_be
Line
Count
Source
176
8.50M
{
177
8.50M
    av_assert2(n > 0 && n <= 64);
178
179
#ifdef BITSTREAM_TEMPLATE_LE
180
    return bc->bits & (UINT64_MAX >> (64 - n));
181
#else
182
8.50M
    return bc->bits >> (64 - n);
183
8.50M
#endif
184
8.50M
}
Unexecuted instantiation: proresdec.c:bits_priv_val_show_le
Unexecuted instantiation: rw2dec.c:bits_priv_val_show_le
mvha.c:bits_priv_val_show_be
Line
Count
Source
176
1.84M
{
177
1.84M
    av_assert2(n > 0 && n <= 64);
178
179
#ifdef BITSTREAM_TEMPLATE_LE
180
    return bc->bits & (UINT64_MAX >> (64 - n));
181
#else
182
1.84M
    return bc->bits >> (64 - n);
183
1.84M
#endif
184
1.84M
}
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.75G
{
188
#ifdef BITSTREAM_TEMPLATE_LE
189
    bc->bits >>= n;
190
#else
191
    bc->bits <<= n;
192
#endif
193
3.75G
    bc->bits_valid -= n;
194
3.75G
}
Unexecuted instantiation: tak_parser.c:bits_priv_skip_remaining_le
tak.c:bits_priv_skip_remaining_le
Line
Count
Source
187
12.5M
{
188
12.5M
#ifdef BITSTREAM_TEMPLATE_LE
189
12.5M
    bc->bits >>= n;
190
#else
191
    bc->bits <<= n;
192
#endif
193
12.5M
    bc->bits_valid -= n;
194
12.5M
}
sheervideo.c:bits_priv_skip_remaining_be
Line
Count
Source
187
3.57G
{
188
#ifdef BITSTREAM_TEMPLATE_LE
189
    bc->bits >>= n;
190
#else
191
3.57G
    bc->bits <<= n;
192
3.57G
#endif
193
3.57G
    bc->bits_valid -= n;
194
3.57G
}
Unexecuted instantiation: sheervideo.c:bits_priv_skip_remaining_le
utvideodec.c:bits_priv_skip_remaining_le
Line
Count
Source
187
35.8k
{
188
35.8k
#ifdef BITSTREAM_TEMPLATE_LE
189
35.8k
    bc->bits >>= n;
190
#else
191
    bc->bits <<= n;
192
#endif
193
35.8k
    bc->bits_valid -= n;
194
35.8k
}
utvideodec.c:bits_priv_skip_remaining_be
Line
Count
Source
187
4.26M
{
188
#ifdef BITSTREAM_TEMPLATE_LE
189
    bc->bits >>= n;
190
#else
191
4.26M
    bc->bits <<= n;
192
4.26M
#endif
193
4.26M
    bc->bits_valid -= n;
194
4.26M
}
vmixdec.c:bits_priv_skip_remaining_be
Line
Count
Source
187
2.28M
{
188
#ifdef BITSTREAM_TEMPLATE_LE
189
    bc->bits >>= n;
190
#else
191
2.28M
    bc->bits <<= n;
192
2.28M
#endif
193
2.28M
    bc->bits_valid -= n;
194
2.28M
}
Unexecuted instantiation: vmixdec.c:bits_priv_skip_remaining_le
magicyuv.c:bits_priv_skip_remaining_be
Line
Count
Source
187
95.8M
{
188
#ifdef BITSTREAM_TEMPLATE_LE
189
    bc->bits >>= n;
190
#else
191
95.8M
    bc->bits <<= n;
192
95.8M
#endif
193
95.8M
    bc->bits_valid -= n;
194
95.8M
}
Unexecuted instantiation: magicyuv.c:bits_priv_skip_remaining_le
prores_raw.c:bits_priv_skip_remaining_be
Line
Count
Source
187
1.36M
{
188
#ifdef BITSTREAM_TEMPLATE_LE
189
    bc->bits >>= n;
190
#else
191
1.36M
    bc->bits <<= n;
192
1.36M
#endif
193
1.36M
    bc->bits_valid -= n;
194
1.36M
}
Unexecuted instantiation: prores_raw.c:bits_priv_skip_remaining_le
takdec.c:bits_priv_skip_remaining_le
Line
Count
Source
187
45.7M
{
188
45.7M
#ifdef BITSTREAM_TEMPLATE_LE
189
45.7M
    bc->bits >>= n;
190
#else
191
    bc->bits <<= n;
192
#endif
193
45.7M
    bc->bits_valid -= n;
194
45.7M
}
photocd.c:bits_priv_skip_remaining_be
Line
Count
Source
187
4.41M
{
188
#ifdef BITSTREAM_TEMPLATE_LE
189
    bc->bits >>= n;
190
#else
191
4.41M
    bc->bits <<= n;
192
4.41M
#endif
193
4.41M
    bc->bits_valid -= n;
194
4.41M
}
Unexecuted instantiation: photocd.c:bits_priv_skip_remaining_le
proresdec.c:bits_priv_skip_remaining_be
Line
Count
Source
187
8.30M
{
188
#ifdef BITSTREAM_TEMPLATE_LE
189
    bc->bits >>= n;
190
#else
191
8.30M
    bc->bits <<= n;
192
8.30M
#endif
193
8.30M
    bc->bits_valid -= n;
194
8.30M
}
Unexecuted instantiation: proresdec.c:bits_priv_skip_remaining_le
Unexecuted instantiation: rw2dec.c:bits_priv_skip_remaining_le
mvha.c:bits_priv_skip_remaining_be
Line
Count
Source
187
1.88M
{
188
#ifdef BITSTREAM_TEMPLATE_LE
189
    bc->bits >>= n;
190
#else
191
1.88M
    bc->bits <<= n;
192
1.88M
#endif
193
1.88M
    bc->bits_valid -= n;
194
1.88M
}
Unexecuted instantiation: mvha.c:bits_priv_skip_remaining_le
195
196
static inline uint64_t BS_FUNC(priv_val_get)(BSCTX *bc, unsigned int n)
197
267M
{
198
267M
    uint64_t ret;
199
200
267M
    av_assert2(n > 0 && n < 64);
201
202
267M
    ret = BS_FUNC(priv_val_show)(bc, n);
203
267M
    BS_FUNC(priv_skip_remaining)(bc, n);
204
205
267M
    return ret;
206
267M
}
Unexecuted instantiation: tak_parser.c:bits_priv_val_get_le
tak.c:bits_priv_val_get_le
Line
Count
Source
197
12.2M
{
198
12.2M
    uint64_t ret;
199
200
12.2M
    av_assert2(n > 0 && n < 64);
201
202
12.2M
    ret = BS_FUNC(priv_val_show)(bc, n);
203
12.2M
    BS_FUNC(priv_skip_remaining)(bc, n);
204
205
12.2M
    return ret;
206
12.2M
}
sheervideo.c:bits_priv_val_get_be
Line
Count
Source
197
201M
{
198
201M
    uint64_t ret;
199
200
201M
    av_assert2(n > 0 && n < 64);
201
202
201M
    ret = BS_FUNC(priv_val_show)(bc, n);
203
201M
    BS_FUNC(priv_skip_remaining)(bc, n);
204
205
201M
    return ret;
206
201M
}
Unexecuted instantiation: sheervideo.c:bits_priv_val_get_le
utvideodec.c:bits_priv_val_get_le
Line
Count
Source
197
35.8k
{
198
35.8k
    uint64_t ret;
199
200
35.8k
    av_assert2(n > 0 && n < 64);
201
202
35.8k
    ret = BS_FUNC(priv_val_show)(bc, n);
203
35.8k
    BS_FUNC(priv_skip_remaining)(bc, n);
204
205
35.8k
    return ret;
206
35.8k
}
Unexecuted instantiation: utvideodec.c:bits_priv_val_get_be
vmixdec.c:bits_priv_val_get_be
Line
Count
Source
197
1.13M
{
198
1.13M
    uint64_t ret;
199
200
1.13M
    av_assert2(n > 0 && n < 64);
201
202
1.13M
    ret = BS_FUNC(priv_val_show)(bc, n);
203
1.13M
    BS_FUNC(priv_skip_remaining)(bc, n);
204
205
1.13M
    return ret;
206
1.13M
}
Unexecuted instantiation: vmixdec.c:bits_priv_val_get_le
magicyuv.c:bits_priv_val_get_be
Line
Count
Source
197
186k
{
198
186k
    uint64_t ret;
199
200
186k
    av_assert2(n > 0 && n < 64);
201
202
186k
    ret = BS_FUNC(priv_val_show)(bc, n);
203
186k
    BS_FUNC(priv_skip_remaining)(bc, n);
204
205
186k
    return ret;
206
186k
}
Unexecuted instantiation: magicyuv.c:bits_priv_val_get_le
prores_raw.c:bits_priv_val_get_be
Line
Count
Source
197
434k
{
198
434k
    uint64_t ret;
199
200
434k
    av_assert2(n > 0 && n < 64);
201
202
434k
    ret = BS_FUNC(priv_val_show)(bc, n);
203
434k
    BS_FUNC(priv_skip_remaining)(bc, n);
204
205
434k
    return ret;
206
434k
}
Unexecuted instantiation: prores_raw.c:bits_priv_val_get_le
takdec.c:bits_priv_val_get_le
Line
Count
Source
197
45.1M
{
198
45.1M
    uint64_t ret;
199
200
45.1M
    av_assert2(n > 0 && n < 64);
201
202
45.1M
    ret = BS_FUNC(priv_val_show)(bc, n);
203
45.1M
    BS_FUNC(priv_skip_remaining)(bc, n);
204
205
45.1M
    return ret;
206
45.1M
}
photocd.c:bits_priv_val_get_be
Line
Count
Source
197
3.63k
{
198
3.63k
    uint64_t ret;
199
200
3.63k
    av_assert2(n > 0 && n < 64);
201
202
3.63k
    ret = BS_FUNC(priv_val_show)(bc, n);
203
3.63k
    BS_FUNC(priv_skip_remaining)(bc, n);
204
205
3.63k
    return ret;
206
3.63k
}
Unexecuted instantiation: photocd.c:bits_priv_val_get_le
proresdec.c:bits_priv_val_get_be
Line
Count
Source
197
5.86M
{
198
5.86M
    uint64_t ret;
199
200
5.86M
    av_assert2(n > 0 && n < 64);
201
202
5.86M
    ret = BS_FUNC(priv_val_show)(bc, n);
203
5.86M
    BS_FUNC(priv_skip_remaining)(bc, n);
204
205
5.86M
    return ret;
206
5.86M
}
Unexecuted instantiation: proresdec.c:bits_priv_val_get_le
Unexecuted instantiation: rw2dec.c:bits_priv_val_get_le
mvha.c:bits_priv_val_get_be
Line
Count
Source
197
598k
{
198
598k
    uint64_t ret;
199
200
598k
    av_assert2(n > 0 && n < 64);
201
202
598k
    ret = BS_FUNC(priv_val_show)(bc, n);
203
598k
    BS_FUNC(priv_skip_remaining)(bc, n);
204
205
598k
    return ret;
206
598k
}
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
97.8M
{
213
97.8M
    if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0)
214
2.74M
        return 0;
215
216
95.1M
    return BS_FUNC(priv_val_get)(bc, 1);
217
97.8M
}
Unexecuted instantiation: tak_parser.c:bits_read_bit_le
tak.c:bits_read_bit_le
Line
Count
Source
212
119k
{
213
119k
    if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0)
214
1.31k
        return 0;
215
216
117k
    return BS_FUNC(priv_val_get)(bc, 1);
217
119k
}
sheervideo.c:bits_read_bit_be
Line
Count
Source
212
89.0M
{
213
89.0M
    if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0)
214
14.2k
        return 0;
215
216
89.0M
    return BS_FUNC(priv_val_get)(bc, 1);
217
89.0M
}
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
436k
{
213
436k
    if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0)
214
1.90k
        return 0;
215
216
434k
    return BS_FUNC(priv_val_get)(bc, 1);
217
436k
}
Unexecuted instantiation: prores_raw.c:bits_read_bit_le
takdec.c:bits_read_bit_le
Line
Count
Source
212
5.30M
{
213
5.30M
    if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0)
214
1.23M
        return 0;
215
216
4.06M
    return BS_FUNC(priv_val_get)(bc, 1);
217
5.30M
}
Unexecuted instantiation: photocd.c:bits_read_bit_le
Unexecuted instantiation: photocd.c:bits_read_bit_be
proresdec.c:bits_read_bit_be
Line
Count
Source
212
2.72M
{
213
2.72M
    if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0)
214
1.48M
        return 0;
215
216
1.23M
    return BS_FUNC(priv_val_get)(bc, 1);
217
2.72M
}
Unexecuted instantiation: proresdec.c:bits_read_bit_le
Unexecuted instantiation: rw2dec.c:bits_read_bit_le
mvha.c:bits_read_bit_be
Line
Count
Source
212
260k
{
213
260k
    if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0)
214
0
        return 0;
215
216
260k
    return BS_FUNC(priv_val_get)(bc, 1);
217
260k
}
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
172M
{
226
172M
    av_assert2(n > 0 && n <= 32);
227
228
172M
    if (n > bc->bits_valid) {
229
134M
        if (BS_FUNC(priv_refill_32)(bc) < 0)
230
126M
            bc->bits_valid = n;
231
134M
    }
232
233
172M
    return BS_FUNC(priv_val_get)(bc, n);
234
172M
}
Unexecuted instantiation: tak_parser.c:bits_read_nz_le
tak.c:bits_read_nz_le
Line
Count
Source
225
11.9M
{
226
11.9M
    av_assert2(n > 0 && n <= 32);
227
228
11.9M
    if (n > bc->bits_valid) {
229
60.1k
        if (BS_FUNC(priv_refill_32)(bc) < 0)
230
8.46k
            bc->bits_valid = n;
231
60.1k
    }
232
233
11.9M
    return BS_FUNC(priv_val_get)(bc, n);
234
11.9M
}
sheervideo.c:bits_read_nz_be
Line
Count
Source
225
112M
{
226
112M
    av_assert2(n > 0 && n <= 32);
227
228
112M
    if (n > bc->bits_valid) {
229
94.2M
        if (BS_FUNC(priv_refill_32)(bc) < 0)
230
87.3M
            bc->bits_valid = n;
231
94.2M
    }
232
233
112M
    return BS_FUNC(priv_val_get)(bc, n);
234
112M
}
Unexecuted instantiation: sheervideo.c:bits_read_nz_le
utvideodec.c:bits_read_nz_le
Line
Count
Source
225
35.8k
{
226
35.8k
    av_assert2(n > 0 && n <= 32);
227
228
35.8k
    if (n > bc->bits_valid) {
229
2.35k
        if (BS_FUNC(priv_refill_32)(bc) < 0)
230
0
            bc->bits_valid = n;
231
2.35k
    }
232
233
35.8k
    return BS_FUNC(priv_val_get)(bc, n);
234
35.8k
}
Unexecuted instantiation: utvideodec.c:bits_read_nz_be
vmixdec.c:bits_read_nz_be
Line
Count
Source
225
1.13M
{
226
1.13M
    av_assert2(n > 0 && n <= 32);
227
228
1.13M
    if (n > bc->bits_valid) {
229
24.4k
        if (BS_FUNC(priv_refill_32)(bc) < 0)
230
3.59k
            bc->bits_valid = n;
231
24.4k
    }
232
233
1.13M
    return BS_FUNC(priv_val_get)(bc, n);
234
1.13M
}
Unexecuted instantiation: vmixdec.c:bits_read_nz_le
magicyuv.c:bits_read_nz_be
Line
Count
Source
225
186k
{
226
186k
    av_assert2(n > 0 && n <= 32);
227
228
186k
    if (n > bc->bits_valid) {
229
52.2k
        if (BS_FUNC(priv_refill_32)(bc) < 0)
230
0
            bc->bits_valid = n;
231
52.2k
    }
232
233
186k
    return BS_FUNC(priv_val_get)(bc, n);
234
186k
}
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
takdec.c:bits_read_nz_le
Line
Count
Source
225
41.1M
{
226
41.1M
    av_assert2(n > 0 && n <= 32);
227
228
41.1M
    if (n > bc->bits_valid) {
229
35.4M
        if (BS_FUNC(priv_refill_32)(bc) < 0)
230
35.1M
            bc->bits_valid = n;
231
35.4M
    }
232
233
41.1M
    return BS_FUNC(priv_val_get)(bc, n);
234
41.1M
}
photocd.c:bits_read_nz_be
Line
Count
Source
225
3.63k
{
226
3.63k
    av_assert2(n > 0 && n <= 32);
227
228
3.63k
    if (n > bc->bits_valid) {
229
1
        if (BS_FUNC(priv_refill_32)(bc) < 0)
230
1
            bc->bits_valid = n;
231
1
    }
232
233
3.63k
    return BS_FUNC(priv_val_get)(bc, n);
234
3.63k
}
Unexecuted instantiation: photocd.c:bits_read_nz_le
proresdec.c:bits_read_nz_be
Line
Count
Source
225
4.62M
{
226
4.62M
    av_assert2(n > 0 && n <= 32);
227
228
4.62M
    if (n > bc->bits_valid) {
229
4.48M
        if (BS_FUNC(priv_refill_32)(bc) < 0)
230
4.46M
            bc->bits_valid = n;
231
4.48M
    }
232
233
4.62M
    return BS_FUNC(priv_val_get)(bc, n);
234
4.62M
}
Unexecuted instantiation: proresdec.c:bits_read_nz_le
Unexecuted instantiation: rw2dec.c:bits_read_nz_le
mvha.c:bits_read_nz_be
Line
Count
Source
225
337k
{
226
337k
    av_assert2(n > 0 && n <= 32);
227
228
337k
    if (n > bc->bits_valid) {
229
26.3k
        if (BS_FUNC(priv_refill_32)(bc) < 0)
230
338
            bc->bits_valid = n;
231
26.3k
    }
232
233
337k
    return BS_FUNC(priv_val_get)(bc, n);
234
337k
}
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
36.3M
{
241
36.3M
    av_assert2(n <= 32);
242
243
36.3M
    if (!n)
244
0
        return 0;
245
246
36.3M
    return BS_FUNC(read_nz)(bc, n);
247
36.3M
}
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
35.8k
{
241
35.8k
    av_assert2(n <= 32);
242
243
35.8k
    if (!n)
244
0
        return 0;
245
246
35.8k
    return BS_FUNC(read_nz)(bc, n);
247
35.8k
}
Unexecuted instantiation: utvideodec.c:bits_read_be
vmixdec.c:bits_read_be
Line
Count
Source
240
1.13M
{
241
1.13M
    av_assert2(n <= 32);
242
243
1.13M
    if (!n)
244
0
        return 0;
245
246
1.13M
    return BS_FUNC(read_nz)(bc, n);
247
1.13M
}
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
takdec.c:bits_read_le
Line
Count
Source
240
35.1M
{
241
35.1M
    av_assert2(n <= 32);
242
243
35.1M
    if (!n)
244
0
        return 0;
245
246
35.1M
    return BS_FUNC(read_nz)(bc, n);
247
35.1M
}
Unexecuted instantiation: photocd.c:bits_read_le
Unexecuted instantiation: photocd.c:bits_read_be
Unexecuted instantiation: proresdec.c:bits_read_le
Unexecuted instantiation: proresdec.c:bits_read_be
Unexecuted instantiation: rw2dec.c:bits_read_le
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
98.4k
{
254
98.4k
    uint64_t ret = 0;
255
98.4k
    unsigned left = 0;
256
257
98.4k
    av_assert2(n <= 63);
258
259
98.4k
    if (!n)
260
0
        return 0;
261
262
98.4k
    if (n > bc->bits_valid) {
263
78.2k
        left = bc->bits_valid;
264
78.2k
        n   -= left;
265
266
78.2k
        if (left)
267
78.2k
            ret = BS_FUNC(priv_val_get)(bc, left);
268
269
78.2k
        if (BS_FUNC(priv_refill_64)(bc) < 0)
270
388
            bc->bits_valid = n;
271
272
78.2k
    }
273
274
98.4k
#ifdef BITSTREAM_TEMPLATE_LE
275
98.4k
    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
98.4k
    return ret;
281
98.4k
}
Unexecuted instantiation: tak_parser.c:bits_read_63_le
tak.c:bits_read_63_le
Line
Count
Source
253
98.4k
{
254
98.4k
    uint64_t ret = 0;
255
98.4k
    unsigned left = 0;
256
257
98.4k
    av_assert2(n <= 63);
258
259
98.4k
    if (!n)
260
0
        return 0;
261
262
98.4k
    if (n > bc->bits_valid) {
263
78.2k
        left = bc->bits_valid;
264
78.2k
        n   -= left;
265
266
78.2k
        if (left)
267
78.2k
            ret = BS_FUNC(priv_val_get)(bc, left);
268
269
78.2k
        if (BS_FUNC(priv_refill_64)(bc) < 0)
270
388
            bc->bits_valid = n;
271
272
78.2k
    }
273
274
98.4k
#ifdef BITSTREAM_TEMPLATE_LE
275
98.4k
    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
98.4k
    return ret;
281
98.4k
}
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: proresdec.c:bits_read_63_le
Unexecuted instantiation: proresdec.c:bits_read_63_be
Unexecuted instantiation: rw2dec.c:bits_read_63_le
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
98.4k
{
288
98.4k
    av_assert2(n <= 64);
289
290
98.4k
    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
98.4k
    return BS_FUNC(read_63)(bc, n);
299
98.4k
}
Unexecuted instantiation: tak_parser.c:bits_read_64_le
tak.c:bits_read_64_le
Line
Count
Source
287
98.4k
{
288
98.4k
    av_assert2(n <= 64);
289
290
98.4k
    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
98.4k
    return BS_FUNC(read_63)(bc, n);
299
98.4k
}
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: proresdec.c:bits_read_64_le
Unexecuted instantiation: proresdec.c:bits_read_64_be
Unexecuted instantiation: rw2dec.c:bits_read_64_le
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.20M
{
308
1.20M
    av_assert2(n > 0 && n <= 32);
309
1.20M
    return sign_extend(BS_FUNC(read_nz)(bc, n), n);
310
1.20M
}
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.20M
{
308
1.20M
    av_assert2(n > 0 && n <= 32);
309
1.20M
    return sign_extend(BS_FUNC(read_nz)(bc, n), n);
310
1.20M
}
Unexecuted instantiation: photocd.c:bits_read_signed_nz_le
Unexecuted instantiation: photocd.c:bits_read_signed_nz_be
Unexecuted instantiation: proresdec.c:bits_read_signed_nz_le
Unexecuted instantiation: proresdec.c:bits_read_signed_nz_be
Unexecuted instantiation: rw2dec.c:bits_read_signed_nz_le
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: proresdec.c:bits_read_signed_le
Unexecuted instantiation: proresdec.c:bits_read_signed_be
Unexecuted instantiation: rw2dec.c:bits_read_signed_le
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.48G
{
332
3.48G
    av_assert2(n > 0 && n <= 32);
333
334
3.48G
    if (n > bc->bits_valid)
335
17.5M
        BS_FUNC(priv_refill_32)(bc);
336
337
3.48G
    return BS_FUNC(priv_val_show)(bc, n);
338
3.48G
}
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.37G
{
332
3.37G
    av_assert2(n > 0 && n <= 32);
333
334
3.37G
    if (n > bc->bits_valid)
335
11.7M
        BS_FUNC(priv_refill_32)(bc);
336
337
3.37G
    return BS_FUNC(priv_val_show)(bc, n);
338
3.37G
}
Unexecuted instantiation: sheervideo.c:bits_peek_nz_le
utvideodec.c:bits_peek_nz_be
Line
Count
Source
331
4.26M
{
332
4.26M
    av_assert2(n > 0 && n <= 32);
333
334
4.26M
    if (n > bc->bits_valid)
335
176k
        BS_FUNC(priv_refill_32)(bc);
336
337
4.26M
    return BS_FUNC(priv_val_show)(bc, n);
338
4.26M
}
Unexecuted instantiation: utvideodec.c:bits_peek_nz_le
vmixdec.c:bits_peek_nz_be
Line
Count
Source
331
1.13M
{
332
1.13M
    av_assert2(n > 0 && n <= 32);
333
334
1.13M
    if (n > bc->bits_valid)
335
175k
        BS_FUNC(priv_refill_32)(bc);
336
337
1.13M
    return BS_FUNC(priv_val_show)(bc, n);
338
1.13M
}
Unexecuted instantiation: vmixdec.c:bits_peek_nz_le
magicyuv.c:bits_peek_nz_be
Line
Count
Source
331
95.6M
{
332
95.6M
    av_assert2(n > 0 && n <= 32);
333
334
95.6M
    if (n > bc->bits_valid)
335
3.95M
        BS_FUNC(priv_refill_32)(bc);
336
337
95.6M
    return BS_FUNC(priv_val_show)(bc, n);
338
95.6M
}
Unexecuted instantiation: magicyuv.c:bits_peek_nz_le
prores_raw.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
551k
        BS_FUNC(priv_refill_32)(bc);
336
337
1.38M
    return BS_FUNC(priv_val_show)(bc, n);
338
1.38M
}
Unexecuted instantiation: prores_raw.c:bits_peek_nz_le
Unexecuted instantiation: takdec.c:bits_peek_nz_le
photocd.c:bits_peek_nz_be
Line
Count
Source
331
4.41M
{
332
4.41M
    av_assert2(n > 0 && n <= 32);
333
334
4.41M
    if (n > bc->bits_valid)
335
288k
        BS_FUNC(priv_refill_32)(bc);
336
337
4.41M
    return BS_FUNC(priv_val_show)(bc, n);
338
4.41M
}
Unexecuted instantiation: photocd.c:bits_peek_nz_le
proresdec.c:bits_peek_nz_be
Line
Count
Source
331
2.63M
{
332
2.63M
    av_assert2(n > 0 && n <= 32);
333
334
2.63M
    if (n > bc->bits_valid)
335
513k
        BS_FUNC(priv_refill_32)(bc);
336
337
2.63M
    return BS_FUNC(priv_val_show)(bc, n);
338
2.63M
}
Unexecuted instantiation: proresdec.c:bits_peek_nz_le
Unexecuted instantiation: rw2dec.c:bits_peek_nz_le
mvha.c:bits_peek_nz_be
Line
Count
Source
331
1.24M
{
332
1.24M
    av_assert2(n > 0 && n <= 32);
333
334
1.24M
    if (n > bc->bits_valid)
335
98.7k
        BS_FUNC(priv_refill_32)(bc);
336
337
1.24M
    return BS_FUNC(priv_val_show)(bc, n);
338
1.24M
}
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.48G
{
346
3.48G
    av_assert2(n <= 32);
347
348
3.48G
    if (!n)
349
0
        return 0;
350
351
3.48G
    return BS_FUNC(peek_nz)(bc, n);
352
3.48G
}
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.37G
{
346
3.37G
    av_assert2(n <= 32);
347
348
3.37G
    if (!n)
349
0
        return 0;
350
351
3.37G
    return BS_FUNC(peek_nz)(bc, n);
352
3.37G
}
Unexecuted instantiation: sheervideo.c:bits_peek_le
utvideodec.c:bits_peek_be
Line
Count
Source
345
4.26M
{
346
4.26M
    av_assert2(n <= 32);
347
348
4.26M
    if (!n)
349
0
        return 0;
350
351
4.26M
    return BS_FUNC(peek_nz)(bc, n);
352
4.26M
}
Unexecuted instantiation: utvideodec.c:bits_peek_le
vmixdec.c:bits_peek_be
Line
Count
Source
345
1.13M
{
346
1.13M
    av_assert2(n <= 32);
347
348
1.13M
    if (!n)
349
0
        return 0;
350
351
1.13M
    return BS_FUNC(peek_nz)(bc, n);
352
1.13M
}
Unexecuted instantiation: vmixdec.c:bits_peek_le
magicyuv.c:bits_peek_be
Line
Count
Source
345
95.6M
{
346
95.6M
    av_assert2(n <= 32);
347
348
95.6M
    if (!n)
349
0
        return 0;
350
351
95.6M
    return BS_FUNC(peek_nz)(bc, n);
352
95.6M
}
Unexecuted instantiation: magicyuv.c:bits_peek_le
prores_raw.c:bits_peek_be
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: prores_raw.c:bits_peek_le
Unexecuted instantiation: takdec.c:bits_peek_le
photocd.c:bits_peek_be
Line
Count
Source
345
4.41M
{
346
4.41M
    av_assert2(n <= 32);
347
348
4.41M
    if (!n)
349
0
        return 0;
350
351
4.41M
    return BS_FUNC(peek_nz)(bc, n);
352
4.41M
}
Unexecuted instantiation: photocd.c:bits_peek_le
proresdec.c:bits_peek_be
Line
Count
Source
345
2.63M
{
346
2.63M
    av_assert2(n <= 32);
347
348
2.63M
    if (!n)
349
0
        return 0;
350
351
2.63M
    return BS_FUNC(peek_nz)(bc, n);
352
2.63M
}
Unexecuted instantiation: proresdec.c:bits_peek_le
Unexecuted instantiation: rw2dec.c:bits_peek_le
mvha.c:bits_peek_be
Line
Count
Source
345
1.24M
{
346
1.24M
    av_assert2(n <= 32);
347
348
1.24M
    if (!n)
349
0
        return 0;
350
351
1.24M
    return BS_FUNC(peek_nz)(bc, n);
352
1.24M
}
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: proresdec.c:bits_peek_signed_nz_le
Unexecuted instantiation: proresdec.c:bits_peek_signed_nz_be
Unexecuted instantiation: rw2dec.c:bits_peek_signed_nz_le
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: proresdec.c:bits_peek_signed_le
Unexecuted instantiation: proresdec.c:bits_peek_signed_be
Unexecuted instantiation: rw2dec.c:bits_peek_signed_le
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
10.1M
{
385
10.1M
    if (n < bc->bits_valid)
386
5.95M
        BS_FUNC(priv_skip_remaining)(bc, n);
387
4.18M
    else {
388
4.18M
        n -= bc->bits_valid;
389
4.18M
        bc->bits       = 0;
390
4.18M
        bc->bits_valid = 0;
391
392
4.18M
        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.18M
        BS_FUNC(priv_refill_64)(bc);
399
4.18M
        if (n)
400
459k
            BS_FUNC(priv_skip_remaining)(bc, n);
401
4.18M
    }
402
10.1M
}
Unexecuted instantiation: tak_parser.c:bits_skip_le
tak.c:bits_skip_le
Line
Count
Source
384
3.93M
{
385
3.93M
    if (n < bc->bits_valid)
386
233k
        BS_FUNC(priv_skip_remaining)(bc, n);
387
3.70M
    else {
388
3.70M
        n -= bc->bits_valid;
389
3.70M
        bc->bits       = 0;
390
3.70M
        bc->bits_valid = 0;
391
392
3.70M
        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.70M
        BS_FUNC(priv_refill_64)(bc);
399
3.70M
        if (n)
400
59.5k
            BS_FUNC(priv_skip_remaining)(bc, n);
401
3.70M
    }
402
3.93M
}
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
vmixdec.c:bits_skip_be
Line
Count
Source
384
1.15M
{
385
1.15M
    if (n < bc->bits_valid)
386
1.14M
        BS_FUNC(priv_skip_remaining)(bc, n);
387
5.21k
    else {
388
5.21k
        n -= bc->bits_valid;
389
5.21k
        bc->bits       = 0;
390
5.21k
        bc->bits_valid = 0;
391
392
5.21k
        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.21k
        BS_FUNC(priv_refill_64)(bc);
399
5.21k
        if (n)
400
2.67k
            BS_FUNC(priv_skip_remaining)(bc, n);
401
5.21k
    }
402
1.15M
}
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
942k
{
385
942k
    if (n < bc->bits_valid)
386
929k
        BS_FUNC(priv_skip_remaining)(bc, n);
387
13.4k
    else {
388
13.4k
        n -= bc->bits_valid;
389
13.4k
        bc->bits       = 0;
390
13.4k
        bc->bits_valid = 0;
391
392
13.4k
        if (n >= 64) {
393
0
            unsigned int skip = n / 8;
394
395
0
            n -= skip * 8;
396
0
            bc->ptr += skip;
397
0
        }
398
13.4k
        BS_FUNC(priv_refill_64)(bc);
399
13.4k
        if (n)
400
3.50k
            BS_FUNC(priv_skip_remaining)(bc, n);
401
13.4k
    }
402
942k
}
Unexecuted instantiation: prores_raw.c:bits_skip_le
takdec.c:bits_skip_le
Line
Count
Source
384
622k
{
385
622k
    if (n < bc->bits_valid)
386
173k
        BS_FUNC(priv_skip_remaining)(bc, n);
387
449k
    else {
388
449k
        n -= bc->bits_valid;
389
449k
        bc->bits       = 0;
390
449k
        bc->bits_valid = 0;
391
392
449k
        if (n >= 64) {
393
0
            unsigned int skip = n / 8;
394
395
0
            n -= skip * 8;
396
0
            bc->ptr += skip;
397
0
        }
398
449k
        BS_FUNC(priv_refill_64)(bc);
399
449k
        if (n)
400
387k
            BS_FUNC(priv_skip_remaining)(bc, n);
401
449k
    }
402
622k
}
photocd.c:bits_skip_be
Line
Count
Source
384
1.00M
{
385
1.00M
    if (n < bc->bits_valid)
386
1.00M
        BS_FUNC(priv_skip_remaining)(bc, n);
387
943
    else {
388
943
        n -= bc->bits_valid;
389
943
        bc->bits       = 0;
390
943
        bc->bits_valid = 0;
391
392
943
        if (n >= 64) {
393
0
            unsigned int skip = n / 8;
394
395
0
            n -= skip * 8;
396
0
            bc->ptr += skip;
397
0
        }
398
943
        BS_FUNC(priv_refill_64)(bc);
399
943
        if (n)
400
264
            BS_FUNC(priv_skip_remaining)(bc, n);
401
943
    }
402
1.00M
}
Unexecuted instantiation: photocd.c:bits_skip_le
proresdec.c:bits_skip_be
Line
Count
Source
384
2.45M
{
385
2.45M
    if (n < bc->bits_valid)
386
2.43M
        BS_FUNC(priv_skip_remaining)(bc, n);
387
15.1k
    else {
388
15.1k
        n -= bc->bits_valid;
389
15.1k
        bc->bits       = 0;
390
15.1k
        bc->bits_valid = 0;
391
392
15.1k
        if (n >= 64) {
393
0
            unsigned int skip = n / 8;
394
395
0
            n -= skip * 8;
396
0
            bc->ptr += skip;
397
0
        }
398
15.1k
        BS_FUNC(priv_refill_64)(bc);
399
15.1k
        if (n)
400
5.36k
            BS_FUNC(priv_skip_remaining)(bc, n);
401
15.1k
    }
402
2.45M
}
Unexecuted instantiation: proresdec.c:bits_skip_le
Unexecuted instantiation: rw2dec.c:bits_skip_le
mvha.c:bits_skip_be
Line
Count
Source
384
38.4k
{
385
38.4k
    if (n < bc->bits_valid)
386
38.4k
        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
38.4k
}
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: proresdec.c:bits_seek_le
Unexecuted instantiation: proresdec.c:bits_seek_be
Unexecuted instantiation: rw2dec.c:bits_seek_le
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
602k
{
421
602k
    unsigned int n = -BS_FUNC(tell)(bc) & 7;
422
602k
    if (n)
423
204k
        BS_FUNC(skip)(bc, n);
424
602k
    return bc->buffer + (BS_FUNC(tell)(bc) >> 3);
425
602k
}
Unexecuted instantiation: tak_parser.c:bits_align_le
tak.c:bits_align_le
Line
Count
Source
420
77.2k
{
421
77.2k
    unsigned int n = -BS_FUNC(tell)(bc) & 7;
422
77.2k
    if (n)
423
76.1k
        BS_FUNC(skip)(bc, n);
424
77.2k
    return bc->buffer + (BS_FUNC(tell)(bc) >> 3);
425
77.2k
}
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
vmixdec.c:bits_align_be
Line
Count
Source
420
20.1k
{
421
20.1k
    unsigned int n = -BS_FUNC(tell)(bc) & 7;
422
20.1k
    if (n)
423
10.4k
        BS_FUNC(skip)(bc, n);
424
20.1k
    return bc->buffer + (BS_FUNC(tell)(bc) >> 3);
425
20.1k
}
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
takdec.c:bits_align_le
Line
Count
Source
420
504k
{
421
504k
    unsigned int n = -BS_FUNC(tell)(bc) & 7;
422
504k
    if (n)
423
117k
        BS_FUNC(skip)(bc, n);
424
504k
    return bc->buffer + (BS_FUNC(tell)(bc) >> 3);
425
504k
}
Unexecuted instantiation: photocd.c:bits_align_le
Unexecuted instantiation: photocd.c:bits_align_be
Unexecuted instantiation: proresdec.c:bits_align_le
Unexecuted instantiation: proresdec.c:bits_align_be
Unexecuted instantiation: rw2dec.c:bits_align_le
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: proresdec.c:bits_read_xbits_le
Unexecuted instantiation: proresdec.c:bits_read_xbits_be
Unexecuted instantiation: rw2dec.c:bits_read_xbits_le
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: proresdec.c:bits_decode012_le
Unexecuted instantiation: proresdec.c:bits_decode012_be
Unexecuted instantiation: rw2dec.c:bits_decode012_le
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: proresdec.c:bits_decode210_le
Unexecuted instantiation: proresdec.c:bits_decode210_be
Unexecuted instantiation: rw2dec.c:bits_decode210_le
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: proresdec.c:bits_apply_sign_le
Unexecuted instantiation: proresdec.c:bits_apply_sign_be
Unexecuted instantiation: rw2dec.c:bits_apply_sign_le
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: proresdec.c:bits_skip_1stop_8data_le
Unexecuted instantiation: proresdec.c:bits_skip_1stop_8data_be
Unexecuted instantiation: rw2dec.c:bits_skip_1stop_8data_le
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.13M
{
490
2.13M
    unsigned idx;
491
492
2.13M
    *nb_bits = -*n;
493
2.13M
    idx = BS_FUNC(peek)(bc, *nb_bits) + code;
494
2.13M
    *n = table[idx].len;
495
496
2.13M
    return table[idx].sym;
497
2.13M
}
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.57M
{
490
1.57M
    unsigned idx;
491
492
1.57M
    *nb_bits = -*n;
493
1.57M
    idx = BS_FUNC(peek)(bc, *nb_bits) + code;
494
1.57M
    *n = table[idx].len;
495
496
1.57M
    return table[idx].sym;
497
1.57M
}
Unexecuted instantiation: sheervideo.c:bits_priv_set_idx_le
utvideodec.c:bits_priv_set_idx_be
Line
Count
Source
489
76.0k
{
490
76.0k
    unsigned idx;
491
492
76.0k
    *nb_bits = -*n;
493
76.0k
    idx = BS_FUNC(peek)(bc, *nb_bits) + code;
494
76.0k
    *n = table[idx].len;
495
496
76.0k
    return table[idx].sym;
497
76.0k
}
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
275k
{
490
275k
    unsigned idx;
491
492
275k
    *nb_bits = -*n;
493
275k
    idx = BS_FUNC(peek)(bc, *nb_bits) + code;
494
275k
    *n = table[idx].len;
495
496
275k
    return table[idx].sym;
497
275k
}
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
Unexecuted instantiation: proresdec.c:bits_priv_set_idx_le
Unexecuted instantiation: proresdec.c:bits_priv_set_idx_be
Unexecuted instantiation: rw2dec.c:bits_priv_set_idx_le
mvha.c:bits_priv_set_idx_be
Line
Count
Source
489
211k
{
490
211k
    unsigned idx;
491
492
211k
    *nb_bits = -*n;
493
211k
    idx = BS_FUNC(peek)(bc, *nb_bits) + code;
494
211k
    *n = table[idx].len;
495
496
211k
    return table[idx].sym;
497
211k
}
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.47G
{
513
3.47G
    int nb_bits;
514
3.47G
    unsigned idx = BS_FUNC(peek)(bc, bits);
515
3.47G
    int code     = table[idx].sym;
516
3.47G
    int n        = table[idx].len;
517
518
3.47G
    if (max_depth > 1 && n < 0) {
519
1.87M
        BS_FUNC(priv_skip_remaining)(bc, bits);
520
1.87M
        code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table);
521
1.87M
        if (max_depth > 2 && n < 0) {
522
49.9k
            BS_FUNC(priv_skip_remaining)(bc, nb_bits);
523
49.9k
            code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table);
524
49.9k
        }
525
1.87M
    }
526
3.47G
    BS_FUNC(priv_skip_remaining)(bc, n);
527
528
3.47G
    return code;
529
3.47G
}
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.37G
{
513
3.37G
    int nb_bits;
514
3.37G
    unsigned idx = BS_FUNC(peek)(bc, bits);
515
3.37G
    int code     = table[idx].sym;
516
3.37G
    int n        = table[idx].len;
517
518
3.37G
    if (max_depth > 1 && n < 0) {
519
1.57M
        BS_FUNC(priv_skip_remaining)(bc, bits);
520
1.57M
        code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table);
521
1.57M
        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.57M
    }
526
3.37G
    BS_FUNC(priv_skip_remaining)(bc, n);
527
528
3.37G
    return code;
529
3.37G
}
Unexecuted instantiation: sheervideo.c:bits_read_vlc_le
utvideodec.c:bits_read_vlc_be
Line
Count
Source
512
3.57M
{
513
3.57M
    int nb_bits;
514
3.57M
    unsigned idx = BS_FUNC(peek)(bc, bits);
515
3.57M
    int code     = table[idx].sym;
516
3.57M
    int n        = table[idx].len;
517
518
3.57M
    if (max_depth > 1 && n < 0) {
519
25.6k
        BS_FUNC(priv_skip_remaining)(bc, bits);
520
25.6k
        code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table);
521
25.6k
        if (max_depth > 2 && n < 0) {
522
24.0k
            BS_FUNC(priv_skip_remaining)(bc, nb_bits);
523
24.0k
            code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table);
524
24.0k
        }
525
25.6k
    }
526
3.57M
    BS_FUNC(priv_skip_remaining)(bc, n);
527
528
3.57M
    return code;
529
3.57M
}
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
94.9M
{
513
94.9M
    int nb_bits;
514
94.9M
    unsigned idx = BS_FUNC(peek)(bc, bits);
515
94.9M
    int code     = table[idx].sym;
516
94.9M
    int n        = table[idx].len;
517
518
94.9M
    if (max_depth > 1 && n < 0) {
519
64.1k
        BS_FUNC(priv_skip_remaining)(bc, bits);
520
64.1k
        code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table);
521
64.1k
        if (max_depth > 2 && n < 0) {
522
25.9k
            BS_FUNC(priv_skip_remaining)(bc, nb_bits);
523
25.9k
            code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table);
524
25.9k
        }
525
64.1k
    }
526
94.9M
    BS_FUNC(priv_skip_remaining)(bc, n);
527
528
94.9M
    return code;
529
94.9M
}
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.40M
{
513
3.40M
    int nb_bits;
514
3.40M
    unsigned idx = BS_FUNC(peek)(bc, bits);
515
3.40M
    int code     = table[idx].sym;
516
3.40M
    int n        = table[idx].len;
517
518
3.40M
    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.40M
    BS_FUNC(priv_skip_remaining)(bc, n);
527
528
3.40M
    return code;
529
3.40M
}
Unexecuted instantiation: photocd.c:bits_read_vlc_le
Unexecuted instantiation: proresdec.c:bits_read_vlc_le
Unexecuted instantiation: proresdec.c:bits_read_vlc_be
Unexecuted instantiation: rw2dec.c:bits_read_vlc_le
mvha.c:bits_read_vlc_be
Line
Count
Source
512
1.03M
{
513
1.03M
    int nb_bits;
514
1.03M
    unsigned idx = BS_FUNC(peek)(bc, bits);
515
1.03M
    int code     = table[idx].sym;
516
1.03M
    int n        = table[idx].len;
517
518
1.03M
    if (max_depth > 1 && n < 0) {
519
211k
        BS_FUNC(priv_skip_remaining)(bc, bits);
520
211k
        code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table);
521
211k
        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
211k
    }
526
1.03M
    BS_FUNC(priv_skip_remaining)(bc, n);
527
528
1.03M
    return code;
529
1.03M
}
Unexecuted instantiation: mvha.c:bits_read_vlc_le
530
531
/**
532
 * Parse a vlc / vlc_multi code.
533
 * @param bits is the number of bits which will be read at once, must be
534
 *             identical to nb_bits in vlc_init()
535
 * @param max_depth is the number of times bits bits must be read to completely
536
 *                  read the longest vlc code
537
 *                  = (max_vlc_length + bits - 1) / bits
538
 * @param dst the parsed symbol(s) will be stored here. Up to 8 bytes are written
539
 * @returns number of symbols parsed
540
 * If the vlc code is invalid and max_depth=1, then no bits will be removed.
541
 * If the vlc code is invalid and max_depth>1, then the number of bits removed
542
 * is undefined.
543
 */
544
static inline int BS_FUNC(read_vlc_multi)(BSCTX *bc, uint8_t dst[8],
545
                                          const VLC_MULTI_ELEM *const Jtable,
546
                                          const VLCElem *const table,
547
                                          const int bits, const int max_depth,
548
                                          const int symbols_size)
549
1.04M
{
550
1.04M
    unsigned idx = BS_FUNC(peek)(bc, bits);
551
1.04M
    int ret, nb_bits, code, n = Jtable[idx].len;
552
1.04M
    if (Jtable[idx].num) {
553
864k
        AV_COPY64U(dst, Jtable[idx].val8);
554
864k
        ret = Jtable[idx].num;
555
864k
    } else {
556
179k
        code = table[idx].sym;
557
179k
        n = table[idx].len;
558
179k
        if (max_depth > 1 && n < 0) {
559
174k
            BS_FUNC(priv_skip_remaining)(bc, bits);
560
174k
            code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table);
561
174k
            if (max_depth > 2 && n < 0) {
562
37.1k
                BS_FUNC(priv_skip_remaining)(bc, nb_bits);
563
37.1k
                code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table);
564
37.1k
            }
565
174k
        }
566
179k
        if (symbols_size == 1)
567
43.7k
            *dst = code;
568
136k
        else
569
179k
            AV_WN16(dst, code);
570
179k
        ret = n > 0;
571
179k
    }
572
1.04M
    BS_FUNC(priv_skip_remaining)(bc, n);
573
574
1.04M
    return ret;
575
1.04M
}
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
618k
{
550
618k
    unsigned idx = BS_FUNC(peek)(bc, bits);
551
618k
    int ret, nb_bits, code, n = Jtable[idx].len;
552
618k
    if (Jtable[idx].num) {
553
600k
        AV_COPY64U(dst, Jtable[idx].val8);
554
600k
        ret = Jtable[idx].num;
555
600k
    } else {
556
18.0k
        code = table[idx].sym;
557
18.0k
        n = table[idx].len;
558
18.0k
        if (max_depth > 1 && n < 0) {
559
14.0k
            BS_FUNC(priv_skip_remaining)(bc, bits);
560
14.0k
            code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table);
561
14.0k
            if (max_depth > 2 && n < 0) {
562
12.3k
                BS_FUNC(priv_skip_remaining)(bc, nb_bits);
563
12.3k
                code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table);
564
12.3k
            }
565
14.0k
        }
566
18.0k
        if (symbols_size == 1)
567
14.7k
            *dst = code;
568
3.29k
        else
569
18.0k
            AV_WN16(dst, code);
570
18.0k
        ret = n > 0;
571
18.0k
    }
572
618k
    BS_FUNC(priv_skip_remaining)(bc, n);
573
574
618k
    return ret;
575
618k
}
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
426k
{
550
426k
    unsigned idx = BS_FUNC(peek)(bc, bits);
551
426k
    int ret, nb_bits, code, n = Jtable[idx].len;
552
426k
    if (Jtable[idx].num) {
553
264k
        AV_COPY64U(dst, Jtable[idx].val8);
554
264k
        ret = Jtable[idx].num;
555
264k
    } else {
556
161k
        code = table[idx].sym;
557
161k
        n = table[idx].len;
558
161k
        if (max_depth > 1 && n < 0) {
559
160k
            BS_FUNC(priv_skip_remaining)(bc, bits);
560
160k
            code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table);
561
160k
            if (max_depth > 2 && n < 0) {
562
24.8k
                BS_FUNC(priv_skip_remaining)(bc, nb_bits);
563
24.8k
                code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table);
564
24.8k
            }
565
160k
        }
566
161k
        if (symbols_size == 1)
567
28.9k
            *dst = code;
568
132k
        else
569
161k
            AV_WN16(dst, code);
570
161k
        ret = n > 0;
571
161k
    }
572
426k
    BS_FUNC(priv_skip_remaining)(bc, n);
573
574
426k
    return ret;
575
426k
}
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: proresdec.c:bits_read_vlc_multi_le
Unexecuted instantiation: proresdec.c:bits_read_vlc_multi_be
Unexecuted instantiation: rw2dec.c:bits_read_vlc_multi_le
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