../../../ffmpeg/
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
1686 / 2771
60.8%
Branches:
1675 / 4400
38.1%
Functions:
56 / 100
56.0%

libavcodec/cbs_h265_syntax_template.c
Line Branch Exec Source
1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 4527 static int FUNC(rbsp_trailing_bits)(CodedBitstreamContext *ctx, RWContext *rw)
20 {
21 int err;
22
23
2/4
cbs_h265_read_rbsp_trailing_bits:
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 2485 times.
cbs_h265_write_rbsp_trailing_bits:
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 2042 times.
4527 fixed(1, rbsp_stop_one_bit, 1);
24
4/4
cbs_h265_read_rbsp_trailing_bits:
✓ Branch 11 → 6 taken 15229 times.
✓ Branch 11 → 12 taken 2485 times.
cbs_h265_write_rbsp_trailing_bits:
✓ Branch 11 → 6 taken 12626 times.
✓ Branch 11 → 12 taken 2042 times.
32382 while (byte_alignment(rw) != 0)
25
2/4
cbs_h265_read_rbsp_trailing_bits:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 15229 times.
cbs_h265_write_rbsp_trailing_bits:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 12626 times.
27855 fixed(1, rbsp_alignment_zero_bit, 0);
26
27 4527 return 0;
28 }
29
30 18115 static int FUNC(nal_unit_header)(CodedBitstreamContext *ctx, RWContext *rw,
31 H265RawNALUnitHeader *current,
32 int expected_nal_unit_type)
33 {
34 int err;
35
36
2/4
cbs_h265_read_nal_unit_header:
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 9969 times.
cbs_h265_write_nal_unit_header:
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 8146 times.
18115 fixed(1, forbidden_zero_bit, 0);
37
38
4/4
cbs_h265_read_nal_unit_header:
✓ Branch 5 → 6 taken 2485 times.
✓ Branch 5 → 10 taken 7484 times.
cbs_h265_write_nal_unit_header:
✓ Branch 5 → 6 taken 2042 times.
✓ Branch 5 → 10 taken 6104 times.
18115 if (expected_nal_unit_type >= 0)
39
2/4
cbs_h265_read_nal_unit_header:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 2485 times.
cbs_h265_write_nal_unit_header:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 2042 times.
4527 u(6, nal_unit_type, expected_nal_unit_type,
40 expected_nal_unit_type);
41 else
42
2/4
cbs_h265_read_nal_unit_header:
✗ Branch 11 → 12 not taken.
✓ Branch 11 → 13 taken 7484 times.
cbs_h265_write_nal_unit_header:
✗ Branch 11 → 12 not taken.
✓ Branch 11 → 13 taken 6104 times.
13588 ub(6, nal_unit_type);
43
44
2/4
cbs_h265_read_nal_unit_header:
✗ Branch 15 → 16 not taken.
✓ Branch 15 → 17 taken 9969 times.
cbs_h265_write_nal_unit_header:
✗ Branch 14 → 15 not taken.
✓ Branch 14 → 16 taken 8146 times.
18115 u(6, nuh_layer_id, 0, 62);
45
2/4
cbs_h265_read_nal_unit_header:
✗ Branch 18 → 19 not taken.
✓ Branch 18 → 20 taken 9969 times.
cbs_h265_write_nal_unit_header:
✗ Branch 17 → 18 not taken.
✓ Branch 17 → 19 taken 8146 times.
18115 u(3, nuh_temporal_id_plus1, 1, 7);
46
47 18115 return 0;
48 }
49
50 13588 static int FUNC(byte_alignment)(CodedBitstreamContext *ctx, RWContext *rw)
51 {
52 int err;
53
54
2/4
cbs_h265_read_byte_alignment:
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 7484 times.
cbs_h265_write_byte_alignment:
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 6104 times.
13588 fixed(1, alignment_bit_equal_to_one, 1);
55
4/4
cbs_h265_read_byte_alignment:
✓ Branch 11 → 6 taken 29765 times.
✓ Branch 11 → 12 taken 7484 times.
cbs_h265_write_byte_alignment:
✓ Branch 11 → 6 taken 24632 times.
✓ Branch 11 → 12 taken 6104 times.
67985 while (byte_alignment(rw) != 0)
56
2/4
cbs_h265_read_byte_alignment:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 29765 times.
cbs_h265_write_byte_alignment:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 24632 times.
54397 fixed(1, alignment_bit_equal_to_zero, 0);
57
58 13588 return 0;
59 }
60
61 ✗ static int FUNC(extension_data)(CodedBitstreamContext *ctx, RWContext *rw,
62 H265RawExtensionData *current)
63 {
64 int err;
65 size_t k;
66 #ifdef READ
67 GetBitContext start;
68 uint8_t bit;
69 ✗ start = *rw;
70
0/2
✗ Branch 6 → 3 not taken.
✗ Branch 6 → 7 not taken.
✗ for (k = 0; ff_cbs_h2645_read_more_rbsp_data(rw); k++)
71 ✗ skip_bits(rw, 1);
72 ✗ current->bit_length = k;
73
0/2
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 17 not taken.
✗ if (k > 0) {
74 ✗ *rw = start;
75
0/2
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 11 not taken.
✗ allocate(current->data, (current->bit_length + 7) / 8);
76
0/2
✗ Branch 16 → 12 not taken.
✗ Branch 16 → 17 not taken.
✗ for (k = 0; k < current->bit_length; k++) {
77
0/2
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 15 not taken.
✗ xu(1, extension_data, bit, 0, 1, 0);
78 ✗ current->data[k / 8] |= bit << (7 - k % 8);
79 }
80 }
81 #else
82
0/2
✗ Branch 7 → 3 not taken.
✗ Branch 7 → 8 not taken.
✗ for (k = 0; k < current->bit_length; k++)
83
0/2
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
✗ xu(1, extension_data, current->data[k / 8] >> (7 - k % 8) & 1, 0, 1, 0);
84 #endif
85 ✗ return 0;
86 }
87
88 270 static int FUNC(profile_tier_level)(CodedBitstreamContext *ctx, RWContext *rw,
89 H265RawProfileTierLevel *current,
90 int profile_present_flag,
91 int max_num_sub_layers_minus1)
92 {
93 int err, i, j;
94
95
2/4
cbs_h265_read_profile_tier_level:
✓ Branch 2 → 3 taken 142 times.
✗ Branch 2 → 143 not taken.
cbs_h265_write_profile_tier_level:
✓ Branch 2 → 3 taken 128 times.
✗ Branch 2 → 143 not taken.
270 if (profile_present_flag) {
96
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 142 times.
cbs_h265_write_profile_tier_level:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 128 times.
270 u(2, general_profile_space, 0, 0);
97
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 142 times.
cbs_h265_write_profile_tier_level:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 128 times.
270 flag(general_tier_flag);
98
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 10 → 11 not taken.
✓ Branch 10 → 12 taken 142 times.
cbs_h265_write_profile_tier_level:
✗ Branch 10 → 11 not taken.
✓ Branch 10 → 12 taken 128 times.
270 ub(5, general_profile_idc);
99
100
4/4
cbs_h265_read_profile_tier_level:
✓ Branch 17 → 13 taken 4544 times.
✓ Branch 17 → 18 taken 142 times.
cbs_h265_write_profile_tier_level:
✓ Branch 17 → 13 taken 4096 times.
✓ Branch 17 → 18 taken 128 times.
8910 for (j = 0; j < 32; j++)
101
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 14 → 15 not taken.
✓ Branch 14 → 16 taken 4544 times.
cbs_h265_write_profile_tier_level:
✗ Branch 14 → 15 not taken.
✓ Branch 14 → 16 taken 4096 times.
8640 flags(general_profile_compatibility_flag[j], 1, j);
102
103
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 142 times.
cbs_h265_write_profile_tier_level:
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 128 times.
270 flag(general_progressive_source_flag);
104
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 22 → 23 not taken.
✓ Branch 22 → 24 taken 142 times.
cbs_h265_write_profile_tier_level:
✗ Branch 22 → 23 not taken.
✓ Branch 22 → 24 taken 128 times.
270 flag(general_interlaced_source_flag);
105
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 25 → 26 not taken.
✓ Branch 25 → 27 taken 142 times.
cbs_h265_write_profile_tier_level:
✗ Branch 25 → 26 not taken.
✓ Branch 25 → 27 taken 128 times.
270 flag(general_non_packed_constraint_flag);
106
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 28 → 29 not taken.
✓ Branch 28 → 30 taken 142 times.
cbs_h265_write_profile_tier_level:
✗ Branch 28 → 29 not taken.
✓ Branch 28 → 30 taken 128 times.
270 flag(general_frame_only_constraint_flag);
107
108 #define profile_compatible(x) (current->general_profile_idc == (x) || \
109 current->general_profile_compatibility_flag[x])
110
8/16
cbs_h265_read_profile_tier_level:
✓ Branch 30 → 31 taken 142 times.
✗ Branch 30 → 46 not taken.
✓ Branch 31 → 32 taken 142 times.
✗ Branch 31 → 46 not taken.
✓ Branch 32 → 33 taken 142 times.
✗ Branch 32 → 46 not taken.
✓ Branch 33 → 34 taken 142 times.
✗ Branch 33 → 46 not taken.
cbs_h265_write_profile_tier_level:
✓ Branch 30 → 31 taken 128 times.
✗ Branch 30 → 46 not taken.
✓ Branch 31 → 32 taken 128 times.
✗ Branch 31 → 46 not taken.
✓ Branch 32 → 33 taken 128 times.
✗ Branch 32 → 46 not taken.
✓ Branch 33 → 34 taken 128 times.
✗ Branch 33 → 46 not taken.
270 if (profile_compatible(4) || profile_compatible(5) ||
111
8/16
cbs_h265_read_profile_tier_level:
✓ Branch 34 → 35 taken 142 times.
✗ Branch 34 → 46 not taken.
✓ Branch 35 → 36 taken 142 times.
✗ Branch 35 → 46 not taken.
✓ Branch 36 → 37 taken 142 times.
✗ Branch 36 → 46 not taken.
✓ Branch 37 → 38 taken 142 times.
✗ Branch 37 → 46 not taken.
cbs_h265_write_profile_tier_level:
✓ Branch 34 → 35 taken 128 times.
✗ Branch 34 → 46 not taken.
✓ Branch 35 → 36 taken 128 times.
✗ Branch 35 → 46 not taken.
✓ Branch 36 → 37 taken 128 times.
✗ Branch 36 → 46 not taken.
✓ Branch 37 → 38 taken 128 times.
✗ Branch 37 → 46 not taken.
270 profile_compatible(6) || profile_compatible(7) ||
112
8/16
cbs_h265_read_profile_tier_level:
✓ Branch 38 → 39 taken 142 times.
✗ Branch 38 → 46 not taken.
✓ Branch 39 → 40 taken 142 times.
✗ Branch 39 → 46 not taken.
✓ Branch 40 → 41 taken 142 times.
✗ Branch 40 → 46 not taken.
✓ Branch 41 → 42 taken 142 times.
✗ Branch 41 → 46 not taken.
cbs_h265_write_profile_tier_level:
✓ Branch 38 → 39 taken 128 times.
✗ Branch 38 → 46 not taken.
✓ Branch 39 → 40 taken 128 times.
✗ Branch 39 → 46 not taken.
✓ Branch 40 → 41 taken 128 times.
✗ Branch 40 → 46 not taken.
✓ Branch 41 → 42 taken 128 times.
✗ Branch 41 → 46 not taken.
270 profile_compatible(8) || profile_compatible(9) ||
113
8/16
cbs_h265_read_profile_tier_level:
✓ Branch 42 → 43 taken 142 times.
✗ Branch 42 → 46 not taken.
✓ Branch 43 → 44 taken 142 times.
✗ Branch 43 → 46 not taken.
✓ Branch 44 → 45 taken 142 times.
✗ Branch 44 → 46 not taken.
✗ Branch 45 → 46 not taken.
✓ Branch 45 → 99 taken 142 times.
cbs_h265_write_profile_tier_level:
✓ Branch 42 → 43 taken 128 times.
✗ Branch 42 → 46 not taken.
✓ Branch 43 → 44 taken 128 times.
✗ Branch 43 → 46 not taken.
✓ Branch 44 → 45 taken 128 times.
✗ Branch 44 → 46 not taken.
✗ Branch 45 → 46 not taken.
✓ Branch 45 → 99 taken 128 times.
270 profile_compatible(10) || profile_compatible(11)) {
114
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 47 → 48 not taken.
✗ Branch 47 → 49 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 47 → 48 not taken.
✗ Branch 47 → 49 not taken.
✗ flag(general_max_12bit_constraint_flag);
115
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 50 → 51 not taken.
✗ Branch 50 → 52 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 50 → 51 not taken.
✗ Branch 50 → 52 not taken.
✗ flag(general_max_10bit_constraint_flag);
116
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 53 → 54 not taken.
✗ Branch 53 → 55 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 53 → 54 not taken.
✗ Branch 53 → 55 not taken.
✗ flag(general_max_8bit_constraint_flag);
117
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 56 → 57 not taken.
✗ Branch 56 → 58 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 56 → 57 not taken.
✗ Branch 56 → 58 not taken.
✗ flag(general_max_422chroma_constraint_flag);
118
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 61 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 61 not taken.
✗ flag(general_max_420chroma_constraint_flag);
119
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 64 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 64 not taken.
✗ flag(general_max_monochrome_constraint_flag);
120
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 65 → 66 not taken.
✗ Branch 65 → 67 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 65 → 66 not taken.
✗ Branch 65 → 67 not taken.
✗ flag(general_intra_constraint_flag);
121
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 68 → 69 not taken.
✗ Branch 68 → 70 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 68 → 69 not taken.
✗ Branch 68 → 70 not taken.
✗ flag(general_one_picture_only_constraint_flag);
122
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 71 → 72 not taken.
✗ Branch 71 → 73 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 71 → 72 not taken.
✗ Branch 71 → 73 not taken.
✗ flag(general_lower_bit_rate_constraint_flag);
123
124
0/16
cbs_h265_read_profile_tier_level:
✗ Branch 73 → 74 not taken.
✗ Branch 73 → 81 not taken.
✗ Branch 74 → 75 not taken.
✗ Branch 74 → 81 not taken.
✗ Branch 75 → 76 not taken.
✗ Branch 75 → 81 not taken.
✗ Branch 76 → 77 not taken.
✗ Branch 76 → 81 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 73 → 74 not taken.
✗ Branch 73 → 81 not taken.
✗ Branch 74 → 75 not taken.
✗ Branch 74 → 81 not taken.
✗ Branch 75 → 76 not taken.
✗ Branch 75 → 81 not taken.
✗ Branch 76 → 77 not taken.
✗ Branch 76 → 81 not taken.
✗ if (profile_compatible(5) || profile_compatible(9) ||
125
0/16
cbs_h265_read_profile_tier_level:
✗ Branch 77 → 78 not taken.
✗ Branch 77 → 81 not taken.
✗ Branch 78 → 79 not taken.
✗ Branch 78 → 81 not taken.
✗ Branch 79 → 80 not taken.
✗ Branch 79 → 81 not taken.
✗ Branch 80 → 81 not taken.
✗ Branch 80 → 91 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 77 → 78 not taken.
✗ Branch 77 → 81 not taken.
✗ Branch 78 → 79 not taken.
✗ Branch 78 → 81 not taken.
✗ Branch 79 → 80 not taken.
✗ Branch 79 → 81 not taken.
✗ Branch 80 → 81 not taken.
✗ Branch 80 → 91 not taken.
✗ profile_compatible(10) || profile_compatible(11)) {
126
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 82 → 83 not taken.
✗ Branch 82 → 84 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 82 → 83 not taken.
✗ Branch 82 → 84 not taken.
✗ flag(general_max_14bit_constraint_flag);
127
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 85 → 86 not taken.
✗ Branch 85 → 87 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 85 → 86 not taken.
✗ Branch 85 → 87 not taken.
✗ fixed(24, general_reserved_zero_33bits, 0);
128
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 88 → 89 not taken.
✗ Branch 88 → 90 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 88 → 89 not taken.
✗ Branch 88 → 90 not taken.
✗ fixed( 9, general_reserved_zero_33bits, 0);
129 } else {
130
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 92 → 93 not taken.
✗ Branch 92 → 94 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 92 → 93 not taken.
✗ Branch 92 → 94 not taken.
✗ fixed(24, general_reserved_zero_34bits, 0);
131
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 95 → 96 not taken.
✗ Branch 95 → 97 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 95 → 96 not taken.
✗ Branch 95 → 97 not taken.
✗ fixed(10, general_reserved_zero_34bits, 0);
132 }
133
8/8
cbs_h265_read_profile_tier_level:
✓ Branch 99 → 100 taken 126 times.
✓ Branch 99 → 101 taken 16 times.
✓ Branch 100 → 101 taken 98 times.
✓ Branch 100 → 114 taken 28 times.
cbs_h265_write_profile_tier_level:
✓ Branch 99 → 100 taken 112 times.
✓ Branch 99 → 101 taken 16 times.
✓ Branch 100 → 101 taken 84 times.
✓ Branch 100 → 114 taken 28 times.
270 } else if (profile_compatible(2)) {
134
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 102 → 103 not taken.
✓ Branch 102 → 104 taken 114 times.
cbs_h265_write_profile_tier_level:
✗ Branch 102 → 103 not taken.
✓ Branch 102 → 104 taken 100 times.
214 fixed(7, general_reserved_zero_7bits, 0);
135
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 105 → 106 not taken.
✓ Branch 105 → 107 taken 114 times.
cbs_h265_write_profile_tier_level:
✗ Branch 105 → 106 not taken.
✓ Branch 105 → 107 taken 100 times.
214 flag(general_one_picture_only_constraint_flag);
136
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 108 → 109 not taken.
✓ Branch 108 → 110 taken 114 times.
cbs_h265_write_profile_tier_level:
✗ Branch 108 → 109 not taken.
✓ Branch 108 → 110 taken 100 times.
214 fixed(24, general_reserved_zero_35bits, 0);
137
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 111 → 112 not taken.
✓ Branch 111 → 113 taken 114 times.
cbs_h265_write_profile_tier_level:
✗ Branch 111 → 112 not taken.
✓ Branch 111 → 113 taken 100 times.
214 fixed(11, general_reserved_zero_35bits, 0);
138 } else {
139
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 115 → 116 not taken.
✓ Branch 115 → 117 taken 28 times.
cbs_h265_write_profile_tier_level:
✗ Branch 115 → 116 not taken.
✓ Branch 115 → 117 taken 28 times.
56 fixed(24, general_reserved_zero_43bits, 0);
140
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 118 → 119 not taken.
✓ Branch 118 → 120 taken 28 times.
cbs_h265_write_profile_tier_level:
✗ Branch 118 → 119 not taken.
✓ Branch 118 → 120 taken 28 times.
56 fixed(19, general_reserved_zero_43bits, 0);
141 }
142
143
8/16
cbs_h265_read_profile_tier_level:
✓ Branch 121 → 122 taken 16 times.
✓ Branch 121 → 135 taken 126 times.
✓ Branch 122 → 123 taken 16 times.
✗ Branch 122 → 135 not taken.
✗ Branch 123 → 124 not taken.
✓ Branch 123 → 135 taken 16 times.
✗ Branch 124 → 125 not taken.
✗ Branch 124 → 135 not taken.
cbs_h265_write_profile_tier_level:
✓ Branch 121 → 122 taken 16 times.
✓ Branch 121 → 135 taken 112 times.
✓ Branch 122 → 123 taken 16 times.
✗ Branch 122 → 135 not taken.
✗ Branch 123 → 124 not taken.
✓ Branch 123 → 135 taken 16 times.
✗ Branch 124 → 125 not taken.
✗ Branch 124 → 135 not taken.
270 if (profile_compatible(1) || profile_compatible(2) ||
144
0/16
cbs_h265_read_profile_tier_level:
✗ Branch 125 → 126 not taken.
✗ Branch 125 → 135 not taken.
✗ Branch 126 → 127 not taken.
✗ Branch 126 → 135 not taken.
✗ Branch 127 → 128 not taken.
✗ Branch 127 → 135 not taken.
✗ Branch 128 → 129 not taken.
✗ Branch 128 → 135 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 125 → 126 not taken.
✗ Branch 125 → 135 not taken.
✗ Branch 126 → 127 not taken.
✗ Branch 126 → 135 not taken.
✗ Branch 127 → 128 not taken.
✗ Branch 127 → 135 not taken.
✗ Branch 128 → 129 not taken.
✗ Branch 128 → 135 not taken.
✗ profile_compatible(3) || profile_compatible(4) ||
145
0/16
cbs_h265_read_profile_tier_level:
✗ Branch 129 → 130 not taken.
✗ Branch 129 → 135 not taken.
✗ Branch 130 → 131 not taken.
✗ Branch 130 → 135 not taken.
✗ Branch 131 → 132 not taken.
✗ Branch 131 → 135 not taken.
✗ Branch 132 → 133 not taken.
✗ Branch 132 → 135 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 129 → 130 not taken.
✗ Branch 129 → 135 not taken.
✗ Branch 130 → 131 not taken.
✗ Branch 130 → 135 not taken.
✗ Branch 131 → 132 not taken.
✗ Branch 131 → 135 not taken.
✗ Branch 132 → 133 not taken.
✗ Branch 132 → 135 not taken.
✗ profile_compatible(5) || profile_compatible(9) ||
146
0/8
cbs_h265_read_profile_tier_level:
✗ Branch 133 → 134 not taken.
✗ Branch 133 → 135 not taken.
✗ Branch 134 → 135 not taken.
✗ Branch 134 → 139 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 133 → 134 not taken.
✗ Branch 133 → 135 not taken.
✗ Branch 134 → 135 not taken.
✗ Branch 134 → 139 not taken.
✗ profile_compatible(11)) {
147
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 136 → 137 not taken.
✓ Branch 136 → 138 taken 142 times.
cbs_h265_write_profile_tier_level:
✗ Branch 136 → 137 not taken.
✓ Branch 136 → 138 taken 128 times.
270 flag(general_inbld_flag);
148 } else {
149
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 140 → 141 not taken.
✗ Branch 140 → 142 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 140 → 141 not taken.
✗ Branch 140 → 142 not taken.
✗ fixed(1, general_reserved_zero_bit, 0);
150 }
151 #undef profile_compatible
152 }
153
154
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 144 → 145 not taken.
✓ Branch 144 → 146 taken 142 times.
cbs_h265_write_profile_tier_level:
✗ Branch 144 → 145 not taken.
✓ Branch 144 → 146 taken 128 times.
270 ub(8, general_level_idc);
155
156
4/4
cbs_h265_read_profile_tier_level:
✓ Branch 154 → 147 taken 48 times.
✓ Branch 154 → 155 taken 142 times.
cbs_h265_write_profile_tier_level:
✓ Branch 154 → 147 taken 48 times.
✓ Branch 154 → 155 taken 128 times.
366 for (i = 0; i < max_num_sub_layers_minus1; i++) {
157
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 148 → 149 not taken.
✓ Branch 148 → 150 taken 48 times.
cbs_h265_write_profile_tier_level:
✗ Branch 148 → 149 not taken.
✓ Branch 148 → 150 taken 48 times.
96 flags(sub_layer_profile_present_flag[i], 1, i);
158
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 151 → 152 not taken.
✓ Branch 151 → 153 taken 48 times.
cbs_h265_write_profile_tier_level:
✗ Branch 151 → 152 not taken.
✓ Branch 151 → 153 taken 48 times.
96 flags(sub_layer_level_present_flag[i], 1, i);
159 }
160
161
4/4
cbs_h265_read_profile_tier_level:
✓ Branch 155 → 156 taken 24 times.
✓ Branch 155 → 162 taken 118 times.
cbs_h265_write_profile_tier_level:
✓ Branch 155 → 156 taken 24 times.
✓ Branch 155 → 162 taken 104 times.
270 if (max_num_sub_layers_minus1 > 0) {
162
4/4
cbs_h265_read_profile_tier_level:
✓ Branch 161 → 157 taken 144 times.
✓ Branch 161 → 162 taken 24 times.
cbs_h265_write_profile_tier_level:
✓ Branch 161 → 157 taken 144 times.
✓ Branch 161 → 162 taken 24 times.
336 for (i = max_num_sub_layers_minus1; i < 8; i++)
163
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 158 → 159 not taken.
✓ Branch 158 → 160 taken 144 times.
cbs_h265_write_profile_tier_level:
✗ Branch 158 → 159 not taken.
✓ Branch 158 → 160 taken 144 times.
288 fixed(2, reserved_zero_2bits, 0);
164 }
165
166
4/4
cbs_h265_read_profile_tier_level:
✓ Branch 310 → 163 taken 48 times.
✓ Branch 310 → 311 taken 142 times.
cbs_h265_write_profile_tier_level:
✓ Branch 310 → 163 taken 48 times.
✓ Branch 310 → 311 taken 128 times.
366 for (i = 0; i < max_num_sub_layers_minus1; i++) {
167
4/4
cbs_h265_read_profile_tier_level:
✓ Branch 163 → 164 taken 8 times.
✓ Branch 163 → 304 taken 40 times.
cbs_h265_write_profile_tier_level:
✓ Branch 163 → 164 taken 8 times.
✓ Branch 163 → 304 taken 40 times.
96 if (current->sub_layer_profile_present_flag[i]) {
168
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 165 → 166 not taken.
✓ Branch 165 → 167 taken 8 times.
cbs_h265_write_profile_tier_level:
✗ Branch 165 → 166 not taken.
✓ Branch 165 → 167 taken 8 times.
16 us(2, sub_layer_profile_space[i], 0, 0, 1, i);
169
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 168 → 169 not taken.
✓ Branch 168 → 170 taken 8 times.
cbs_h265_write_profile_tier_level:
✗ Branch 168 → 169 not taken.
✓ Branch 168 → 170 taken 8 times.
16 flags(sub_layer_tier_flag[i], 1, i);
170
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 171 → 172 not taken.
✓ Branch 171 → 173 taken 8 times.
cbs_h265_write_profile_tier_level:
✗ Branch 171 → 172 not taken.
✓ Branch 171 → 173 taken 8 times.
16 ubs(5, sub_layer_profile_idc[i], 1, i);
171
172
4/4
cbs_h265_read_profile_tier_level:
✓ Branch 178 → 174 taken 256 times.
✓ Branch 178 → 179 taken 8 times.
cbs_h265_write_profile_tier_level:
✓ Branch 178 → 174 taken 256 times.
✓ Branch 178 → 179 taken 8 times.
528 for (j = 0; j < 32; j++)
173
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 175 → 176 not taken.
✓ Branch 175 → 177 taken 256 times.
cbs_h265_write_profile_tier_level:
✗ Branch 175 → 176 not taken.
✓ Branch 175 → 177 taken 256 times.
512 flags(sub_layer_profile_compatibility_flag[i][j], 2, i, j);
174
175
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 180 → 181 not taken.
✓ Branch 180 → 182 taken 8 times.
cbs_h265_write_profile_tier_level:
✗ Branch 180 → 181 not taken.
✓ Branch 180 → 182 taken 8 times.
16 flags(sub_layer_progressive_source_flag[i], 1, i);
176
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 183 → 184 not taken.
✓ Branch 183 → 185 taken 8 times.
cbs_h265_write_profile_tier_level:
✗ Branch 183 → 184 not taken.
✓ Branch 183 → 185 taken 8 times.
16 flags(sub_layer_interlaced_source_flag[i], 1, i);
177
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 186 → 187 not taken.
✓ Branch 186 → 188 taken 8 times.
cbs_h265_write_profile_tier_level:
✗ Branch 186 → 187 not taken.
✓ Branch 186 → 188 taken 8 times.
16 flags(sub_layer_non_packed_constraint_flag[i], 1, i);
178
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 189 → 190 not taken.
✓ Branch 189 → 191 taken 8 times.
cbs_h265_write_profile_tier_level:
✗ Branch 189 → 190 not taken.
✓ Branch 189 → 191 taken 8 times.
16 flags(sub_layer_frame_only_constraint_flag[i], 1, i);
179
180 #define profile_compatible(x) (current->sub_layer_profile_idc[i] == (x) || \
181 current->sub_layer_profile_compatibility_flag[i][x])
182
8/16
cbs_h265_read_profile_tier_level:
✓ Branch 191 → 192 taken 8 times.
✗ Branch 191 → 207 not taken.
✓ Branch 192 → 193 taken 8 times.
✗ Branch 192 → 207 not taken.
✓ Branch 193 → 194 taken 8 times.
✗ Branch 193 → 207 not taken.
✓ Branch 194 → 195 taken 8 times.
✗ Branch 194 → 207 not taken.
cbs_h265_write_profile_tier_level:
✓ Branch 191 → 192 taken 8 times.
✗ Branch 191 → 207 not taken.
✓ Branch 192 → 193 taken 8 times.
✗ Branch 192 → 207 not taken.
✓ Branch 193 → 194 taken 8 times.
✗ Branch 193 → 207 not taken.
✓ Branch 194 → 195 taken 8 times.
✗ Branch 194 → 207 not taken.
16 if (profile_compatible(4) || profile_compatible(5) ||
183
8/16
cbs_h265_read_profile_tier_level:
✓ Branch 195 → 196 taken 8 times.
✗ Branch 195 → 207 not taken.
✓ Branch 196 → 197 taken 8 times.
✗ Branch 196 → 207 not taken.
✓ Branch 197 → 198 taken 8 times.
✗ Branch 197 → 207 not taken.
✓ Branch 198 → 199 taken 8 times.
✗ Branch 198 → 207 not taken.
cbs_h265_write_profile_tier_level:
✓ Branch 195 → 196 taken 8 times.
✗ Branch 195 → 207 not taken.
✓ Branch 196 → 197 taken 8 times.
✗ Branch 196 → 207 not taken.
✓ Branch 197 → 198 taken 8 times.
✗ Branch 197 → 207 not taken.
✓ Branch 198 → 199 taken 8 times.
✗ Branch 198 → 207 not taken.
16 profile_compatible(6) || profile_compatible(7) ||
184
8/16
cbs_h265_read_profile_tier_level:
✓ Branch 199 → 200 taken 8 times.
✗ Branch 199 → 207 not taken.
✓ Branch 200 → 201 taken 8 times.
✗ Branch 200 → 207 not taken.
✓ Branch 201 → 202 taken 8 times.
✗ Branch 201 → 207 not taken.
✓ Branch 202 → 203 taken 8 times.
✗ Branch 202 → 207 not taken.
cbs_h265_write_profile_tier_level:
✓ Branch 199 → 200 taken 8 times.
✗ Branch 199 → 207 not taken.
✓ Branch 200 → 201 taken 8 times.
✗ Branch 200 → 207 not taken.
✓ Branch 201 → 202 taken 8 times.
✗ Branch 201 → 207 not taken.
✓ Branch 202 → 203 taken 8 times.
✗ Branch 202 → 207 not taken.
16 profile_compatible(8) || profile_compatible(9) ||
185
8/16
cbs_h265_read_profile_tier_level:
✓ Branch 203 → 204 taken 8 times.
✗ Branch 203 → 207 not taken.
✓ Branch 204 → 205 taken 8 times.
✗ Branch 204 → 207 not taken.
✓ Branch 205 → 206 taken 8 times.
✗ Branch 205 → 207 not taken.
✗ Branch 206 → 207 not taken.
✓ Branch 206 → 260 taken 8 times.
cbs_h265_write_profile_tier_level:
✓ Branch 203 → 204 taken 8 times.
✗ Branch 203 → 207 not taken.
✓ Branch 204 → 205 taken 8 times.
✗ Branch 204 → 207 not taken.
✓ Branch 205 → 206 taken 8 times.
✗ Branch 205 → 207 not taken.
✗ Branch 206 → 207 not taken.
✓ Branch 206 → 260 taken 8 times.
16 profile_compatible(10) || profile_compatible(11)) {
186
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 208 → 209 not taken.
✗ Branch 208 → 210 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 208 → 209 not taken.
✗ Branch 208 → 210 not taken.
✗ flags(sub_layer_max_12bit_constraint_flag[i], 1, i);
187
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 211 → 212 not taken.
✗ Branch 211 → 213 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 211 → 212 not taken.
✗ Branch 211 → 213 not taken.
✗ flags(sub_layer_max_10bit_constraint_flag[i], 1, i);
188
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 214 → 215 not taken.
✗ Branch 214 → 216 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 214 → 215 not taken.
✗ Branch 214 → 216 not taken.
✗ flags(sub_layer_max_8bit_constraint_flag[i], 1, i);
189
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 217 → 218 not taken.
✗ Branch 217 → 219 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 217 → 218 not taken.
✗ Branch 217 → 219 not taken.
✗ flags(sub_layer_max_422chroma_constraint_flag[i], 1, i);
190
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 220 → 221 not taken.
✗ Branch 220 → 222 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 220 → 221 not taken.
✗ Branch 220 → 222 not taken.
✗ flags(sub_layer_max_420chroma_constraint_flag[i], 1, i);
191
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 223 → 224 not taken.
✗ Branch 223 → 225 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 223 → 224 not taken.
✗ Branch 223 → 225 not taken.
✗ flags(sub_layer_max_monochrome_constraint_flag[i], 1, i);
192
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 226 → 227 not taken.
✗ Branch 226 → 228 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 226 → 227 not taken.
✗ Branch 226 → 228 not taken.
✗ flags(sub_layer_intra_constraint_flag[i], 1, i);
193
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 229 → 230 not taken.
✗ Branch 229 → 231 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 229 → 230 not taken.
✗ Branch 229 → 231 not taken.
✗ flags(sub_layer_one_picture_only_constraint_flag[i], 1, i);
194
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 232 → 233 not taken.
✗ Branch 232 → 234 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 232 → 233 not taken.
✗ Branch 232 → 234 not taken.
✗ flags(sub_layer_lower_bit_rate_constraint_flag[i], 1, i);
195
196
0/16
cbs_h265_read_profile_tier_level:
✗ Branch 234 → 235 not taken.
✗ Branch 234 → 242 not taken.
✗ Branch 235 → 236 not taken.
✗ Branch 235 → 242 not taken.
✗ Branch 236 → 237 not taken.
✗ Branch 236 → 242 not taken.
✗ Branch 237 → 238 not taken.
✗ Branch 237 → 242 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 234 → 235 not taken.
✗ Branch 234 → 242 not taken.
✗ Branch 235 → 236 not taken.
✗ Branch 235 → 242 not taken.
✗ Branch 236 → 237 not taken.
✗ Branch 236 → 242 not taken.
✗ Branch 237 → 238 not taken.
✗ Branch 237 → 242 not taken.
✗ if (profile_compatible(5) || profile_compatible(9) ||
197
0/16
cbs_h265_read_profile_tier_level:
✗ Branch 238 → 239 not taken.
✗ Branch 238 → 242 not taken.
✗ Branch 239 → 240 not taken.
✗ Branch 239 → 242 not taken.
✗ Branch 240 → 241 not taken.
✗ Branch 240 → 242 not taken.
✗ Branch 241 → 242 not taken.
✗ Branch 241 → 252 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 238 → 239 not taken.
✗ Branch 238 → 242 not taken.
✗ Branch 239 → 240 not taken.
✗ Branch 239 → 242 not taken.
✗ Branch 240 → 241 not taken.
✗ Branch 240 → 242 not taken.
✗ Branch 241 → 242 not taken.
✗ Branch 241 → 252 not taken.
✗ profile_compatible(10) || profile_compatible(11)) {
198
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 243 → 244 not taken.
✗ Branch 243 → 245 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 243 → 244 not taken.
✗ Branch 243 → 245 not taken.
✗ flags(sub_layer_max_14bit_constraint_flag[i], 1, i);
199
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 246 → 247 not taken.
✗ Branch 246 → 248 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 246 → 247 not taken.
✗ Branch 246 → 248 not taken.
✗ fixed(24, sub_layer_reserved_zero_33bits, 0);
200
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 249 → 250 not taken.
✗ Branch 249 → 251 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 249 → 250 not taken.
✗ Branch 249 → 251 not taken.
✗ fixed( 9, sub_layer_reserved_zero_33bits, 0);
201 } else {
202
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 253 → 254 not taken.
✗ Branch 253 → 255 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 253 → 254 not taken.
✗ Branch 253 → 255 not taken.
✗ fixed(24, sub_layer_reserved_zero_34bits, 0);
203
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 256 → 257 not taken.
✗ Branch 256 → 258 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 256 → 257 not taken.
✗ Branch 256 → 258 not taken.
✗ fixed(10, sub_layer_reserved_zero_34bits, 0);
204 }
205
4/8
cbs_h265_read_profile_tier_level:
✓ Branch 260 → 261 taken 8 times.
✗ Branch 260 → 262 not taken.
✗ Branch 261 → 262 not taken.
✓ Branch 261 → 275 taken 8 times.
cbs_h265_write_profile_tier_level:
✓ Branch 260 → 261 taken 8 times.
✗ Branch 260 → 262 not taken.
✗ Branch 261 → 262 not taken.
✓ Branch 261 → 275 taken 8 times.
16 } else if (profile_compatible(2)) {
206
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 263 → 264 not taken.
✗ Branch 263 → 265 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 263 → 264 not taken.
✗ Branch 263 → 265 not taken.
✗ fixed(7, sub_layer_reserved_zero_7bits, 0);
207
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 266 → 267 not taken.
✗ Branch 266 → 268 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 266 → 267 not taken.
✗ Branch 266 → 268 not taken.
✗ flags(sub_layer_one_picture_only_constraint_flag[i], 1, i);
208
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 269 → 270 not taken.
✗ Branch 269 → 271 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 269 → 270 not taken.
✗ Branch 269 → 271 not taken.
✗ fixed(24, sub_layer_reserved_zero_43bits, 0);
209
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 272 → 273 not taken.
✗ Branch 272 → 274 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 272 → 273 not taken.
✗ Branch 272 → 274 not taken.
✗ fixed(11, sub_layer_reserved_zero_43bits, 0);
210 } else {
211
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 276 → 277 not taken.
✓ Branch 276 → 278 taken 8 times.
cbs_h265_write_profile_tier_level:
✗ Branch 276 → 277 not taken.
✓ Branch 276 → 278 taken 8 times.
16 fixed(24, sub_layer_reserved_zero_43bits, 0);
212
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 279 → 280 not taken.
✓ Branch 279 → 281 taken 8 times.
cbs_h265_write_profile_tier_level:
✗ Branch 279 → 280 not taken.
✓ Branch 279 → 281 taken 8 times.
16 fixed(19, sub_layer_reserved_zero_43bits, 0);
213 }
214
215
2/16
cbs_h265_read_profile_tier_level:
✗ Branch 282 → 283 not taken.
✓ Branch 282 → 296 taken 8 times.
✗ Branch 283 → 284 not taken.
✗ Branch 283 → 296 not taken.
✗ Branch 284 → 285 not taken.
✗ Branch 284 → 296 not taken.
✗ Branch 285 → 286 not taken.
✗ Branch 285 → 296 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 282 → 283 not taken.
✓ Branch 282 → 296 taken 8 times.
✗ Branch 283 → 284 not taken.
✗ Branch 283 → 296 not taken.
✗ Branch 284 → 285 not taken.
✗ Branch 284 → 296 not taken.
✗ Branch 285 → 286 not taken.
✗ Branch 285 → 296 not taken.
16 if (profile_compatible(1) || profile_compatible(2) ||
216
0/16
cbs_h265_read_profile_tier_level:
✗ Branch 286 → 287 not taken.
✗ Branch 286 → 296 not taken.
✗ Branch 287 → 288 not taken.
✗ Branch 287 → 296 not taken.
✗ Branch 288 → 289 not taken.
✗ Branch 288 → 296 not taken.
✗ Branch 289 → 290 not taken.
✗ Branch 289 → 296 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 286 → 287 not taken.
✗ Branch 286 → 296 not taken.
✗ Branch 287 → 288 not taken.
✗ Branch 287 → 296 not taken.
✗ Branch 288 → 289 not taken.
✗ Branch 288 → 296 not taken.
✗ Branch 289 → 290 not taken.
✗ Branch 289 → 296 not taken.
✗ profile_compatible(3) || profile_compatible(4) ||
217
0/16
cbs_h265_read_profile_tier_level:
✗ Branch 290 → 291 not taken.
✗ Branch 290 → 296 not taken.
✗ Branch 291 → 292 not taken.
✗ Branch 291 → 296 not taken.
✗ Branch 292 → 293 not taken.
✗ Branch 292 → 296 not taken.
✗ Branch 293 → 294 not taken.
✗ Branch 293 → 296 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 290 → 291 not taken.
✗ Branch 290 → 296 not taken.
✗ Branch 291 → 292 not taken.
✗ Branch 291 → 296 not taken.
✗ Branch 292 → 293 not taken.
✗ Branch 292 → 296 not taken.
✗ Branch 293 → 294 not taken.
✗ Branch 293 → 296 not taken.
✗ profile_compatible(5) || profile_compatible(9) ||
218
0/8
cbs_h265_read_profile_tier_level:
✗ Branch 294 → 295 not taken.
✗ Branch 294 → 296 not taken.
✗ Branch 295 → 296 not taken.
✗ Branch 295 → 300 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 294 → 295 not taken.
✗ Branch 294 → 296 not taken.
✗ Branch 295 → 296 not taken.
✗ Branch 295 → 300 not taken.
✗ profile_compatible(11)) {
219
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 297 → 298 not taken.
✓ Branch 297 → 299 taken 8 times.
cbs_h265_write_profile_tier_level:
✗ Branch 297 → 298 not taken.
✓ Branch 297 → 299 taken 8 times.
16 flags(sub_layer_inbld_flag[i], 1, i);
220 } else {
221
0/4
cbs_h265_read_profile_tier_level:
✗ Branch 301 → 302 not taken.
✗ Branch 301 → 303 not taken.
cbs_h265_write_profile_tier_level:
✗ Branch 301 → 302 not taken.
✗ Branch 301 → 303 not taken.
✗ fixed(1, sub_layer_reserved_zero_bit, 0);
222 }
223 #undef profile_compatible
224 }
225
4/4
cbs_h265_read_profile_tier_level:
✓ Branch 304 → 305 taken 8 times.
✓ Branch 304 → 309 taken 40 times.
cbs_h265_write_profile_tier_level:
✓ Branch 304 → 305 taken 8 times.
✓ Branch 304 → 309 taken 40 times.
96 if (current->sub_layer_level_present_flag[i])
226
2/4
cbs_h265_read_profile_tier_level:
✗ Branch 306 → 307 not taken.
✓ Branch 306 → 308 taken 8 times.
cbs_h265_write_profile_tier_level:
✗ Branch 306 → 307 not taken.
✓ Branch 306 → 308 taken 8 times.
16 ubs(8, sub_layer_level_idc[i], 1, i);
227 }
228
229 270 return 0;
230 }
231
232 16 static int FUNC(sub_layer_hrd_parameters)(CodedBitstreamContext *ctx, RWContext *rw,
233 H265RawHRDParameters *hrd,
234 int nal, int sub_layer_id)
235 {
236 H265RawSubLayerHRDParameters *current;
237 int err, i;
238
239
4/4
cbs_h265_read_sub_layer_hrd_parameters:
✓ Branch 2 → 3 taken 4 times.
✓ Branch 2 → 4 taken 4 times.
cbs_h265_write_sub_layer_hrd_parameters:
✓ Branch 2 → 3 taken 4 times.
✓ Branch 2 → 4 taken 4 times.
16 if (nal)
240 8 current = &hrd->nal_sub_layer_hrd_parameters[sub_layer_id];
241 else
242 8 current = &hrd->vcl_sub_layer_hrd_parameters[sub_layer_id];
243
244
4/4
cbs_h265_read_sub_layer_hrd_parameters:
✓ Branch 24 → 6 taken 8 times.
✓ Branch 24 → 25 taken 8 times.
cbs_h265_write_sub_layer_hrd_parameters:
✓ Branch 24 → 6 taken 8 times.
✓ Branch 24 → 25 taken 8 times.
32 for (i = 0; i <= hrd->cpb_cnt_minus1[sub_layer_id]; i++) {
245
2/4
cbs_h265_read_sub_layer_hrd_parameters:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 8 times.
cbs_h265_write_sub_layer_hrd_parameters:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 8 times.
16 ues(bit_rate_value_minus1[i], 0, UINT32_MAX - 1, 1, i);
246
2/4
cbs_h265_read_sub_layer_hrd_parameters:
✗ Branch 10 → 11 not taken.
✓ Branch 10 → 12 taken 8 times.
cbs_h265_write_sub_layer_hrd_parameters:
✗ Branch 10 → 11 not taken.
✓ Branch 10 → 12 taken 8 times.
16 ues(cpb_size_value_minus1[i], 0, UINT32_MAX - 1, 1, i);
247
4/4
cbs_h265_read_sub_layer_hrd_parameters:
✓ Branch 12 → 13 taken 4 times.
✓ Branch 12 → 20 taken 4 times.
cbs_h265_write_sub_layer_hrd_parameters:
✓ Branch 12 → 13 taken 4 times.
✓ Branch 12 → 20 taken 4 times.
16 if (hrd->sub_pic_hrd_params_present_flag) {
248
2/4
cbs_h265_read_sub_layer_hrd_parameters:
✗ Branch 14 → 15 not taken.
✓ Branch 14 → 16 taken 4 times.
cbs_h265_write_sub_layer_hrd_parameters:
✗ Branch 14 → 15 not taken.
✓ Branch 14 → 16 taken 4 times.
8 ues(cpb_size_du_value_minus1[i], 0, UINT32_MAX - 1, 1, i);
249
2/4
cbs_h265_read_sub_layer_hrd_parameters:
✗ Branch 17 → 18 not taken.
✓ Branch 17 → 19 taken 4 times.
cbs_h265_write_sub_layer_hrd_parameters:
✗ Branch 17 → 18 not taken.
✓ Branch 17 → 19 taken 4 times.
8 ues(bit_rate_du_value_minus1[i], 0, UINT32_MAX - 1, 1, i);
250 }
251
2/4
cbs_h265_read_sub_layer_hrd_parameters:
✗ Branch 21 → 22 not taken.
✓ Branch 21 → 23 taken 8 times.
cbs_h265_write_sub_layer_hrd_parameters:
✗ Branch 21 → 22 not taken.
✓ Branch 21 → 23 taken 8 times.
16 flags(cbr_flag[i], 1, i);
252 }
253
254 16 return 0;
255 }
256
257 8 static int FUNC(hrd_parameters)(CodedBitstreamContext *ctx, RWContext *rw,
258 H265RawHRDParameters *current, int common_inf_present_flag,
259 int max_num_sub_layers_minus1)
260 {
261 int err, i;
262
263
2/4
cbs_h265_read_hrd_parameters:
✓ Branch 2 → 3 taken 4 times.
✗ Branch 2 → 50 not taken.
cbs_h265_write_hrd_parameters:
✓ Branch 2 → 3 taken 4 times.
✗ Branch 2 → 59 not taken.
8 if (common_inf_present_flag) {
264
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 4 times.
cbs_h265_write_hrd_parameters:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 4 times.
8 flag(nal_hrd_parameters_present_flag);
265
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 4 times.
cbs_h265_write_hrd_parameters:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 4 times.
8 flag(vcl_hrd_parameters_present_flag);
266
267
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 9 → 10 not taken.
✓ Branch 9 → 11 taken 4 times.
cbs_h265_write_hrd_parameters:
✗ Branch 9 → 10 not taken.
✓ Branch 9 → 11 taken 4 times.
8 if (current->nal_hrd_parameters_present_flag ||
268
0/4
cbs_h265_read_hrd_parameters:
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 49 not taken.
cbs_h265_write_hrd_parameters:
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 47 not taken.
✗ current->vcl_hrd_parameters_present_flag) {
269
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 12 → 13 not taken.
✓ Branch 12 → 14 taken 4 times.
cbs_h265_write_hrd_parameters:
✗ Branch 12 → 13 not taken.
✓ Branch 12 → 14 taken 4 times.
8 flag(sub_pic_hrd_params_present_flag);
270
4/4
cbs_h265_read_hrd_parameters:
✓ Branch 14 → 15 taken 2 times.
✓ Branch 14 → 28 taken 2 times.
cbs_h265_write_hrd_parameters:
✓ Branch 14 → 15 taken 2 times.
✓ Branch 14 → 27 taken 2 times.
8 if (current->sub_pic_hrd_params_present_flag) {
271
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 16 → 17 not taken.
✓ Branch 16 → 18 taken 2 times.
cbs_h265_write_hrd_parameters:
✗ Branch 16 → 17 not taken.
✓ Branch 16 → 18 taken 2 times.
4 ub(8, tick_divisor_minus2);
272
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 2 times.
cbs_h265_write_hrd_parameters:
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 2 times.
4 ub(5, du_cpb_removal_delay_increment_length_minus1);
273
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 22 → 23 not taken.
✓ Branch 22 → 24 taken 2 times.
cbs_h265_write_hrd_parameters:
✗ Branch 22 → 23 not taken.
✓ Branch 22 → 24 taken 2 times.
4 flag(sub_pic_cpb_params_in_pic_timing_sei_flag);
274
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 25 → 26 not taken.
✓ Branch 25 → 27 taken 2 times.
cbs_h265_write_hrd_parameters:
✗ Branch 25 → 26 not taken.
✓ Branch 25 → 27 taken 2 times.
4 ub(5, dpb_output_delay_du_length_minus1);
275 }
276
277
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 29 → 30 not taken.
✓ Branch 29 → 31 taken 4 times.
cbs_h265_write_hrd_parameters:
✗ Branch 28 → 29 not taken.
✓ Branch 28 → 30 taken 4 times.
8 ub(4, bit_rate_scale);
278
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 32 → 33 not taken.
✓ Branch 32 → 34 taken 4 times.
cbs_h265_write_hrd_parameters:
✗ Branch 31 → 32 not taken.
✓ Branch 31 → 33 taken 4 times.
8 ub(4, cpb_size_scale);
279
4/4
cbs_h265_read_hrd_parameters:
✓ Branch 34 → 35 taken 2 times.
✓ Branch 34 → 39 taken 2 times.
cbs_h265_write_hrd_parameters:
✓ Branch 33 → 34 taken 2 times.
✓ Branch 33 → 37 taken 2 times.
8 if (current->sub_pic_hrd_params_present_flag)
280
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 36 → 37 not taken.
✓ Branch 36 → 38 taken 2 times.
cbs_h265_write_hrd_parameters:
✗ Branch 35 → 36 not taken.
✓ Branch 35 → 37 taken 2 times.
4 ub(4, cpb_size_du_scale);
281
282
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 40 → 41 not taken.
✓ Branch 40 → 42 taken 4 times.
cbs_h265_write_hrd_parameters:
✗ Branch 38 → 39 not taken.
✓ Branch 38 → 40 taken 4 times.
8 ub(5, initial_cpb_removal_delay_length_minus1);
283
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 43 → 44 not taken.
✓ Branch 43 → 45 taken 4 times.
cbs_h265_write_hrd_parameters:
✗ Branch 41 → 42 not taken.
✓ Branch 41 → 43 taken 4 times.
8 ub(5, au_cpb_removal_delay_length_minus1);
284
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 46 → 47 not taken.
✓ Branch 46 → 48 taken 4 times.
cbs_h265_write_hrd_parameters:
✗ Branch 44 → 45 not taken.
✓ Branch 44 → 46 taken 4 times.
8 ub(5, dpb_output_delay_length_minus1);
285 } else {
286
0/2
✗ Branch 47 → 48 not taken.
✗ Branch 47 → 50 not taken.
✗ infer(sub_pic_hrd_params_present_flag, 0);
287
288
0/2
✗ Branch 50 → 51 not taken.
✗ Branch 50 → 53 not taken.
✗ infer(initial_cpb_removal_delay_length_minus1, 23);
289
0/2
✗ Branch 53 → 54 not taken.
✗ Branch 53 → 56 not taken.
✗ infer(au_cpb_removal_delay_length_minus1, 23);
290
0/2
✗ Branch 56 → 57 not taken.
✗ Branch 56 → 59 not taken.
✗ infer(dpb_output_delay_length_minus1, 23);
291 }
292 }
293
294
4/4
cbs_h265_read_hrd_parameters:
✓ Branch 84 → 51 taken 4 times.
✓ Branch 84 → 85 taken 4 times.
cbs_h265_write_hrd_parameters:
✓ Branch 99 → 60 taken 4 times.
✓ Branch 99 → 100 taken 4 times.
16 for (i = 0; i <= max_num_sub_layers_minus1; i++) {
295
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 52 → 53 not taken.
✓ Branch 52 → 54 taken 4 times.
cbs_h265_write_hrd_parameters:
✗ Branch 61 → 62 not taken.
✓ Branch 61 → 63 taken 4 times.
8 flags(fixed_pic_rate_general_flag[i], 1, i);
296
297
4/4
cbs_h265_read_hrd_parameters:
✓ Branch 54 → 55 taken 2 times.
✓ Branch 54 → 59 taken 2 times.
cbs_h265_write_hrd_parameters:
✓ Branch 63 → 64 taken 2 times.
✓ Branch 63 → 68 taken 2 times.
8 if (!current->fixed_pic_rate_general_flag[i])
298
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 56 → 57 not taken.
✓ Branch 56 → 58 taken 2 times.
cbs_h265_write_hrd_parameters:
✗ Branch 65 → 66 not taken.
✓ Branch 65 → 67 taken 2 times.
4 flags(fixed_pic_rate_within_cvs_flag[i], 1, i);
299 else
300
1/2
✗ Branch 68 → 69 not taken.
✓ Branch 68 → 71 taken 2 times.
4 infer(fixed_pic_rate_within_cvs_flag[i], 1);
301
302
4/4
cbs_h265_read_hrd_parameters:
✓ Branch 60 → 61 taken 2 times.
✓ Branch 60 → 65 taken 2 times.
cbs_h265_write_hrd_parameters:
✓ Branch 71 → 72 taken 2 times.
✓ Branch 71 → 78 taken 2 times.
8 if (current->fixed_pic_rate_within_cvs_flag[i]) {
303
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 62 → 63 not taken.
✓ Branch 62 → 64 taken 2 times.
cbs_h265_write_hrd_parameters:
✗ Branch 73 → 74 not taken.
✓ Branch 73 → 75 taken 2 times.
4 ues(elemental_duration_in_tc_minus1[i], 0, 2047, 1, i);
304
1/2
✗ Branch 75 → 76 not taken.
✓ Branch 75 → 82 taken 2 times.
4 infer(low_delay_hrd_flag[i], 0);
305 } else
306
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 66 → 67 not taken.
✓ Branch 66 → 68 taken 2 times.
cbs_h265_write_hrd_parameters:
✗ Branch 79 → 80 not taken.
✓ Branch 79 → 81 taken 2 times.
4 flags(low_delay_hrd_flag[i], 1, i);
307
308
2/4
cbs_h265_read_hrd_parameters:
✓ Branch 69 → 70 taken 4 times.
✗ Branch 69 → 74 not taken.
cbs_h265_write_hrd_parameters:
✓ Branch 82 → 83 taken 4 times.
✗ Branch 82 → 87 not taken.
8 if (!current->low_delay_hrd_flag[i])
309
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 71 → 72 not taken.
✓ Branch 71 → 73 taken 4 times.
cbs_h265_write_hrd_parameters:
✗ Branch 84 → 85 not taken.
✓ Branch 84 → 86 taken 4 times.
8 ues(cpb_cnt_minus1[i], 0, 31, 1, i);
310 else
311
0/2
✗ Branch 87 → 88 not taken.
✗ Branch 87 → 90 not taken.
✗ infer(cpb_cnt_minus1[i], 0);
312
313
2/4
cbs_h265_read_hrd_parameters:
✓ Branch 75 → 76 taken 4 times.
✗ Branch 75 → 79 not taken.
cbs_h265_write_hrd_parameters:
✓ Branch 90 → 91 taken 4 times.
✗ Branch 90 → 94 not taken.
8 if (current->nal_hrd_parameters_present_flag)
314
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 77 → 78 not taken.
✓ Branch 77 → 79 taken 4 times.
cbs_h265_write_hrd_parameters:
✗ Branch 92 → 93 not taken.
✓ Branch 92 → 94 taken 4 times.
8 CHECK(FUNC(sub_layer_hrd_parameters)(ctx, rw, current, 0, i));
315
2/4
cbs_h265_read_hrd_parameters:
✓ Branch 79 → 80 taken 4 times.
✗ Branch 79 → 83 not taken.
cbs_h265_write_hrd_parameters:
✓ Branch 94 → 95 taken 4 times.
✗ Branch 94 → 98 not taken.
8 if (current->vcl_hrd_parameters_present_flag)
316
2/4
cbs_h265_read_hrd_parameters:
✗ Branch 81 → 82 not taken.
✓ Branch 81 → 83 taken 4 times.
cbs_h265_write_hrd_parameters:
✗ Branch 96 → 97 not taken.
✓ Branch 96 → 98 taken 4 times.
8 CHECK(FUNC(sub_layer_hrd_parameters)(ctx, rw, current, 1, i));
317 }
318
319 8 return 0;
320 }
321
322 62 static int FUNC(vui_parameters)(CodedBitstreamContext *ctx, RWContext *rw,
323 H265RawVUI *current, const H265RawSPS *sps)
324 {
325 int err;
326
327
2/4
cbs_h265_read_vui_parameters:
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 29 times.
cbs_h265_write_vui_parameters:
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 33 times.
62 flag(aspect_ratio_info_present_flag);
328
4/4
cbs_h265_read_vui_parameters:
✓ Branch 5 → 6 taken 17 times.
✓ Branch 5 → 17 taken 12 times.
cbs_h265_write_vui_parameters:
✓ Branch 5 → 6 taken 17 times.
✓ Branch 5 → 16 taken 16 times.
62 if (current->aspect_ratio_info_present_flag) {
329
2/4
cbs_h265_read_vui_parameters:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 17 times.
cbs_h265_write_vui_parameters:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 17 times.
34 ub(8, aspect_ratio_idc);
330
2/4
cbs_h265_read_vui_parameters:
✗ Branch 9 → 10 not taken.
✓ Branch 9 → 18 taken 17 times.
cbs_h265_write_vui_parameters:
✗ Branch 9 → 10 not taken.
✓ Branch 9 → 19 taken 17 times.
34 if (current->aspect_ratio_idc == 255) {
331
0/4
cbs_h265_read_vui_parameters:
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
cbs_h265_write_vui_parameters:
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
✗ ub(16, sar_width);
332
0/4
cbs_h265_read_vui_parameters:
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 16 not taken.
cbs_h265_write_vui_parameters:
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 19 not taken.
✗ ub(16, sar_height);
333 }
334 } else {
335
1/2
✗ Branch 16 → 17 not taken.
✓ Branch 16 → 19 taken 16 times.
28 infer(aspect_ratio_idc, 0);
336 }
337
338
2/4
cbs_h265_read_vui_parameters:
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 29 times.
cbs_h265_write_vui_parameters:
✗ Branch 20 → 21 not taken.
✓ Branch 20 → 22 taken 33 times.
62 flag(overscan_info_present_flag);
339
2/4
cbs_h265_read_vui_parameters:
✗ Branch 21 → 22 not taken.
✓ Branch 21 → 26 taken 29 times.
cbs_h265_write_vui_parameters:
✗ Branch 22 → 23 not taken.
✓ Branch 22 → 26 taken 33 times.
62 if (current->overscan_info_present_flag)
340
0/4
cbs_h265_read_vui_parameters:
✗ Branch 23 → 24 not taken.
✗ Branch 23 → 25 not taken.
cbs_h265_write_vui_parameters:
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 26 not taken.
✗ flag(overscan_appropriate_flag);
341
342
2/4
cbs_h265_read_vui_parameters:
✗ Branch 27 → 28 not taken.
✓ Branch 27 → 29 taken 29 times.
cbs_h265_write_vui_parameters:
✗ Branch 27 → 28 not taken.
✓ Branch 27 → 29 taken 33 times.
62 flag(video_signal_type_present_flag);
343
3/4
cbs_h265_read_vui_parameters:
✗ Branch 29 → 30 not taken.
✓ Branch 29 → 51 taken 29 times.
cbs_h265_write_vui_parameters:
✓ Branch 29 → 30 taken 4 times.
✓ Branch 29 → 58 taken 29 times.
62 if (current->video_signal_type_present_flag) {
344
1/4
cbs_h265_read_vui_parameters:
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 33 not taken.
cbs_h265_write_vui_parameters:
✗ Branch 31 → 32 not taken.
✓ Branch 31 → 33 taken 4 times.
4 ub(3, video_format);
345
1/4
cbs_h265_read_vui_parameters:
✗ Branch 34 → 35 not taken.
✗ Branch 34 → 36 not taken.
cbs_h265_write_vui_parameters:
✗ Branch 34 → 35 not taken.
✓ Branch 34 → 36 taken 4 times.
4 flag(video_full_range_flag);
346
1/4
cbs_h265_read_vui_parameters:
✗ Branch 37 → 38 not taken.
✗ Branch 37 → 39 not taken.
cbs_h265_write_vui_parameters:
✗ Branch 37 → 38 not taken.
✓ Branch 37 → 39 taken 4 times.
4 flag(colour_description_present_flag);
347
1/4
cbs_h265_read_vui_parameters:
✗ Branch 39 → 40 not taken.
✗ Branch 39 → 50 not taken.
cbs_h265_write_vui_parameters:
✓ Branch 39 → 40 taken 4 times.
✗ Branch 39 → 49 not taken.
4 if (current->colour_description_present_flag) {
348
1/4
cbs_h265_read_vui_parameters:
✗ Branch 41 → 42 not taken.
✗ Branch 41 → 43 not taken.
cbs_h265_write_vui_parameters:
✗ Branch 41 → 42 not taken.
✓ Branch 41 → 43 taken 4 times.
4 ub(8, colour_primaries);
349
1/4
cbs_h265_read_vui_parameters:
✗ Branch 44 → 45 not taken.
✗ Branch 44 → 46 not taken.
cbs_h265_write_vui_parameters:
✗ Branch 44 → 45 not taken.
✓ Branch 44 → 46 taken 4 times.
4 ub(8, transfer_characteristics);
350
1/4
cbs_h265_read_vui_parameters:
✗ Branch 47 → 48 not taken.
✗ Branch 47 → 49 not taken.
cbs_h265_write_vui_parameters:
✗ Branch 47 → 48 not taken.
✓ Branch 47 → 73 taken 4 times.
4 ub(8, matrix_coefficients);
351 } else {
352
0/2
✗ Branch 49 → 50 not taken.
✗ Branch 49 → 52 not taken.
✗ infer(colour_primaries, 2);
353
0/2
✗ Branch 52 → 53 not taken.
✗ Branch 52 → 55 not taken.
✗ infer(transfer_characteristics, 2);
354
0/2
✗ Branch 55 → 56 not taken.
✗ Branch 55 → 73 not taken.
✗ infer(matrix_coefficients, 2);
355 }
356 } else {
357
1/2
✗ Branch 58 → 59 not taken.
✓ Branch 58 → 61 taken 29 times.
58 infer(video_format, 5);
358
1/2
✗ Branch 61 → 62 not taken.
✓ Branch 61 → 64 taken 29 times.
58 infer(video_full_range_flag, 0);
359
1/2
✗ Branch 64 → 65 not taken.
✓ Branch 64 → 67 taken 29 times.
58 infer(colour_primaries, 2);
360
1/2
✗ Branch 67 → 68 not taken.
✓ Branch 67 → 70 taken 29 times.
58 infer(transfer_characteristics, 2);
361
1/2
✗ Branch 70 → 71 not taken.
✓ Branch 70 → 73 taken 29 times.
58 infer(matrix_coefficients, 2);
362 }
363
364
2/4
cbs_h265_read_vui_parameters:
✗ Branch 53 → 54 not taken.
✓ Branch 53 → 55 taken 29 times.
cbs_h265_write_vui_parameters:
✗ Branch 74 → 75 not taken.
✓ Branch 74 → 76 taken 33 times.
62 flag(chroma_loc_info_present_flag);
365
2/4
cbs_h265_read_vui_parameters:
✗ Branch 55 → 56 not taken.
✓ Branch 55 → 63 taken 29 times.
cbs_h265_write_vui_parameters:
✗ Branch 76 → 77 not taken.
✓ Branch 76 → 84 taken 33 times.
62 if (current->chroma_loc_info_present_flag) {
366
0/4
cbs_h265_read_vui_parameters:
✗ Branch 57 → 58 not taken.
✗ Branch 57 → 59 not taken.
cbs_h265_write_vui_parameters:
✗ Branch 78 → 79 not taken.
✗ Branch 78 → 80 not taken.
✗ ue(chroma_sample_loc_type_top_field, 0, 5);
367
0/4
cbs_h265_read_vui_parameters:
✗ Branch 60 → 61 not taken.
✗ Branch 60 → 62 not taken.
cbs_h265_write_vui_parameters:
✗ Branch 81 → 82 not taken.
✗ Branch 81 → 83 not taken.
✗ ue(chroma_sample_loc_type_bottom_field, 0, 5);
368 } else {
369
1/2
✗ Branch 84 → 85 not taken.
✓ Branch 84 → 87 taken 33 times.
62 infer(chroma_sample_loc_type_top_field, 0);
370
1/2
✗ Branch 87 → 88 not taken.
✓ Branch 87 → 90 taken 33 times.
62 infer(chroma_sample_loc_type_bottom_field, 0);
371 }
372
373
2/4
cbs_h265_read_vui_parameters:
✗ Branch 65 → 66 not taken.
✓ Branch 65 → 67 taken 29 times.
cbs_h265_write_vui_parameters:
✗ Branch 91 → 92 not taken.
✓ Branch 91 → 93 taken 33 times.
62 flag(neutral_chroma_indication_flag);
374
2/4
cbs_h265_read_vui_parameters:
✗ Branch 68 → 69 not taken.
✓ Branch 68 → 70 taken 29 times.
cbs_h265_write_vui_parameters:
✗ Branch 94 → 95 not taken.
✓ Branch 94 → 96 taken 33 times.
62 flag(field_seq_flag);
375
2/4
cbs_h265_read_vui_parameters:
✗ Branch 71 → 72 not taken.
✓ Branch 71 → 73 taken 29 times.
cbs_h265_write_vui_parameters:
✗ Branch 97 → 98 not taken.
✓ Branch 97 → 99 taken 33 times.
62 flag(frame_field_info_present_flag);
376
377
2/4
cbs_h265_read_vui_parameters:
✗ Branch 74 → 75 not taken.
✓ Branch 74 → 76 taken 29 times.
cbs_h265_write_vui_parameters:
✗ Branch 100 → 101 not taken.
✓ Branch 100 → 102 taken 33 times.
62 flag(default_display_window_flag);
378
4/4
cbs_h265_read_vui_parameters:
✓ Branch 76 → 77 taken 14 times.
✓ Branch 76 → 90 taken 15 times.
cbs_h265_write_vui_parameters:
✓ Branch 102 → 103 taken 14 times.
✓ Branch 102 → 116 taken 19 times.
62 if (current->default_display_window_flag) {
379
2/4
cbs_h265_read_vui_parameters:
✗ Branch 78 → 79 not taken.
✓ Branch 78 → 80 taken 14 times.
cbs_h265_write_vui_parameters:
✗ Branch 104 → 105 not taken.
✓ Branch 104 → 106 taken 14 times.
28 ue(def_disp_win_left_offset, 0, 16384);
380
2/4
cbs_h265_read_vui_parameters:
✗ Branch 81 → 82 not taken.
✓ Branch 81 → 83 taken 14 times.
cbs_h265_write_vui_parameters:
✗ Branch 107 → 108 not taken.
✓ Branch 107 → 109 taken 14 times.
28 ue(def_disp_win_right_offset, 0, 16384);
381
2/4
cbs_h265_read_vui_parameters:
✗ Branch 84 → 85 not taken.
✓ Branch 84 → 86 taken 14 times.
cbs_h265_write_vui_parameters:
✗ Branch 110 → 111 not taken.
✓ Branch 110 → 112 taken 14 times.
28 ue(def_disp_win_top_offset, 0, 16384);
382
2/4
cbs_h265_read_vui_parameters:
✗ Branch 87 → 88 not taken.
✓ Branch 87 → 89 taken 14 times.
cbs_h265_write_vui_parameters:
✗ Branch 113 → 114 not taken.
✓ Branch 113 → 115 taken 14 times.
28 ue(def_disp_win_bottom_offset, 0, 16384);
383 }
384
385
2/4
cbs_h265_read_vui_parameters:
✗ Branch 91 → 92 not taken.
✓ Branch 91 → 93 taken 29 times.
cbs_h265_write_vui_parameters:
✗ Branch 117 → 118 not taken.
✓ Branch 117 → 119 taken 33 times.
62 flag(vui_timing_info_present_flag);
386
4/4
cbs_h265_read_vui_parameters:
✓ Branch 93 → 94 taken 7 times.
✓ Branch 93 → 115 taken 22 times.
cbs_h265_write_vui_parameters:
✓ Branch 119 → 120 taken 7 times.
✓ Branch 119 → 141 taken 26 times.
62 if (current->vui_timing_info_present_flag) {
387
2/4
cbs_h265_read_vui_parameters:
✗ Branch 95 → 96 not taken.
✓ Branch 95 → 97 taken 7 times.
cbs_h265_write_vui_parameters:
✗ Branch 121 → 122 not taken.
✓ Branch 121 → 123 taken 7 times.
14 u(32, vui_num_units_in_tick, 1, UINT32_MAX);
388
2/4
cbs_h265_read_vui_parameters:
✗ Branch 98 → 99 not taken.
✓ Branch 98 → 100 taken 7 times.
cbs_h265_write_vui_parameters:
✗ Branch 124 → 125 not taken.
✓ Branch 124 → 126 taken 7 times.
14 u(32, vui_time_scale, 1, UINT32_MAX);
389
2/4
cbs_h265_read_vui_parameters:
✗ Branch 101 → 102 not taken.
✓ Branch 101 → 103 taken 7 times.
cbs_h265_write_vui_parameters:
✗ Branch 127 → 128 not taken.
✓ Branch 127 → 129 taken 7 times.
14 flag(vui_poc_proportional_to_timing_flag);
390
4/4
cbs_h265_read_vui_parameters:
✓ Branch 103 → 104 taken 2 times.
✓ Branch 103 → 108 taken 5 times.
cbs_h265_write_vui_parameters:
✓ Branch 129 → 130 taken 2 times.
✓ Branch 129 → 134 taken 5 times.
14 if (current->vui_poc_proportional_to_timing_flag)
391
2/4
cbs_h265_read_vui_parameters:
✗ Branch 105 → 106 not taken.
✓ Branch 105 → 107 taken 2 times.
cbs_h265_write_vui_parameters:
✗ Branch 131 → 132 not taken.
✓ Branch 131 → 133 taken 2 times.
4 ue(vui_num_ticks_poc_diff_one_minus1, 0, UINT32_MAX - 1);
392
393
2/4
cbs_h265_read_vui_parameters:
✗ Branch 109 → 110 not taken.
✓ Branch 109 → 111 taken 7 times.
cbs_h265_write_vui_parameters:
✗ Branch 135 → 136 not taken.
✓ Branch 135 → 137 taken 7 times.
14 flag(vui_hrd_parameters_present_flag);
394
4/4
cbs_h265_read_vui_parameters:
✓ Branch 111 → 112 taken 4 times.
✓ Branch 111 → 115 taken 3 times.
cbs_h265_write_vui_parameters:
✓ Branch 137 → 138 taken 4 times.
✓ Branch 137 → 141 taken 3 times.
14 if (current->vui_hrd_parameters_present_flag) {
395
2/4
cbs_h265_read_vui_parameters:
✗ Branch 113 → 114 not taken.
✓ Branch 113 → 115 taken 4 times.
cbs_h265_write_vui_parameters:
✗ Branch 139 → 140 not taken.
✓ Branch 139 → 141 taken 4 times.
8 CHECK(FUNC(hrd_parameters)(ctx, rw, &current->hrd_parameters,
396 1, sps->sps_max_sub_layers_minus1));
397 }
398 }
399
400
2/4
cbs_h265_read_vui_parameters:
✗ Branch 116 → 117 not taken.
✓ Branch 116 → 118 taken 29 times.
cbs_h265_write_vui_parameters:
✗ Branch 142 → 143 not taken.
✓ Branch 142 → 144 taken 33 times.
62 flag(bitstream_restriction_flag);
401
4/4
cbs_h265_read_vui_parameters:
✓ Branch 118 → 119 taken 12 times.
✓ Branch 118 → 144 taken 17 times.
cbs_h265_write_vui_parameters:
✓ Branch 144 → 145 taken 12 times.
✓ Branch 144 → 170 taken 21 times.
62 if (current->bitstream_restriction_flag) {
402
2/4
cbs_h265_read_vui_parameters:
✗ Branch 120 → 121 not taken.
✓ Branch 120 → 122 taken 12 times.
cbs_h265_write_vui_parameters:
✗ Branch 146 → 147 not taken.
✓ Branch 146 → 148 taken 12 times.
24 flag(tiles_fixed_structure_flag);
403
2/4
cbs_h265_read_vui_parameters:
✗ Branch 123 → 124 not taken.
✓ Branch 123 → 125 taken 12 times.
cbs_h265_write_vui_parameters:
✗ Branch 149 → 150 not taken.
✓ Branch 149 → 151 taken 12 times.
24 flag(motion_vectors_over_pic_boundaries_flag);
404
2/4
cbs_h265_read_vui_parameters:
✗ Branch 126 → 127 not taken.
✓ Branch 126 → 128 taken 12 times.
cbs_h265_write_vui_parameters:
✗ Branch 152 → 153 not taken.
✓ Branch 152 → 154 taken 12 times.
24 flag(restricted_ref_pic_lists_flag);
405
2/4
cbs_h265_read_vui_parameters:
✗ Branch 129 → 130 not taken.
✓ Branch 129 → 131 taken 12 times.
cbs_h265_write_vui_parameters:
✗ Branch 155 → 156 not taken.
✓ Branch 155 → 157 taken 12 times.
24 ue(min_spatial_segmentation_idc, 0, 4095);
406
2/4
cbs_h265_read_vui_parameters:
✗ Branch 132 → 133 not taken.
✓ Branch 132 → 134 taken 12 times.
cbs_h265_write_vui_parameters:
✗ Branch 158 → 159 not taken.
✓ Branch 158 → 160 taken 12 times.
24 ue(max_bytes_per_pic_denom, 0, 16);
407
2/4
cbs_h265_read_vui_parameters:
✗ Branch 135 → 136 not taken.
✓ Branch 135 → 137 taken 12 times.
cbs_h265_write_vui_parameters:
✗ Branch 161 → 162 not taken.
✓ Branch 161 → 163 taken 12 times.
24 ue(max_bits_per_min_cu_denom, 0, 16);
408
2/4
cbs_h265_read_vui_parameters:
✗ Branch 138 → 139 not taken.
✓ Branch 138 → 140 taken 12 times.
cbs_h265_write_vui_parameters:
✗ Branch 164 → 165 not taken.
✓ Branch 164 → 166 taken 12 times.
24 ue(log2_max_mv_length_horizontal, 0, 16);
409
2/4
cbs_h265_read_vui_parameters:
✗ Branch 141 → 142 not taken.
✓ Branch 141 → 143 taken 12 times.
cbs_h265_write_vui_parameters:
✗ Branch 167 → 168 not taken.
✓ Branch 167 → 169 taken 12 times.
24 ue(log2_max_mv_length_vertical, 0, 16);
410 } else {
411
1/2
✗ Branch 170 → 171 not taken.
✓ Branch 170 → 173 taken 21 times.
38 infer(tiles_fixed_structure_flag, 0);
412
1/2
✗ Branch 173 → 174 not taken.
✓ Branch 173 → 176 taken 21 times.
38 infer(motion_vectors_over_pic_boundaries_flag, 1);
413
1/2
✗ Branch 176 → 177 not taken.
✓ Branch 176 → 179 taken 21 times.
38 infer(min_spatial_segmentation_idc, 0);
414
1/2
✗ Branch 179 → 180 not taken.
✓ Branch 179 → 182 taken 21 times.
38 infer(max_bytes_per_pic_denom, 2);
415
1/2
✗ Branch 182 → 183 not taken.
✓ Branch 182 → 185 taken 21 times.
38 infer(max_bits_per_min_cu_denom, 1);
416
1/2
✗ Branch 185 → 186 not taken.
✓ Branch 185 → 188 taken 21 times.
38 infer(log2_max_mv_length_horizontal, 15);
417
1/2
✗ Branch 188 → 189 not taken.
✓ Branch 188 → 191 taken 21 times.
38 infer(log2_max_mv_length_vertical, 15);
418 }
419
420 62 return 0;
421 }
422
423 132 static int FUNC(vps)(CodedBitstreamContext *ctx, RWContext *rw,
424 H265RawVPS *current)
425 {
426 int err, i, j;
427
428 132 HEADER("Video Parameter Set");
429
430
2/4
cbs_h265_read_vps:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 69 times.
cbs_h265_write_vps:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 63 times.
132 CHECK(FUNC(nal_unit_header)(ctx, rw, &current->nal_unit_header, HEVC_NAL_VPS));
431
432
2/4
cbs_h265_read_vps:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 69 times.
cbs_h265_write_vps:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 63 times.
132 ub(4, vps_video_parameter_set_id);
433
434
2/4
cbs_h265_read_vps:
✗ Branch 10 → 11 not taken.
✓ Branch 10 → 12 taken 69 times.
cbs_h265_write_vps:
✗ Branch 10 → 11 not taken.
✓ Branch 10 → 12 taken 63 times.
132 flag(vps_base_layer_internal_flag);
435
2/4
cbs_h265_read_vps:
✗ Branch 13 → 14 not taken.
✓ Branch 13 → 15 taken 69 times.
cbs_h265_write_vps:
✗ Branch 13 → 14 not taken.
✓ Branch 13 → 15 taken 63 times.
132 flag(vps_base_layer_available_flag);
436
2/4
cbs_h265_read_vps:
✗ Branch 16 → 17 not taken.
✓ Branch 16 → 18 taken 69 times.
cbs_h265_write_vps:
✗ Branch 16 → 17 not taken.
✓ Branch 16 → 18 taken 63 times.
132 u(6, vps_max_layers_minus1, 0, HEVC_MAX_LAYERS - 1);
437
2/4
cbs_h265_read_vps:
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 69 times.
cbs_h265_write_vps:
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 63 times.
132 u(3, vps_max_sub_layers_minus1, 0, HEVC_MAX_SUB_LAYERS - 1);
438
2/4
cbs_h265_read_vps:
✗ Branch 22 → 23 not taken.
✓ Branch 22 → 24 taken 69 times.
cbs_h265_write_vps:
✗ Branch 22 → 23 not taken.
✓ Branch 22 → 24 taken 63 times.
132 flag(vps_temporal_id_nesting_flag);
439
440
4/4
cbs_h265_read_vps:
✓ Branch 24 → 25 taken 57 times.
✓ Branch 24 → 28 taken 12 times.
cbs_h265_write_vps:
✓ Branch 24 → 25 taken 51 times.
✓ Branch 24 → 28 taken 12 times.
132 if (current->vps_max_sub_layers_minus1 == 0 &&
441
2/4
cbs_h265_read_vps:
✗ Branch 25 → 26 not taken.
✓ Branch 25 → 28 taken 57 times.
cbs_h265_write_vps:
✗ Branch 25 → 26 not taken.
✓ Branch 25 → 28 taken 51 times.
108 current->vps_temporal_id_nesting_flag != 1) {
442 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid stream: "
443 "vps_temporal_id_nesting_flag must be 1 if "
444 "vps_max_sub_layers_minus1 is 0.\n");
445 ✗ return AVERROR_INVALIDDATA;
446 }
447
448
2/4
cbs_h265_read_vps:
✗ Branch 29 → 30 not taken.
✓ Branch 29 → 31 taken 69 times.
cbs_h265_write_vps:
✗ Branch 29 → 30 not taken.
✓ Branch 29 → 31 taken 63 times.
132 fixed(16, vps_reserved_0xffff_16bits, 0xffff);
449
450
2/4
cbs_h265_read_vps:
✗ Branch 32 → 33 not taken.
✓ Branch 32 → 34 taken 69 times.
cbs_h265_write_vps:
✗ Branch 32 → 33 not taken.
✓ Branch 32 → 34 taken 63 times.
132 CHECK(FUNC(profile_tier_level)(ctx, rw, &current->profile_tier_level,
451 1, current->vps_max_sub_layers_minus1));
452
453
2/4
cbs_h265_read_vps:
✗ Branch 35 → 36 not taken.
✓ Branch 35 → 37 taken 69 times.
cbs_h265_write_vps:
✗ Branch 35 → 36 not taken.
✓ Branch 35 → 37 taken 63 times.
132 flag(vps_sub_layer_ordering_info_present_flag);
454 132 for (i = (current->vps_sub_layer_ordering_info_present_flag ?
455
4/4
cbs_h265_read_vps:
✓ Branch 37 → 38 taken 12 times.
✓ Branch 37 → 39 taken 57 times.
cbs_h265_write_vps:
✓ Branch 37 → 38 taken 12 times.
✓ Branch 37 → 39 taken 51 times.
132 0 : current->vps_max_sub_layers_minus1);
456
4/4
cbs_h265_read_vps:
✓ Branch 51 → 41 taken 73 times.
✓ Branch 51 → 52 taken 69 times.
cbs_h265_write_vps:
✓ Branch 51 → 41 taken 67 times.
✓ Branch 51 → 52 taken 63 times.
272 i <= current->vps_max_sub_layers_minus1; i++) {
457
2/4
cbs_h265_read_vps:
✗ Branch 42 → 43 not taken.
✓ Branch 42 → 44 taken 73 times.
cbs_h265_write_vps:
✗ Branch 42 → 43 not taken.
✓ Branch 42 → 44 taken 67 times.
140 ues(vps_max_dec_pic_buffering_minus1[i],
458 0, HEVC_MAX_DPB_SIZE - 1, 1, i);
459
2/4
cbs_h265_read_vps:
✗ Branch 45 → 46 not taken.
✓ Branch 45 → 47 taken 73 times.
cbs_h265_write_vps:
✗ Branch 45 → 46 not taken.
✓ Branch 45 → 47 taken 67 times.
140 ues(vps_max_num_reorder_pics[i],
460 0, current->vps_max_dec_pic_buffering_minus1[i], 1, i);
461
2/4
cbs_h265_read_vps:
✗ Branch 48 → 49 not taken.
✓ Branch 48 → 50 taken 73 times.
cbs_h265_write_vps:
✗ Branch 48 → 49 not taken.
✓ Branch 48 → 50 taken 67 times.
140 ues(vps_max_latency_increase_plus1[i],
462 0, UINT32_MAX - 1, 1, i);
463 }
464
4/4
cbs_h265_read_vps:
✓ Branch 52 → 53 taken 12 times.
✓ Branch 52 → 56 taken 57 times.
cbs_h265_write_vps:
✓ Branch 52 → 53 taken 12 times.
✓ Branch 52 → 65 taken 51 times.
132 if (!current->vps_sub_layer_ordering_info_present_flag) {
465
4/4
cbs_h265_read_vps:
✓ Branch 55 → 54 taken 20 times.
✓ Branch 55 → 56 taken 12 times.
cbs_h265_write_vps:
✓ Branch 64 → 54 taken 20 times.
✓ Branch 64 → 65 taken 12 times.
64 for (i = 0; i < current->vps_max_sub_layers_minus1; i++) {
466
1/2
✗ Branch 54 → 55 not taken.
✓ Branch 54 → 57 taken 20 times.
40 infer(vps_max_dec_pic_buffering_minus1[i],
467 current->vps_max_dec_pic_buffering_minus1[current->vps_max_sub_layers_minus1]);
468
1/2
✗ Branch 57 → 58 not taken.
✓ Branch 57 → 60 taken 20 times.
40 infer(vps_max_num_reorder_pics[i],
469 current->vps_max_num_reorder_pics[current->vps_max_sub_layers_minus1]);
470
1/2
✗ Branch 60 → 61 not taken.
✓ Branch 60 → 63 taken 20 times.
40 infer(vps_max_latency_increase_plus1[i],
471 current->vps_max_latency_increase_plus1[current->vps_max_sub_layers_minus1]);
472 }
473 }
474
475
2/4
cbs_h265_read_vps:
✗ Branch 57 → 58 not taken.
✓ Branch 57 → 59 taken 69 times.
cbs_h265_write_vps:
✗ Branch 66 → 67 not taken.
✓ Branch 66 → 68 taken 63 times.
132 u(6, vps_max_layer_id, 0, HEVC_MAX_LAYERS - 1);
476
2/4
cbs_h265_read_vps:
✗ Branch 60 → 61 not taken.
✓ Branch 60 → 62 taken 69 times.
cbs_h265_write_vps:
✗ Branch 69 → 70 not taken.
✓ Branch 69 → 71 taken 63 times.
132 ue(vps_num_layer_sets_minus1, 0, HEVC_MAX_LAYER_SETS - 1);
477
2/4
cbs_h265_read_vps:
✗ Branch 70 → 63 not taken.
✓ Branch 70 → 71 taken 69 times.
cbs_h265_write_vps:
✗ Branch 79 → 72 not taken.
✓ Branch 79 → 80 taken 63 times.
132 for (i = 1; i <= current->vps_num_layer_sets_minus1; i++) {
478
0/4
cbs_h265_read_vps:
✗ Branch 68 → 64 not taken.
✗ Branch 68 → 69 not taken.
cbs_h265_write_vps:
✗ Branch 77 → 73 not taken.
✗ Branch 77 → 78 not taken.
✗ for (j = 0; j <= current->vps_max_layer_id; j++)
479
0/4
cbs_h265_read_vps:
✗ Branch 65 → 66 not taken.
✗ Branch 65 → 67 not taken.
cbs_h265_write_vps:
✗ Branch 74 → 75 not taken.
✗ Branch 74 → 76 not taken.
✗ flags(layer_id_included_flag[i][j], 2, i, j);
480 }
481
4/4
cbs_h265_read_vps:
✓ Branch 73 → 72 taken 69 times.
✓ Branch 73 → 74 taken 69 times.
cbs_h265_write_vps:
✓ Branch 85 → 81 taken 63 times.
✓ Branch 85 → 86 taken 63 times.
264 for (j = 0; j <= current->vps_max_layer_id; j++)
482
1/2
✗ Branch 81 → 82 not taken.
✓ Branch 81 → 84 taken 63 times.
132 infer(layer_id_included_flag[0][j], j == 0);
483
484
2/4
cbs_h265_read_vps:
✗ Branch 75 → 76 not taken.
✓ Branch 75 → 77 taken 69 times.
cbs_h265_write_vps:
✗ Branch 87 → 88 not taken.
✓ Branch 87 → 89 taken 63 times.
132 flag(vps_timing_info_present_flag);
485
4/4
cbs_h265_read_vps:
✓ Branch 77 → 78 taken 2 times.
✓ Branch 77 → 115 taken 67 times.
cbs_h265_write_vps:
✓ Branch 89 → 90 taken 2 times.
✓ Branch 89 → 128 taken 61 times.
132 if (current->vps_timing_info_present_flag) {
486
2/4
cbs_h265_read_vps:
✗ Branch 79 → 80 not taken.
✓ Branch 79 → 81 taken 2 times.
cbs_h265_write_vps:
✗ Branch 91 → 92 not taken.
✓ Branch 91 → 93 taken 2 times.
4 u(32, vps_num_units_in_tick, 1, UINT32_MAX);
487
2/4
cbs_h265_read_vps:
✗ Branch 82 → 83 not taken.
✓ Branch 82 → 84 taken 2 times.
cbs_h265_write_vps:
✗ Branch 94 → 95 not taken.
✓ Branch 94 → 96 taken 2 times.
4 u(32, vps_time_scale, 1, UINT32_MAX);
488
2/4
cbs_h265_read_vps:
✗ Branch 85 → 86 not taken.
✓ Branch 85 → 87 taken 2 times.
cbs_h265_write_vps:
✗ Branch 97 → 98 not taken.
✓ Branch 97 → 99 taken 2 times.
4 flag(vps_poc_proportional_to_timing_flag);
489
2/4
cbs_h265_read_vps:
✓ Branch 87 → 88 taken 2 times.
✗ Branch 87 → 92 not taken.
cbs_h265_write_vps:
✓ Branch 99 → 100 taken 2 times.
✗ Branch 99 → 104 not taken.
4 if (current->vps_poc_proportional_to_timing_flag)
490
2/4
cbs_h265_read_vps:
✗ Branch 89 → 90 not taken.
✓ Branch 89 → 91 taken 2 times.
cbs_h265_write_vps:
✗ Branch 101 → 102 not taken.
✓ Branch 101 → 103 taken 2 times.
4 ue(vps_num_ticks_poc_diff_one_minus1, 0, UINT32_MAX - 1);
491
2/4
cbs_h265_read_vps:
✗ Branch 93 → 94 not taken.
✓ Branch 93 → 95 taken 2 times.
cbs_h265_write_vps:
✗ Branch 105 → 106 not taken.
✓ Branch 105 → 107 taken 2 times.
4 ue(vps_num_hrd_parameters, 0, current->vps_num_layer_sets_minus1 + 1);
492
2/4
cbs_h265_read_vps:
✗ Branch 95 → 96 not taken.
✓ Branch 95 → 100 taken 2 times.
cbs_h265_write_vps:
✗ Branch 107 → 108 not taken.
✓ Branch 107 → 111 taken 2 times.
4 if (current->vps_num_hrd_parameters > 0)
493
0/4
cbs_h265_read_vps:
✗ Branch 97 → 98 not taken.
✗ Branch 97 → 99 not taken.
cbs_h265_write_vps:
✗ Branch 108 → 109 not taken.
✗ Branch 108 → 111 not taken.
✗ allocate(current->hrd_parameters,
494 current->vps_num_hrd_parameters *
495 sizeof(*current->hrd_parameters));
496
2/4
cbs_h265_read_vps:
✗ Branch 114 → 101 not taken.
✓ Branch 114 → 115 taken 2 times.
cbs_h265_write_vps:
✗ Branch 127 → 112 not taken.
✓ Branch 127 → 128 taken 2 times.
4 for (i = 0; i < current->vps_num_hrd_parameters; i++) {
497
0/4
cbs_h265_read_vps:
✗ Branch 102 → 103 not taken.
✗ Branch 102 → 104 not taken.
cbs_h265_write_vps:
✗ Branch 113 → 114 not taken.
✗ Branch 113 → 115 not taken.
✗ ues(hrd_layer_set_idx[i],
498 current->vps_base_layer_internal_flag ? 0 : 1,
499 current->vps_num_layer_sets_minus1, 1, i);
500
0/4
cbs_h265_read_vps:
✗ Branch 104 → 105 not taken.
✗ Branch 104 → 109 not taken.
cbs_h265_write_vps:
✗ Branch 115 → 116 not taken.
✗ Branch 115 → 120 not taken.
✗ if (i > 0)
501
0/4
cbs_h265_read_vps:
✗ Branch 106 → 107 not taken.
✗ Branch 106 → 108 not taken.
cbs_h265_write_vps:
✗ Branch 117 → 118 not taken.
✗ Branch 117 → 119 not taken.
✗ flags(cprms_present_flag[i], 1, i);
502 else
503
0/2
✗ Branch 120 → 121 not taken.
✗ Branch 120 → 123 not taken.
✗ infer(cprms_present_flag[0], 1);
504
505
0/4
cbs_h265_read_vps:
✗ Branch 111 → 112 not taken.
✗ Branch 111 → 113 not taken.
cbs_h265_write_vps:
✗ Branch 124 → 125 not taken.
✗ Branch 124 → 126 not taken.
✗ CHECK(FUNC(hrd_parameters)(ctx, rw, &current->hrd_parameters[i],
506 current->cprms_present_flag[i],
507 current->vps_max_sub_layers_minus1));
508 }
509 }
510
511
2/4
cbs_h265_read_vps:
✗ Branch 116 → 117 not taken.
✓ Branch 116 → 118 taken 69 times.
cbs_h265_write_vps:
✗ Branch 129 → 130 not taken.
✓ Branch 129 → 131 taken 63 times.
132 flag(vps_extension_flag);
512
2/4
cbs_h265_read_vps:
✗ Branch 118 → 119 not taken.
✓ Branch 118 → 122 taken 69 times.
cbs_h265_write_vps:
✗ Branch 131 → 132 not taken.
✓ Branch 131 → 135 taken 63 times.
132 if (current->vps_extension_flag)
513
0/4
cbs_h265_read_vps:
✗ Branch 120 → 121 not taken.
✗ Branch 120 → 122 not taken.
cbs_h265_write_vps:
✗ Branch 133 → 134 not taken.
✗ Branch 133 → 135 not taken.
✗ CHECK(FUNC(extension_data)(ctx, rw, &current->extension_data));
514
515
2/4
cbs_h265_read_vps:
✗ Branch 123 → 124 not taken.
✓ Branch 123 → 125 taken 69 times.
cbs_h265_write_vps:
✗ Branch 136 → 137 not taken.
✓ Branch 136 → 138 taken 63 times.
132 CHECK(FUNC(rbsp_trailing_bits)(ctx, rw));
516
517 132 return 0;
518 }
519
520 4977 static int FUNC(st_ref_pic_set)(CodedBitstreamContext *ctx, RWContext *rw,
521 H265RawSTRefPicSet *current, int st_rps_idx,
522 const H265RawSPS *sps)
523 {
524 int err, i, j;
525
526
4/4
cbs_h265_read_st_ref_pic_set:
✓ Branch 2 → 3 taken 2461 times.
✓ Branch 2 → 7 taken 96 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 2 → 3 taken 2332 times.
✓ Branch 2 → 6 taken 88 times.
4977 if (st_rps_idx != 0)
527
2/4
cbs_h265_read_st_ref_pic_set:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 2461 times.
cbs_h265_write_st_ref_pic_set:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 9 taken 2332 times.
4793 flag(inter_ref_pic_set_prediction_flag);
528 else
529
1/2
✗ Branch 6 → 7 not taken.
✓ Branch 6 → 9 taken 88 times.
184 infer(inter_ref_pic_set_prediction_flag, 0);
530
531
4/4
cbs_h265_read_st_ref_pic_set:
✓ Branch 8 → 9 taken 742 times.
✓ Branch 8 → 91 taken 1815 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 9 → 10 taken 626 times.
✓ Branch 9 → 120 taken 1794 times.
4977 if (current->inter_ref_pic_set_prediction_flag) {
532 unsigned int ref_rps_idx, num_delta_pocs, num_ref_pics;
533 const H265RawSTRefPicSet *ref;
534 int delta_rps, d_poc;
535 int ref_delta_poc_s0[HEVC_MAX_REFS], ref_delta_poc_s1[HEVC_MAX_REFS];
536 int delta_poc_s0[HEVC_MAX_REFS], delta_poc_s1[HEVC_MAX_REFS];
537 uint8_t used_by_curr_pic_s0[HEVC_MAX_REFS],
538 used_by_curr_pic_s1[HEVC_MAX_REFS];
539
540
4/4
cbs_h265_read_st_ref_pic_set:
✓ Branch 9 → 10 taken 236 times.
✓ Branch 9 → 14 taken 506 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 10 → 11 taken 192 times.
✓ Branch 10 → 15 taken 434 times.
1368 if (st_rps_idx == sps->num_short_term_ref_pic_sets)
541
2/4
cbs_h265_read_st_ref_pic_set:
✗ Branch 11 → 12 not taken.
✓ Branch 11 → 13 taken 236 times.
cbs_h265_write_st_ref_pic_set:
✗ Branch 12 → 13 not taken.
✓ Branch 12 → 14 taken 192 times.
428 ue(delta_idx_minus1, 0, st_rps_idx - 1);
542 else
543
1/2
✗ Branch 15 → 16 not taken.
✓ Branch 15 → 18 taken 434 times.
940 infer(delta_idx_minus1, 0);
544
545 1368 ref_rps_idx = st_rps_idx - (current->delta_idx_minus1 + 1);
546 1368 ref = &sps->st_ref_pic_set[ref_rps_idx];
547 1368 num_delta_pocs = ref->num_negative_pics + ref->num_positive_pics;
548
2/4
cbs_h265_read_st_ref_pic_set:
✗ Branch 15 → 16 not taken.
✓ Branch 15 → 18 taken 742 times.
cbs_h265_write_st_ref_pic_set:
✗ Branch 18 → 19 not taken.
✓ Branch 18 → 21 taken 626 times.
1368 av_assert0(num_delta_pocs < HEVC_MAX_DPB_SIZE);
549
550
2/4
cbs_h265_read_st_ref_pic_set:
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 742 times.
cbs_h265_write_st_ref_pic_set:
✗ Branch 22 → 23 not taken.
✓ Branch 22 → 24 taken 626 times.
1368 flag(delta_rps_sign);
551
2/4
cbs_h265_read_st_ref_pic_set:
✗ Branch 22 → 23 not taken.
✓ Branch 22 → 24 taken 742 times.
cbs_h265_write_st_ref_pic_set:
✗ Branch 25 → 26 not taken.
✓ Branch 25 → 27 taken 626 times.
1368 ue(abs_delta_rps_minus1, 0, INT16_MAX);
552 1368 delta_rps = (1 - 2 * current->delta_rps_sign) *
553 1368 (current->abs_delta_rps_minus1 + 1);
554
555 1368 num_ref_pics = 0;
556
4/4
cbs_h265_read_st_ref_pic_set:
✓ Branch 37 → 25 taken 3264 times.
✓ Branch 37 → 38 taken 742 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 42 → 28 taken 2738 times.
✓ Branch 42 → 43 taken 626 times.
7370 for (j = 0; j <= num_delta_pocs; j++) {
557
2/4
cbs_h265_read_st_ref_pic_set:
✗ Branch 26 → 27 not taken.
✓ Branch 26 → 28 taken 3264 times.
cbs_h265_write_st_ref_pic_set:
✗ Branch 29 → 30 not taken.
✓ Branch 29 → 31 taken 2738 times.
6002 flags(used_by_curr_pic_flag[j], 1, j);
558
4/4
cbs_h265_read_st_ref_pic_set:
✓ Branch 28 → 29 taken 758 times.
✓ Branch 28 → 33 taken 2506 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 31 → 32 taken 609 times.
✓ Branch 31 → 36 taken 2129 times.
6002 if (!current->used_by_curr_pic_flag[j])
559
2/4
cbs_h265_read_st_ref_pic_set:
✗ Branch 30 → 31 not taken.
✓ Branch 30 → 32 taken 758 times.
cbs_h265_write_st_ref_pic_set:
✗ Branch 33 → 34 not taken.
✓ Branch 33 → 35 taken 609 times.
1367 flags(use_delta_flag[j], 1, j);
560 else
561
1/2
✗ Branch 36 → 37 not taken.
✓ Branch 36 → 39 taken 2129 times.
4635 infer(use_delta_flag[j], 1);
562
4/4
cbs_h265_read_st_ref_pic_set:
✓ Branch 34 → 35 taken 2506 times.
✓ Branch 34 → 36 taken 758 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 39 → 40 taken 2129 times.
✓ Branch 39 → 41 taken 609 times.
6002 if (current->use_delta_flag[j])
563 4635 ++num_ref_pics;
564 }
565
2/4
cbs_h265_read_st_ref_pic_set:
✗ Branch 38 → 39 not taken.
✓ Branch 38 → 41 taken 742 times.
cbs_h265_write_st_ref_pic_set:
✗ Branch 43 → 44 not taken.
✓ Branch 43 → 46 taken 626 times.
1368 if (num_ref_pics >= HEVC_MAX_DPB_SIZE) {
566 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid stream: "
567 "short-term ref pic set %d "
568 "contains too many pictures.\n", st_rps_idx);
569 ✗ return AVERROR_INVALIDDATA;
570 }
571
572 // Since the stored form of an RPS here is actually the delta-step
573 // form used when inter_ref_pic_set_prediction_flag is not set, we
574 // need to reconstruct that here in order to be able to refer to
575 // the RPS later (which is required for parsing, because we don't
576 // even know what syntax elements appear without it). Therefore,
577 // this code takes the delta-step form of the reference set, turns
578 // it into the delta-array form, applies the prediction process of
579 // 7.4.8, converts the result back to the delta-step form, and
580 // stores that as the current set for future use. Note that the
581 // inferences here mean that writers using prediction will need
582 // to fill in the delta-step values correctly as well - since the
583 // whole RPS prediction process is somewhat overly sophisticated,
584 // this hopefully forms a useful check for them to ensure their
585 // predicted form actually matches what was intended rather than
586 // an onerous additional requirement.
587
588 1368 d_poc = 0;
589
4/4
cbs_h265_read_st_ref_pic_set:
✓ Branch 43 → 42 taken 1642 times.
✓ Branch 43 → 44 taken 742 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 48 → 47 taken 1398 times.
✓ Branch 48 → 49 taken 626 times.
4408 for (i = 0; i < ref->num_negative_pics; i++) {
590 3040 d_poc -= ref->delta_poc_s0_minus1[i] + 1;
591 3040 ref_delta_poc_s0[i] = d_poc;
592 }
593 1368 d_poc = 0;
594
4/4
cbs_h265_read_st_ref_pic_set:
✓ Branch 46 → 45 taken 880 times.
✓ Branch 46 → 47 taken 742 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 51 → 50 taken 714 times.
✓ Branch 51 → 52 taken 626 times.
2962 for (i = 0; i < ref->num_positive_pics; i++) {
595 1594 d_poc += ref->delta_poc_s1_minus1[i] + 1;
596 1594 ref_delta_poc_s1[i] = d_poc;
597 }
598
599 1368 i = 0;
600
4/4
cbs_h265_read_st_ref_pic_set:
✓ Branch 52 → 48 taken 880 times.
✓ Branch 52 → 53 taken 742 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 57 → 53 taken 714 times.
✓ Branch 57 → 58 taken 626 times.
2962 for (j = ref->num_positive_pics - 1; j >= 0; j--) {
601 1594 d_poc = ref_delta_poc_s1[j] + delta_rps;
602
6/8
cbs_h265_read_st_ref_pic_set:
✓ Branch 48 → 49 taken 224 times.
✓ Branch 48 → 51 taken 656 times.
✓ Branch 49 → 50 taken 224 times.
✗ Branch 49 → 51 not taken.
cbs_h265_write_st_ref_pic_set:
✓ Branch 53 → 54 taken 182 times.
✓ Branch 53 → 56 taken 532 times.
✓ Branch 54 → 55 taken 182 times.
✗ Branch 54 → 56 not taken.
1594 if (d_poc < 0 && current->use_delta_flag[ref->num_negative_pics + j]) {
603 406 delta_poc_s0[i] = d_poc;
604 406 used_by_curr_pic_s0[i++] =
605 406 current->used_by_curr_pic_flag[ref->num_negative_pics + j];
606 }
607 }
608
8/8
cbs_h265_read_st_ref_pic_set:
✓ Branch 53 → 54 taken 352 times.
✓ Branch 53 → 56 taken 390 times.
✓ Branch 54 → 55 taken 118 times.
✓ Branch 54 → 56 taken 234 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 58 → 59 taken 310 times.
✓ Branch 58 → 61 taken 316 times.
✓ Branch 59 → 60 taken 118 times.
✓ Branch 59 → 61 taken 192 times.
1368 if (delta_rps < 0 && current->use_delta_flag[num_delta_pocs]) {
609 236 delta_poc_s0[i] = delta_rps;
610 236 used_by_curr_pic_s0[i++] =
611 236 current->used_by_curr_pic_flag[num_delta_pocs];
612 }
613
4/4
cbs_h265_read_st_ref_pic_set:
✓ Branch 61 → 57 taken 1642 times.
✓ Branch 61 → 62 taken 742 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 66 → 62 taken 1398 times.
✓ Branch 66 → 67 taken 626 times.
4408 for (j = 0; j < ref->num_negative_pics; j++) {
614 3040 d_poc = ref_delta_poc_s0[j] + delta_rps;
615
6/8
cbs_h265_read_st_ref_pic_set:
✓ Branch 57 → 58 taken 1642 times.
✗ Branch 57 → 60 not taken.
✓ Branch 58 → 59 taken 1196 times.
✓ Branch 58 → 60 taken 446 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 62 → 63 taken 1398 times.
✗ Branch 62 → 65 not taken.
✓ Branch 63 → 64 taken 1028 times.
✓ Branch 63 → 65 taken 370 times.
3040 if (d_poc < 0 && current->use_delta_flag[j]) {
616 2224 delta_poc_s0[i] = d_poc;
617 2224 used_by_curr_pic_s0[i++] = current->used_by_curr_pic_flag[j];
618 }
619 }
620
621
1/2
✗ Branch 67 → 68 not taken.
✓ Branch 67 → 70 taken 626 times.
1368 infer(num_negative_pics, i);
622
4/4
cbs_h265_read_st_ref_pic_set:
✓ Branch 67 → 63 taken 1538 times.
✓ Branch 67 → 68 taken 742 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 84 → 71 taken 1328 times.
✓ Branch 84 → 85 taken 626 times.
4234 for (i = 0; i < current->num_negative_pics; i++) {
623
5/8
cbs_h265_read_st_ref_pic_set:
✓ Branch 63 → 64 taken 826 times.
✓ Branch 63 → 65 taken 712 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 71 → 72 taken 726 times.
✓ Branch 71 → 73 taken 602 times.
✗ Branch 74 → 75 not taken.
✓ Branch 74 → 80 taken 1328 times.
✗ Branch 75 → 76 not taken.
✗ Branch 75 → 77 not taken.
2866 infer(delta_poc_s0_minus1[i],
624 -(delta_poc_s0[i] - (i == 0 ? 0 : delta_poc_s0[i - 1])) - 1);
625
1/2
✗ Branch 80 → 81 not taken.
✓ Branch 80 → 83 taken 1328 times.
2866 infer(used_by_curr_pic_s0_flag[i], used_by_curr_pic_s0[i]);
626 }
627
628 1368 i = 0;
629
4/4
cbs_h265_read_st_ref_pic_set:
✓ Branch 73 → 69 taken 1642 times.
✓ Branch 73 → 74 taken 742 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 90 → 86 taken 1398 times.
✓ Branch 90 → 91 taken 626 times.
4408 for (j = ref->num_negative_pics - 1; j >= 0; j--) {
630 3040 d_poc = ref_delta_poc_s0[j] + delta_rps;
631
2/8
cbs_h265_read_st_ref_pic_set:
✗ Branch 69 → 70 not taken.
✓ Branch 69 → 72 taken 1642 times.
✗ Branch 70 → 71 not taken.
✗ Branch 70 → 72 not taken.
cbs_h265_write_st_ref_pic_set:
✗ Branch 86 → 87 not taken.
✓ Branch 86 → 89 taken 1398 times.
✗ Branch 87 → 88 not taken.
✗ Branch 87 → 89 not taken.
3040 if (d_poc > 0 && current->use_delta_flag[j]) {
632 ✗ delta_poc_s1[i] = d_poc;
633 ✗ used_by_curr_pic_s1[i++] = current->used_by_curr_pic_flag[j];
634 }
635 }
636
8/8
cbs_h265_read_st_ref_pic_set:
✓ Branch 74 → 75 taken 390 times.
✓ Branch 74 → 77 taken 352 times.
✓ Branch 75 → 76 taken 376 times.
✓ Branch 75 → 77 taken 14 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 91 → 92 taken 316 times.
✓ Branch 91 → 94 taken 310 times.
✓ Branch 92 → 93 taken 307 times.
✓ Branch 92 → 94 taken 9 times.
1368 if (delta_rps > 0 && current->use_delta_flag[num_delta_pocs]) {
637 683 delta_poc_s1[i] = delta_rps;
638 683 used_by_curr_pic_s1[i++] =
639 683 current->used_by_curr_pic_flag[num_delta_pocs];
640 }
641
4/4
cbs_h265_read_st_ref_pic_set:
✓ Branch 82 → 78 taken 880 times.
✓ Branch 82 → 83 taken 742 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 99 → 95 taken 714 times.
✓ Branch 99 → 100 taken 626 times.
2962 for (j = 0; j < ref->num_positive_pics; j++) {
642 1594 d_poc = ref_delta_poc_s1[j] + delta_rps;
643
8/8
cbs_h265_read_st_ref_pic_set:
✓ Branch 78 → 79 taken 656 times.
✓ Branch 78 → 81 taken 224 times.
✓ Branch 79 → 80 taken 592 times.
✓ Branch 79 → 81 taken 64 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 95 → 96 taken 532 times.
✓ Branch 95 → 98 taken 182 times.
✓ Branch 96 → 97 taken 494 times.
✓ Branch 96 → 98 taken 38 times.
1594 if (d_poc > 0 && current->use_delta_flag[ref->num_negative_pics + j]) {
644 1086 delta_poc_s1[i] = d_poc;
645 1086 used_by_curr_pic_s1[i++] =
646 1086 current->used_by_curr_pic_flag[ref->num_negative_pics + j];
647 }
648 }
649
650
1/2
✗ Branch 100 → 101 not taken.
✓ Branch 100 → 103 taken 626 times.
1368 infer(num_positive_pics, i);
651
4/4
cbs_h265_read_st_ref_pic_set:
✓ Branch 88 → 84 taken 968 times.
✓ Branch 88 → 89 taken 742 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 117 → 104 taken 801 times.
✓ Branch 117 → 118 taken 626 times.
3137 for (i = 0; i < current->num_positive_pics; i++) {
652
5/8
cbs_h265_read_st_ref_pic_set:
✓ Branch 84 → 85 taken 384 times.
✓ Branch 84 → 86 taken 584 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 104 → 105 taken 321 times.
✓ Branch 104 → 106 taken 480 times.
✗ Branch 107 → 108 not taken.
✓ Branch 107 → 113 taken 801 times.
✗ Branch 108 → 109 not taken.
✗ Branch 108 → 110 not taken.
1769 infer(delta_poc_s1_minus1[i],
653 delta_poc_s1[i] - (i == 0 ? 0 : delta_poc_s1[i - 1]) - 1);
654
1/2
✗ Branch 113 → 114 not taken.
✓ Branch 113 → 116 taken 801 times.
1769 infer(used_by_curr_pic_s1_flag[i], used_by_curr_pic_s1[i]);
655 }
656
657 } else {
658
2/4
cbs_h265_read_st_ref_pic_set:
✗ Branch 92 → 93 not taken.
✓ Branch 92 → 94 taken 1815 times.
cbs_h265_write_st_ref_pic_set:
✗ Branch 121 → 122 not taken.
✓ Branch 121 → 123 taken 1794 times.
3609 ue(num_negative_pics, 0, 15);
659
2/4
cbs_h265_read_st_ref_pic_set:
✗ Branch 95 → 96 not taken.
✓ Branch 95 → 97 taken 1815 times.
cbs_h265_write_st_ref_pic_set:
✗ Branch 124 → 125 not taken.
✓ Branch 124 → 126 taken 1794 times.
3609 ue(num_positive_pics, 0, 15 - current->num_negative_pics);
660
661
4/4
cbs_h265_read_st_ref_pic_set:
✓ Branch 105 → 98 taken 4982 times.
✓ Branch 105 → 106 taken 1815 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 134 → 127 taken 4922 times.
✓ Branch 134 → 135 taken 1794 times.
13513 for (i = 0; i < current->num_negative_pics; i++) {
662
2/4
cbs_h265_read_st_ref_pic_set:
✗ Branch 99 → 100 not taken.
✓ Branch 99 → 101 taken 4982 times.
cbs_h265_write_st_ref_pic_set:
✗ Branch 128 → 129 not taken.
✓ Branch 128 → 130 taken 4922 times.
9904 ues(delta_poc_s0_minus1[i], 0, INT16_MAX, 1, i);
663
2/4
cbs_h265_read_st_ref_pic_set:
✗ Branch 102 → 103 not taken.
✓ Branch 102 → 104 taken 4982 times.
cbs_h265_write_st_ref_pic_set:
✗ Branch 131 → 132 not taken.
✓ Branch 131 → 133 taken 4922 times.
9904 flags(used_by_curr_pic_s0_flag[i], 1, i);
664 }
665
666
4/4
cbs_h265_read_st_ref_pic_set:
✓ Branch 114 → 107 taken 405 times.
✓ Branch 114 → 115 taken 1815 times.
cbs_h265_write_st_ref_pic_set:
✓ Branch 143 → 136 taken 405 times.
✓ Branch 143 → 144 taken 1794 times.
4419 for (i = 0; i < current->num_positive_pics; i++) {
667
2/4
cbs_h265_read_st_ref_pic_set:
✗ Branch 108 → 109 not taken.
✓ Branch 108 → 110 taken 405 times.
cbs_h265_write_st_ref_pic_set:
✗ Branch 137 → 138 not taken.
✓ Branch 137 → 139 taken 405 times.
810 ues(delta_poc_s1_minus1[i], 0, INT16_MAX, 1, i);
668
2/4
cbs_h265_read_st_ref_pic_set:
✗ Branch 111 → 112 not taken.
✓ Branch 111 → 113 taken 405 times.
cbs_h265_write_st_ref_pic_set:
✗ Branch 140 → 141 not taken.
✓ Branch 140 → 142 taken 405 times.
810 flags(used_by_curr_pic_s1_flag[i], 1, i);
669 }
670 }
671
672 4977 return 0;
673 }
674
675 264 static int FUNC(scaling_list_data)(CodedBitstreamContext *ctx, RWContext *rw,
676 H265RawScalingList *current)
677 {
678 int sizeId, matrixId;
679 int err, n, i;
680
681
4/4
cbs_h265_read_scaling_list_data:
✓ Branch 32 → 3 taken 704 times.
✓ Branch 32 → 33 taken 176 times.
cbs_h265_write_scaling_list_data:
✓ Branch 32 → 3 taken 352 times.
✓ Branch 32 → 33 taken 88 times.
1320 for (sizeId = 0; sizeId < 4; sizeId++) {
682
8/8
cbs_h265_read_scaling_list_data:
✓ Branch 26 → 27 taken 352 times.
✓ Branch 26 → 28 taken 3168 times.
✓ Branch 30 → 4 taken 3520 times.
✓ Branch 30 → 31 taken 704 times.
cbs_h265_write_scaling_list_data:
✓ Branch 26 → 27 taken 176 times.
✓ Branch 26 → 28 taken 1584 times.
✓ Branch 30 → 4 taken 1760 times.
✓ Branch 30 → 31 taken 352 times.
6336 for (matrixId = 0; matrixId < 6; matrixId += (sizeId == 3 ? 3 : 1)) {
683
2/4
cbs_h265_read_scaling_list_data:
✗ Branch 5 → 6 not taken.
✓ Branch 5 → 7 taken 3520 times.
cbs_h265_write_scaling_list_data:
✗ Branch 5 → 6 not taken.
✓ Branch 5 → 7 taken 1760 times.
5280 flags(scaling_list_pred_mode_flag[sizeId][matrixId],
684 2, sizeId, matrixId);
685
4/4
cbs_h265_read_scaling_list_data:
✓ Branch 7 → 8 taken 1564 times.
✓ Branch 7 → 15 taken 1956 times.
cbs_h265_write_scaling_list_data:
✓ Branch 7 → 8 taken 782 times.
✓ Branch 7 → 15 taken 978 times.
5280 if (!current->scaling_list_pred_mode_flag[sizeId][matrixId]) {
686
6/8
cbs_h265_read_scaling_list_data:
✓ Branch 8 → 9 taken 8 times.
✓ Branch 8 → 10 taken 1556 times.
✗ Branch 12 → 13 not taken.
✓ Branch 12 → 14 taken 1564 times.
cbs_h265_write_scaling_list_data:
✓ Branch 8 → 9 taken 4 times.
✓ Branch 8 → 10 taken 778 times.
✗ Branch 12 → 13 not taken.
✓ Branch 12 → 14 taken 782 times.
2346 ues(scaling_list_pred_matrix_id_delta[sizeId][matrixId],
687 0, sizeId == 3 ? matrixId / 3 : matrixId,
688 2, sizeId, matrixId);
689 } else {
690 2934 n = FFMIN(64, 1 << (4 + (sizeId << 1)));
691
4/4
cbs_h265_read_scaling_list_data:
✓ Branch 15 → 16 taken 1188 times.
✓ Branch 15 → 20 taken 768 times.
cbs_h265_write_scaling_list_data:
✓ Branch 15 → 16 taken 594 times.
✓ Branch 15 → 20 taken 384 times.
2934 if (sizeId > 1) {
692
2/4
cbs_h265_read_scaling_list_data:
✗ Branch 17 → 18 not taken.
✓ Branch 17 → 19 taken 1188 times.
cbs_h265_write_scaling_list_data:
✗ Branch 17 → 18 not taken.
✓ Branch 17 → 19 taken 594 times.
1782 ses(scaling_list_dc_coef_minus8[sizeId - 2][matrixId], -7, +247,
693 2, sizeId - 2, matrixId);
694 }
695
4/4
cbs_h265_read_scaling_list_data:
✓ Branch 25 → 21 taken 105600 times.
✓ Branch 25 → 26 taken 1956 times.
cbs_h265_write_scaling_list_data:
✓ Branch 25 → 21 taken 52800 times.
✓ Branch 25 → 26 taken 978 times.
161334 for (i = 0; i < n; i++) {
696
2/4
cbs_h265_read_scaling_list_data:
✗ Branch 22 → 23 not taken.
✓ Branch 22 → 24 taken 105600 times.
cbs_h265_write_scaling_list_data:
✗ Branch 22 → 23 not taken.
✓ Branch 22 → 24 taken 52800 times.
158400 ses(scaling_list_delta_coeff[sizeId][matrixId][i],
697 -128, +127, 3, sizeId, matrixId, i);
698 }
699 }
700 }
701 }
702
703 264 return 0;
704 }
705
706 ✗ static int FUNC(sps_range_extension)(CodedBitstreamContext *ctx, RWContext *rw,
707 H265RawSPS *current)
708 {
709 int err;
710
711
0/4
cbs_h265_read_sps_range_extension:
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 5 not taken.
cbs_h265_write_sps_range_extension:
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 5 not taken.
✗ flag(transform_skip_rotation_enabled_flag);
712
0/4
cbs_h265_read_sps_range_extension:
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 8 not taken.
cbs_h265_write_sps_range_extension:
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 8 not taken.
✗ flag(transform_skip_context_enabled_flag);
713
0/4
cbs_h265_read_sps_range_extension:
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 11 not taken.
cbs_h265_write_sps_range_extension:
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 11 not taken.
✗ flag(implicit_rdpcm_enabled_flag);
714
0/4
cbs_h265_read_sps_range_extension:
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 14 not taken.
cbs_h265_write_sps_range_extension:
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 14 not taken.
✗ flag(explicit_rdpcm_enabled_flag);
715
0/4
cbs_h265_read_sps_range_extension:
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 17 not taken.
cbs_h265_write_sps_range_extension:
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 17 not taken.
✗ flag(extended_precision_processing_flag);
716
0/4
cbs_h265_read_sps_range_extension:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
cbs_h265_write_sps_range_extension:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ flag(intra_smoothing_disabled_flag);
717
0/4
cbs_h265_read_sps_range_extension:
✗ Branch 21 → 22 not taken.
✗ Branch 21 → 23 not taken.
cbs_h265_write_sps_range_extension:
✗ Branch 21 → 22 not taken.
✗ Branch 21 → 23 not taken.
✗ flag(high_precision_offsets_enabled_flag);
718
0/4
cbs_h265_read_sps_range_extension:
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 26 not taken.
cbs_h265_write_sps_range_extension:
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 26 not taken.
✗ flag(persistent_rice_adaptation_enabled_flag);
719
0/4
cbs_h265_read_sps_range_extension:
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 29 not taken.
cbs_h265_write_sps_range_extension:
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 29 not taken.
✗ flag(cabac_bypass_alignment_enabled_flag);
720
721 ✗ return 0;
722 }
723
724 ✗ static int FUNC(sps_scc_extension)(CodedBitstreamContext *ctx, RWContext *rw,
725 H265RawSPS *current)
726 {
727 int err, comp, i;
728
729
0/4
cbs_h265_read_sps_scc_extension:
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 5 not taken.
cbs_h265_write_sps_scc_extension:
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 5 not taken.
✗ flag(sps_curr_pic_ref_enabled_flag);
730
731
0/4
cbs_h265_read_sps_scc_extension:
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 8 not taken.
cbs_h265_write_sps_scc_extension:
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 8 not taken.
✗ flag(palette_mode_enabled_flag);
732
0/4
cbs_h265_read_sps_scc_extension:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 37 not taken.
cbs_h265_write_sps_scc_extension:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 37 not taken.
✗ if (current->palette_mode_enabled_flag) {
733
0/4
cbs_h265_read_sps_scc_extension:
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 12 not taken.
cbs_h265_write_sps_scc_extension:
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 12 not taken.
✗ ue(palette_max_size, 0, 64);
734
0/4
cbs_h265_read_sps_scc_extension:
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 15 not taken.
cbs_h265_write_sps_scc_extension:
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 15 not taken.
✗ ue(delta_palette_max_predictor_size, 0, 128);
735
736
0/4
cbs_h265_read_sps_scc_extension:
✗ Branch 16 → 17 not taken.
✗ Branch 16 → 18 not taken.
cbs_h265_write_sps_scc_extension:
✗ Branch 16 → 17 not taken.
✗ Branch 16 → 18 not taken.
✗ flag(sps_palette_predictor_initializer_present_flag);
737
0/4
cbs_h265_read_sps_scc_extension:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 37 not taken.
cbs_h265_write_sps_scc_extension:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 37 not taken.
✗ if (current->sps_palette_predictor_initializer_present_flag) {
738
0/4
cbs_h265_read_sps_scc_extension:
✗ Branch 20 → 21 not taken.
✗ Branch 20 → 22 not taken.
cbs_h265_write_sps_scc_extension:
✗ Branch 20 → 21 not taken.
✗ Branch 20 → 22 not taken.
✗ ue(sps_num_palette_predictor_initializer_minus1, 0, 127);
739
0/8
cbs_h265_read_sps_scc_extension:
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 35 not taken.
✗ Branch 36 → 23 not taken.
✗ Branch 36 → 37 not taken.
cbs_h265_write_sps_scc_extension:
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 35 not taken.
✗ Branch 36 → 23 not taken.
✗ Branch 36 → 37 not taken.
✗ for (comp = 0; comp < (current->chroma_format_idc ? 3 : 1); comp++) {
740 ✗ int bit_depth = comp == 0 ? current->bit_depth_luma_minus8 + 8
741
0/4
cbs_h265_read_sps_scc_extension:
✗ Branch 23 → 24 not taken.
✗ Branch 23 → 25 not taken.
cbs_h265_write_sps_scc_extension:
✗ Branch 23 → 24 not taken.
✗ Branch 23 → 25 not taken.
✗ : current->bit_depth_chroma_minus8 + 8;
742
0/4
cbs_h265_read_sps_scc_extension:
✗ Branch 31 → 27 not taken.
✗ Branch 31 → 32 not taken.
cbs_h265_write_sps_scc_extension:
✗ Branch 31 → 27 not taken.
✗ Branch 31 → 32 not taken.
✗ for (i = 0; i <= current->sps_num_palette_predictor_initializer_minus1; i++)
743
0/4
cbs_h265_read_sps_scc_extension:
✗ Branch 28 → 29 not taken.
✗ Branch 28 → 30 not taken.
cbs_h265_write_sps_scc_extension:
✗ Branch 28 → 29 not taken.
✗ Branch 28 → 30 not taken.
✗ ubs(bit_depth, sps_palette_predictor_initializers[comp][i], 2, comp, i);
744 }
745 }
746 }
747
748
0/4
cbs_h265_read_sps_scc_extension:
✗ Branch 38 → 39 not taken.
✗ Branch 38 → 40 not taken.
cbs_h265_write_sps_scc_extension:
✗ Branch 38 → 39 not taken.
✗ Branch 38 → 40 not taken.
✗ u(2, motion_vector_resolution_control_idc, 0, 2);
749
0/4
cbs_h265_read_sps_scc_extension:
✗ Branch 41 → 42 not taken.
✗ Branch 41 → 43 not taken.
cbs_h265_write_sps_scc_extension:
✗ Branch 41 → 42 not taken.
✗ Branch 41 → 43 not taken.
✗ flag(intra_boundary_filtering_disable_flag);
750
751 ✗ return 0;
752 }
753
754 ✗ static int FUNC(sps_multilayer_extension)(CodedBitstreamContext *ctx, RWContext *rw,
755 H265RawSPS *current)
756 {
757 int err;
758
759
0/4
cbs_h265_read_sps_multilayer_extension:
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 5 not taken.
cbs_h265_write_sps_multilayer_extension:
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 5 not taken.
✗ flag(inter_view_mv_vert_constraint_flag);
760
761 ✗ return 0;
762 }
763
764 76 static int FUNC(vui_parameters_default)(CodedBitstreamContext *ctx,
765 RWContext *rw, H265RawVUI *current,
766 H265RawSPS *sps)
767 {
768
1/2
✗ Branch 2 → 3 not taken.
✓ Branch 2 → 5 taken 32 times.
76 infer(aspect_ratio_idc, 0);
769
770
1/2
✗ Branch 5 → 6 not taken.
✓ Branch 5 → 8 taken 32 times.
76 infer(video_format, 5);
771
1/2
✗ Branch 8 → 9 not taken.
✓ Branch 8 → 11 taken 32 times.
76 infer(video_full_range_flag, 0);
772
1/2
✗ Branch 11 → 12 not taken.
✓ Branch 11 → 14 taken 32 times.
76 infer(colour_primaries, 2);
773
1/2
✗ Branch 14 → 15 not taken.
✓ Branch 14 → 17 taken 32 times.
76 infer(transfer_characteristics, 2);
774
1/2
✗ Branch 17 → 18 not taken.
✓ Branch 17 → 20 taken 32 times.
76 infer(matrix_coefficients, 2);
775
776
1/2
✗ Branch 20 → 21 not taken.
✓ Branch 20 → 23 taken 32 times.
76 infer(chroma_sample_loc_type_top_field, 0);
777
1/2
✗ Branch 23 → 24 not taken.
✓ Branch 23 → 26 taken 32 times.
76 infer(chroma_sample_loc_type_bottom_field, 0);
778
779
1/2
✗ Branch 26 → 27 not taken.
✓ Branch 26 → 29 taken 32 times.
76 infer(tiles_fixed_structure_flag, 0);
780
1/2
✗ Branch 29 → 30 not taken.
✓ Branch 29 → 32 taken 32 times.
76 infer(motion_vectors_over_pic_boundaries_flag, 1);
781
1/2
✗ Branch 32 → 33 not taken.
✓ Branch 32 → 35 taken 32 times.
76 infer(min_spatial_segmentation_idc, 0);
782
1/2
✗ Branch 35 → 36 not taken.
✓ Branch 35 → 38 taken 32 times.
76 infer(max_bytes_per_pic_denom, 2);
783
1/2
✗ Branch 38 → 39 not taken.
✓ Branch 38 → 41 taken 32 times.
76 infer(max_bits_per_min_cu_denom, 1);
784
1/2
✗ Branch 41 → 42 not taken.
✓ Branch 41 → 44 taken 32 times.
76 infer(log2_max_mv_length_horizontal, 15);
785
1/2
✗ Branch 44 → 45 not taken.
✓ Branch 44 → 47 taken 32 times.
76 infer(log2_max_mv_length_vertical, 15);
786
787 76 return 0;
788 }
789
790 138 static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
791 H265RawSPS *current)
792 {
793 138 CodedBitstreamH265Context *h265 = ctx->priv_data;
794 const H265RawVPS *vps;
795 int err, i;
796 unsigned int min_cb_log2_size_y, ctb_log2_size_y,
797 min_cb_size_y, min_tb_log2_size_y;
798 unsigned int multi_layer_ext_sps_flag;
799
800 138 HEADER("Sequence Parameter Set");
801
802
2/4
cbs_h265_read_sps:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 73 times.
cbs_h265_write_sps:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 65 times.
138 CHECK(FUNC(nal_unit_header)(ctx, rw, &current->nal_unit_header, HEVC_NAL_SPS));
803
804
2/4
cbs_h265_read_sps:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 73 times.
cbs_h265_write_sps:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 65 times.
138 ub(4, sps_video_parameter_set_id);
805 138 h265->active_vps = vps = h265->vps[current->sps_video_parameter_set_id];
806
2/4
cbs_h265_read_sps:
✗ Branch 9 → 10 not taken.
✓ Branch 9 → 12 taken 73 times.
cbs_h265_write_sps:
✗ Branch 9 → 10 not taken.
✓ Branch 9 → 12 taken 65 times.
138 if (!vps) {
807 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "VPS id %d not available.\n",
808 ✗ current->sps_video_parameter_set_id);
809 ✗ return AVERROR_INVALIDDATA;
810 }
811
812
2/4
cbs_h265_read_sps:
✓ Branch 12 → 13 taken 73 times.
✗ Branch 12 → 17 not taken.
cbs_h265_write_sps:
✓ Branch 12 → 13 taken 65 times.
✗ Branch 12 → 17 not taken.
138 if (current->nal_unit_header.nuh_layer_id == 0)
813
2/4
cbs_h265_read_sps:
✗ Branch 14 → 15 not taken.
✓ Branch 14 → 16 taken 73 times.
cbs_h265_write_sps:
✗ Branch 14 → 15 not taken.
✓ Branch 14 → 16 taken 65 times.
138 u(3, sps_max_sub_layers_minus1, 0, vps->vps_max_sub_layers_minus1);
814 else {
815
0/4
cbs_h265_read_sps:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
cbs_h265_write_sps:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ u(3, sps_ext_or_max_sub_layers_minus1, 0, HEVC_MAX_SUB_LAYERS);
816
0/8
cbs_h265_read_sps:
✗ Branch 20 → 21 not taken.
✗ Branch 20 → 22 not taken.
cbs_h265_write_sps:
✗ Branch 20 → 21 not taken.
✗ Branch 20 → 22 not taken.
✗ Branch 23 → 24 not taken.
✗ Branch 23 → 29 not taken.
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 26 not taken.
✗ infer(sps_max_sub_layers_minus1, current->sps_ext_or_max_sub_layers_minus1 == HEVC_MAX_SUB_LAYERS
817 ? vps->vps_max_sub_layers_minus1
818 : current->sps_ext_or_max_sub_layers_minus1);
819 }
820
2/4
cbs_h265_read_sps:
✗ Branch 24 → 25 not taken.
✓ Branch 24 → 27 taken 73 times.
cbs_h265_write_sps:
✗ Branch 29 → 30 not taken.
✓ Branch 29 → 32 taken 65 times.
138 multi_layer_ext_sps_flag = current->nal_unit_header.nuh_layer_id &&
821
0/4
cbs_h265_read_sps:
✗ Branch 25 → 26 not taken.
✗ Branch 25 → 27 not taken.
cbs_h265_write_sps:
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 32 not taken.
✗ current->sps_ext_or_max_sub_layers_minus1 == HEVC_MAX_SUB_LAYERS;
822
2/4
cbs_h265_read_sps:
✓ Branch 28 → 29 taken 73 times.
✗ Branch 28 → 43 not taken.
cbs_h265_write_sps:
✓ Branch 33 → 34 taken 65 times.
✗ Branch 33 → 48 not taken.
138 if (!multi_layer_ext_sps_flag) {
823
2/4
cbs_h265_read_sps:
✗ Branch 30 → 31 not taken.
✓ Branch 30 → 32 taken 73 times.
cbs_h265_write_sps:
✗ Branch 35 → 36 not taken.
✓ Branch 35 → 37 taken 65 times.
138 flag(sps_temporal_id_nesting_flag);
824
825
4/4
cbs_h265_read_sps:
✓ Branch 32 → 33 taken 61 times.
✓ Branch 32 → 36 taken 12 times.
cbs_h265_write_sps:
✓ Branch 37 → 38 taken 53 times.
✓ Branch 37 → 41 taken 12 times.
138 if (vps->vps_temporal_id_nesting_flag &&
826
2/4
cbs_h265_read_sps:
✗ Branch 33 → 34 not taken.
✓ Branch 33 → 36 taken 61 times.
cbs_h265_write_sps:
✗ Branch 38 → 39 not taken.
✓ Branch 38 → 41 taken 53 times.
114 !current->sps_temporal_id_nesting_flag) {
827 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid stream: "
828 "sps_temporal_id_nesting_flag must be 1 if "
829 "vps_temporal_id_nesting_flag is 1.\n");
830 ✗ return AVERROR_INVALIDDATA;
831 }
832
4/4
cbs_h265_read_sps:
✓ Branch 36 → 37 taken 61 times.
✓ Branch 36 → 40 taken 12 times.
cbs_h265_write_sps:
✓ Branch 41 → 42 taken 53 times.
✓ Branch 41 → 45 taken 12 times.
138 if (current->sps_max_sub_layers_minus1 == 0 &&
833
2/4
cbs_h265_read_sps:
✗ Branch 37 → 38 not taken.
✓ Branch 37 → 40 taken 61 times.
cbs_h265_write_sps:
✗ Branch 42 → 43 not taken.
✓ Branch 42 → 45 taken 53 times.
114 current->sps_temporal_id_nesting_flag != 1) {
834 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid stream: "
835 "sps_temporal_id_nesting_flag must be 1 if "
836 "sps_max_sub_layers_minus1 is 0.\n");
837 ✗ return AVERROR_INVALIDDATA;
838 }
839
840
2/4
cbs_h265_read_sps:
✗ Branch 41 → 42 not taken.
✓ Branch 41 → 46 taken 73 times.
cbs_h265_write_sps:
✗ Branch 46 → 47 not taken.
✓ Branch 46 → 55 taken 65 times.
138 CHECK(FUNC(profile_tier_level)(ctx, rw, &current->profile_tier_level,
841 1, current->sps_max_sub_layers_minus1));
842 } else {
843
0/4
cbs_h265_read_sps:
✗ Branch 43 → 44 not taken.
✗ Branch 43 → 45 not taken.
cbs_h265_write_sps:
✗ Branch 48 → 49 not taken.
✗ Branch 48 → 52 not taken.
✗ if (current->sps_max_sub_layers_minus1 > 0)
844
0/2
✗ Branch 49 → 50 not taken.
✗ Branch 49 → 55 not taken.
✗ infer(sps_temporal_id_nesting_flag, vps->vps_temporal_id_nesting_flag);
845 else
846
0/2
✗ Branch 52 → 53 not taken.
✗ Branch 52 → 55 not taken.
✗ infer(sps_temporal_id_nesting_flag, 1);
847 }
848
849
2/4
cbs_h265_read_sps:
✗ Branch 47 → 48 not taken.
✓ Branch 47 → 49 taken 73 times.
cbs_h265_write_sps:
✗ Branch 56 → 57 not taken.
✓ Branch 56 → 58 taken 65 times.
138 ue(sps_seq_parameter_set_id, 0, 15);
850
851
2/4
cbs_h265_read_sps:
✗ Branch 49 → 50 not taken.
✓ Branch 49 → 58 taken 73 times.
cbs_h265_write_sps:
✗ Branch 58 → 59 not taken.
✓ Branch 58 → 66 taken 65 times.
138 if (multi_layer_ext_sps_flag) {
852
0/4
cbs_h265_read_sps:
✗ Branch 51 → 52 not taken.
✗ Branch 51 → 53 not taken.
cbs_h265_write_sps:
✗ Branch 60 → 61 not taken.
✗ Branch 60 → 62 not taken.
✗ flag(update_rep_format_flag);
853
0/4
cbs_h265_read_sps:
✗ Branch 53 → 54 not taken.
✗ Branch 53 → 98 not taken.
cbs_h265_write_sps:
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 118 not taken.
✗ if (current->update_rep_format_flag)
854
0/4
cbs_h265_read_sps:
✗ Branch 55 → 56 not taken.
✗ Branch 55 → 57 not taken.
cbs_h265_write_sps:
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 118 not taken.
✗ ub(8, sps_rep_format_idx);
855 } else {
856
2/4
cbs_h265_read_sps:
✗ Branch 59 → 60 not taken.
✓ Branch 59 → 61 taken 73 times.
cbs_h265_write_sps:
✗ Branch 67 → 68 not taken.
✓ Branch 67 → 69 taken 65 times.
138 ue(chroma_format_idc, 0, 3);
857
2/4
cbs_h265_read_sps:
✗ Branch 61 → 62 not taken.
✓ Branch 61 → 66 taken 73 times.
cbs_h265_write_sps:
✗ Branch 69 → 70 not taken.
✓ Branch 69 → 73 taken 65 times.
138 if (current->chroma_format_idc == 3)
858
0/4
cbs_h265_read_sps:
✗ Branch 63 → 64 not taken.
✗ Branch 63 → 65 not taken.
cbs_h265_write_sps:
✗ Branch 71 → 72 not taken.
✗ Branch 71 → 76 not taken.
✗ flag(separate_colour_plane_flag);
859 else
860
1/2
✗ Branch 73 → 74 not taken.
✓ Branch 73 → 76 taken 65 times.
138 infer(separate_colour_plane_flag, 0);
861
862
2/4
cbs_h265_read_sps:
✗ Branch 68 → 69 not taken.
✓ Branch 68 → 70 taken 73 times.
cbs_h265_write_sps:
✗ Branch 77 → 78 not taken.
✓ Branch 77 → 79 taken 65 times.
138 ue(pic_width_in_luma_samples, 1, HEVC_MAX_WIDTH);
863
2/4
cbs_h265_read_sps:
✗ Branch 71 → 72 not taken.
✓ Branch 71 → 73 taken 73 times.
cbs_h265_write_sps:
✗ Branch 80 → 81 not taken.
✓ Branch 80 → 82 taken 65 times.
138 ue(pic_height_in_luma_samples, 1, HEVC_MAX_HEIGHT);
864
865
2/4
cbs_h265_read_sps:
✗ Branch 74 → 75 not taken.
✓ Branch 74 → 76 taken 73 times.
cbs_h265_write_sps:
✗ Branch 83 → 84 not taken.
✓ Branch 83 → 85 taken 65 times.
138 flag(conformance_window_flag);
866
4/4
cbs_h265_read_sps:
✓ Branch 76 → 77 taken 58 times.
✓ Branch 76 → 90 taken 15 times.
cbs_h265_write_sps:
✓ Branch 85 → 86 taken 50 times.
✓ Branch 85 → 99 taken 15 times.
138 if (current->conformance_window_flag) {
867
2/4
cbs_h265_read_sps:
✗ Branch 78 → 79 not taken.
✓ Branch 78 → 80 taken 58 times.
cbs_h265_write_sps:
✗ Branch 87 → 88 not taken.
✓ Branch 87 → 89 taken 50 times.
108 ue(conf_win_left_offset, 0, current->pic_width_in_luma_samples);
868
2/4
cbs_h265_read_sps:
✗ Branch 81 → 82 not taken.
✓ Branch 81 → 83 taken 58 times.
cbs_h265_write_sps:
✗ Branch 90 → 91 not taken.
✓ Branch 90 → 92 taken 50 times.
108 ue(conf_win_right_offset, 0, current->pic_width_in_luma_samples);
869
2/4
cbs_h265_read_sps:
✗ Branch 84 → 85 not taken.
✓ Branch 84 → 86 taken 58 times.
cbs_h265_write_sps:
✗ Branch 93 → 94 not taken.
✓ Branch 93 → 95 taken 50 times.
108 ue(conf_win_top_offset, 0, current->pic_height_in_luma_samples);
870
2/4
cbs_h265_read_sps:
✗ Branch 87 → 88 not taken.
✓ Branch 87 → 89 taken 58 times.
cbs_h265_write_sps:
✗ Branch 96 → 97 not taken.
✓ Branch 96 → 98 taken 50 times.
108 ue(conf_win_bottom_offset, 0, current->pic_height_in_luma_samples);
871 } else {
872
1/2
✗ Branch 99 → 100 not taken.
✓ Branch 99 → 102 taken 15 times.
30 infer(conf_win_left_offset, 0);
873
1/2
✗ Branch 102 → 103 not taken.
✓ Branch 102 → 105 taken 15 times.
30 infer(conf_win_right_offset, 0);
874
1/2
✗ Branch 105 → 106 not taken.
✓ Branch 105 → 108 taken 15 times.
30 infer(conf_win_top_offset, 0);
875
1/2
✗ Branch 108 → 109 not taken.
✓ Branch 108 → 111 taken 15 times.
30 infer(conf_win_bottom_offset, 0);
876 }
877
878
2/4
cbs_h265_read_sps:
✗ Branch 92 → 93 not taken.
✓ Branch 92 → 94 taken 73 times.
cbs_h265_write_sps:
✗ Branch 112 → 113 not taken.
✓ Branch 112 → 114 taken 65 times.
138 ue(bit_depth_luma_minus8, 0, 8);
879
2/4
cbs_h265_read_sps:
✗ Branch 95 → 96 not taken.
✓ Branch 95 → 97 taken 73 times.
cbs_h265_write_sps:
✗ Branch 115 → 116 not taken.
✓ Branch 115 → 117 taken 65 times.
138 ue(bit_depth_chroma_minus8, 0, 8);
880 }
881
882
2/4
cbs_h265_read_sps:
✗ Branch 99 → 100 not taken.
✓ Branch 99 → 101 taken 73 times.
cbs_h265_write_sps:
✗ Branch 119 → 120 not taken.
✓ Branch 119 → 121 taken 65 times.
138 ue(log2_max_pic_order_cnt_lsb_minus4, 0, 12);
883
884
2/4
cbs_h265_read_sps:
✓ Branch 101 → 102 taken 73 times.
✗ Branch 101 → 124 not taken.
cbs_h265_write_sps:
✓ Branch 121 → 122 taken 65 times.
✗ Branch 121 → 153 not taken.
138 if (!multi_layer_ext_sps_flag) {
885
2/4
cbs_h265_read_sps:
✗ Branch 103 → 104 not taken.
✓ Branch 103 → 105 taken 73 times.
cbs_h265_write_sps:
✗ Branch 123 → 124 not taken.
✓ Branch 123 → 125 taken 65 times.
138 flag(sps_sub_layer_ordering_info_present_flag);
886 138 for (i = (current->sps_sub_layer_ordering_info_present_flag ?
887
4/4
cbs_h265_read_sps:
✓ Branch 105 → 106 taken 12 times.
✓ Branch 105 → 107 taken 61 times.
cbs_h265_write_sps:
✓ Branch 125 → 126 taken 12 times.
✓ Branch 125 → 127 taken 53 times.
138 0 : current->sps_max_sub_layers_minus1);
888
4/4
cbs_h265_read_sps:
✓ Branch 119 → 109 taken 77 times.
✓ Branch 119 → 120 taken 73 times.
cbs_h265_write_sps:
✓ Branch 139 → 129 taken 69 times.
✓ Branch 139 → 140 taken 65 times.
284 i <= current->sps_max_sub_layers_minus1; i++) {
889
2/4
cbs_h265_read_sps:
✗ Branch 110 → 111 not taken.
✓ Branch 110 → 112 taken 77 times.
cbs_h265_write_sps:
✗ Branch 130 → 131 not taken.
✓ Branch 130 → 132 taken 69 times.
146 ues(sps_max_dec_pic_buffering_minus1[i],
890 0, HEVC_MAX_DPB_SIZE - 1, 1, i);
891
2/4
cbs_h265_read_sps:
✗ Branch 113 → 114 not taken.
✓ Branch 113 → 115 taken 77 times.
cbs_h265_write_sps:
✗ Branch 133 → 134 not taken.
✓ Branch 133 → 135 taken 69 times.
146 ues(sps_max_num_reorder_pics[i],
892 0, current->sps_max_dec_pic_buffering_minus1[i], 1, i);
893
2/4
cbs_h265_read_sps:
✗ Branch 116 → 117 not taken.
✓ Branch 116 → 118 taken 77 times.
cbs_h265_write_sps:
✗ Branch 136 → 137 not taken.
✓ Branch 136 → 138 taken 69 times.
146 ues(sps_max_latency_increase_plus1[i],
894 0, UINT32_MAX - 1, 1, i);
895 }
896
4/4
cbs_h265_read_sps:
✓ Branch 120 → 121 taken 12 times.
✓ Branch 120 → 124 taken 61 times.
cbs_h265_write_sps:
✓ Branch 140 → 141 taken 12 times.
✓ Branch 140 → 153 taken 53 times.
138 if (!current->sps_sub_layer_ordering_info_present_flag) {
897
4/4
cbs_h265_read_sps:
✓ Branch 123 → 122 taken 20 times.
✓ Branch 123 → 124 taken 12 times.
cbs_h265_write_sps:
✓ Branch 152 → 142 taken 20 times.
✓ Branch 152 → 153 taken 12 times.
64 for (i = 0; i < current->sps_max_sub_layers_minus1; i++) {
898
1/2
✗ Branch 142 → 143 not taken.
✓ Branch 142 → 145 taken 20 times.
40 infer(sps_max_dec_pic_buffering_minus1[i],
899 current->sps_max_dec_pic_buffering_minus1[current->sps_max_sub_layers_minus1]);
900
1/2
✗ Branch 145 → 146 not taken.
✓ Branch 145 → 148 taken 20 times.
40 infer(sps_max_num_reorder_pics[i],
901 current->sps_max_num_reorder_pics[current->sps_max_sub_layers_minus1]);
902
1/2
✗ Branch 148 → 149 not taken.
✓ Branch 148 → 151 taken 20 times.
40 infer(sps_max_latency_increase_plus1[i],
903 current->sps_max_latency_increase_plus1[current->sps_max_sub_layers_minus1]);
904 }
905 }
906 }
907
908
2/4
cbs_h265_read_sps:
✗ Branch 125 → 126 not taken.
✓ Branch 125 → 127 taken 73 times.
cbs_h265_write_sps:
✗ Branch 154 → 155 not taken.
✓ Branch 154 → 156 taken 65 times.
138 ue(log2_min_luma_coding_block_size_minus3, 0, 3);
909 138 min_cb_log2_size_y = current->log2_min_luma_coding_block_size_minus3 + 3;
910
911
2/4
cbs_h265_read_sps:
✗ Branch 128 → 129 not taken.
✓ Branch 128 → 130 taken 73 times.
cbs_h265_write_sps:
✗ Branch 157 → 158 not taken.
✓ Branch 157 → 159 taken 65 times.
138 ue(log2_diff_max_min_luma_coding_block_size, 0, 3);
912 138 ctb_log2_size_y = min_cb_log2_size_y +
913 138 current->log2_diff_max_min_luma_coding_block_size;
914
915 138 min_cb_size_y = 1 << min_cb_log2_size_y;
916
2/4
cbs_h265_read_sps:
✓ Branch 130 → 131 taken 73 times.
✗ Branch 130 → 132 not taken.
cbs_h265_write_sps:
✓ Branch 159 → 160 taken 65 times.
✗ Branch 159 → 161 not taken.
138 if (current->pic_width_in_luma_samples % min_cb_size_y ||
917
2/4
cbs_h265_read_sps:
✗ Branch 131 → 132 not taken.
✓ Branch 131 → 134 taken 73 times.
cbs_h265_write_sps:
✗ Branch 160 → 161 not taken.
✓ Branch 160 → 163 taken 65 times.
138 current->pic_height_in_luma_samples % min_cb_size_y) {
918 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid dimensions: %ux%u not divisible "
919 ✗ "by MinCbSizeY = %u.\n", current->pic_width_in_luma_samples,
920 ✗ current->pic_height_in_luma_samples, min_cb_size_y);
921 ✗ return AVERROR_INVALIDDATA;
922 }
923
924
2/4
cbs_h265_read_sps:
✗ Branch 135 → 136 not taken.
✓ Branch 135 → 137 taken 73 times.
cbs_h265_write_sps:
✗ Branch 164 → 165 not taken.
✓ Branch 164 → 166 taken 65 times.
138 ue(log2_min_luma_transform_block_size_minus2, 0, min_cb_log2_size_y - 3);
925 138 min_tb_log2_size_y = current->log2_min_luma_transform_block_size_minus2 + 2;
926
927
2/4
cbs_h265_read_sps:
✗ Branch 138 → 139 not taken.
✓ Branch 138 → 140 taken 73 times.
cbs_h265_write_sps:
✗ Branch 167 → 168 not taken.
✓ Branch 167 → 169 taken 65 times.
138 ue(log2_diff_max_min_luma_transform_block_size,
928 0, FFMIN(ctb_log2_size_y, 5) - min_tb_log2_size_y);
929
930
2/4
cbs_h265_read_sps:
✗ Branch 141 → 142 not taken.
✓ Branch 141 → 143 taken 73 times.
cbs_h265_write_sps:
✗ Branch 170 → 171 not taken.
✓ Branch 170 → 172 taken 65 times.
138 ue(max_transform_hierarchy_depth_inter,
931 0, ctb_log2_size_y - min_tb_log2_size_y);
932
2/4
cbs_h265_read_sps:
✗ Branch 144 → 145 not taken.
✓ Branch 144 → 146 taken 73 times.
cbs_h265_write_sps:
✗ Branch 173 → 174 not taken.
✓ Branch 173 → 175 taken 65 times.
138 ue(max_transform_hierarchy_depth_intra,
933 0, ctb_log2_size_y - min_tb_log2_size_y);
934
935
2/4
cbs_h265_read_sps:
✗ Branch 147 → 148 not taken.
✓ Branch 147 → 149 taken 73 times.
cbs_h265_write_sps:
✗ Branch 176 → 177 not taken.
✓ Branch 176 → 178 taken 65 times.
138 flag(scaling_list_enabled_flag);
936
4/4
cbs_h265_read_sps:
✓ Branch 149 → 150 taken 8 times.
✓ Branch 149 → 168 taken 65 times.
cbs_h265_write_sps:
✓ Branch 178 → 179 taken 4 times.
✓ Branch 178 → 197 taken 61 times.
138 if (current->scaling_list_enabled_flag) {
937
2/4
cbs_h265_read_sps:
✗ Branch 150 → 151 not taken.
✓ Branch 150 → 155 taken 8 times.
cbs_h265_write_sps:
✗ Branch 179 → 180 not taken.
✓ Branch 179 → 183 taken 4 times.
12 if (multi_layer_ext_sps_flag)
938
0/4
cbs_h265_read_sps:
✗ Branch 152 → 153 not taken.
✗ Branch 152 → 154 not taken.
cbs_h265_write_sps:
✗ Branch 181 → 182 not taken.
✗ Branch 181 → 186 not taken.
✗ flag(sps_infer_scaling_list_flag);
939 else
940
1/2
✗ Branch 183 → 184 not taken.
✓ Branch 183 → 186 taken 4 times.
12 infer(sps_infer_scaling_list_flag, 0);
941
2/4
cbs_h265_read_sps:
✗ Branch 156 → 157 not taken.
✓ Branch 156 → 161 taken 8 times.
cbs_h265_write_sps:
✗ Branch 186 → 187 not taken.
✓ Branch 186 → 190 taken 4 times.
12 if (current->sps_infer_scaling_list_flag)
942
0/4
cbs_h265_read_sps:
✗ Branch 158 → 159 not taken.
✗ Branch 158 → 160 not taken.
cbs_h265_write_sps:
✗ Branch 188 → 189 not taken.
✗ Branch 188 → 200 not taken.
✗ ub(6, sps_scaling_list_ref_layer_id);
943 else {
944
2/4
cbs_h265_read_sps:
✗ Branch 162 → 163 not taken.
✓ Branch 162 → 164 taken 8 times.
cbs_h265_write_sps:
✗ Branch 191 → 192 not taken.
✓ Branch 191 → 193 taken 4 times.
12 flag(sps_scaling_list_data_present_flag);
945
2/4
cbs_h265_read_sps:
✓ Branch 164 → 165 taken 8 times.
✗ Branch 164 → 169 not taken.
cbs_h265_write_sps:
✓ Branch 193 → 194 taken 4 times.
✗ Branch 193 → 200 not taken.
12 if (current->sps_scaling_list_data_present_flag)
946
2/4
cbs_h265_read_sps:
✗ Branch 166 → 167 not taken.
✓ Branch 166 → 169 taken 8 times.
cbs_h265_write_sps:
✗ Branch 195 → 196 not taken.
✓ Branch 195 → 200 taken 4 times.
12 CHECK(FUNC(scaling_list_data)(ctx, rw, &current->scaling_list));
947 }
948 } else {
949
1/2
✗ Branch 197 → 198 not taken.
✓ Branch 197 → 200 taken 61 times.
126 infer(sps_scaling_list_data_present_flag, 0);
950 }
951
952
2/4
cbs_h265_read_sps:
✗ Branch 170 → 171 not taken.
✓ Branch 170 → 172 taken 73 times.
cbs_h265_write_sps:
✗ Branch 201 → 202 not taken.
✓ Branch 201 → 203 taken 65 times.
138 flag(amp_enabled_flag);
953
2/4
cbs_h265_read_sps:
✗ Branch 173 → 174 not taken.
✓ Branch 173 → 175 taken 73 times.
cbs_h265_write_sps:
✗ Branch 204 → 205 not taken.
✓ Branch 204 → 206 taken 65 times.
138 flag(sample_adaptive_offset_enabled_flag);
954
955
2/4
cbs_h265_read_sps:
✗ Branch 176 → 177 not taken.
✓ Branch 176 → 178 taken 73 times.
cbs_h265_write_sps:
✗ Branch 207 → 208 not taken.
✓ Branch 207 → 209 taken 65 times.
138 flag(pcm_enabled_flag);
956
4/4
cbs_h265_read_sps:
✓ Branch 178 → 179 taken 2 times.
✓ Branch 178 → 195 taken 71 times.
cbs_h265_write_sps:
✓ Branch 209 → 210 taken 2 times.
✓ Branch 209 → 225 taken 63 times.
138 if (current->pcm_enabled_flag) {
957
2/4
cbs_h265_read_sps:
✗ Branch 180 → 181 not taken.
✓ Branch 180 → 182 taken 2 times.
cbs_h265_write_sps:
✗ Branch 211 → 212 not taken.
✓ Branch 211 → 213 taken 2 times.
4 u(4, pcm_sample_bit_depth_luma_minus1,
958 0, current->bit_depth_luma_minus8 + 8 - 1);
959
2/4
cbs_h265_read_sps:
✗ Branch 183 → 184 not taken.
✓ Branch 183 → 185 taken 2 times.
cbs_h265_write_sps:
✗ Branch 214 → 215 not taken.
✓ Branch 214 → 216 taken 2 times.
4 u(4, pcm_sample_bit_depth_chroma_minus1,
960 0, current->bit_depth_chroma_minus8 + 8 - 1);
961
962
2/4
cbs_h265_read_sps:
✗ Branch 186 → 187 not taken.
✓ Branch 186 → 188 taken 2 times.
cbs_h265_write_sps:
✗ Branch 217 → 218 not taken.
✓ Branch 217 → 219 taken 2 times.
4 ue(log2_min_pcm_luma_coding_block_size_minus3,
963 FFMIN(min_cb_log2_size_y, 5) - 3, FFMIN(ctb_log2_size_y, 5) - 3);
964
2/4
cbs_h265_read_sps:
✗ Branch 189 → 190 not taken.
✓ Branch 189 → 191 taken 2 times.
cbs_h265_write_sps:
✗ Branch 220 → 221 not taken.
✓ Branch 220 → 222 taken 2 times.
4 ue(log2_diff_max_min_pcm_luma_coding_block_size,
965 0, FFMIN(ctb_log2_size_y, 5) - (current->log2_min_pcm_luma_coding_block_size_minus3 + 3));
966
967
2/4
cbs_h265_read_sps:
✗ Branch 192 → 193 not taken.
✓ Branch 192 → 194 taken 2 times.
cbs_h265_write_sps:
✗ Branch 223 → 224 not taken.
✓ Branch 223 → 225 taken 2 times.
4 flag(pcm_loop_filter_disabled_flag);
968 }
969
970
2/4
cbs_h265_read_sps:
✗ Branch 196 → 197 not taken.
✓ Branch 196 → 198 taken 73 times.
cbs_h265_write_sps:
✗ Branch 226 → 227 not taken.
✓ Branch 226 → 228 taken 65 times.
138 ue(num_short_term_ref_pic_sets, 0, HEVC_MAX_SHORT_TERM_REF_PIC_SETS);
971
4/4
cbs_h265_read_sps:
✓ Branch 203 → 199 taken 634 times.
✓ Branch 203 → 204 taken 73 times.
cbs_h265_write_sps:
✓ Branch 233 → 229 taken 546 times.
✓ Branch 233 → 234 taken 65 times.
1318 for (i = 0; i < current->num_short_term_ref_pic_sets; i++)
972
2/4
cbs_h265_read_sps:
✗ Branch 200 → 201 not taken.
✓ Branch 200 → 202 taken 634 times.
cbs_h265_write_sps:
✗ Branch 230 → 231 not taken.
✓ Branch 230 → 232 taken 546 times.
1180 CHECK(FUNC(st_ref_pic_set)(ctx, rw, &current->st_ref_pic_set[i], i, current));
973
974
2/4
cbs_h265_read_sps:
✗ Branch 205 → 206 not taken.
✓ Branch 205 → 207 taken 73 times.
cbs_h265_write_sps:
✗ Branch 235 → 236 not taken.
✓ Branch 235 → 237 taken 65 times.
138 flag(long_term_ref_pics_present_flag);
975
4/4
cbs_h265_read_sps:
✓ Branch 207 → 208 taken 14 times.
✓ Branch 207 → 220 taken 59 times.
cbs_h265_write_sps:
✓ Branch 237 → 238 taken 14 times.
✓ Branch 237 → 250 taken 51 times.
138 if (current->long_term_ref_pics_present_flag) {
976
2/4
cbs_h265_read_sps:
✗ Branch 209 → 210 not taken.
✓ Branch 209 → 211 taken 14 times.
cbs_h265_write_sps:
✗ Branch 239 → 240 not taken.
✓ Branch 239 → 241 taken 14 times.
28 ue(num_long_term_ref_pics_sps, 0, HEVC_MAX_LONG_TERM_REF_PICS);
977
4/4
cbs_h265_read_sps:
✓ Branch 219 → 212 taken 16 times.
✓ Branch 219 → 220 taken 14 times.
cbs_h265_write_sps:
✓ Branch 249 → 242 taken 16 times.
✓ Branch 249 → 250 taken 14 times.
60 for (i = 0; i < current->num_long_term_ref_pics_sps; i++) {
978
2/4
cbs_h265_read_sps:
✗ Branch 213 → 214 not taken.
✓ Branch 213 → 215 taken 16 times.
cbs_h265_write_sps:
✗ Branch 243 → 244 not taken.
✓ Branch 243 → 245 taken 16 times.
32 ubs(current->log2_max_pic_order_cnt_lsb_minus4 + 4,
979 lt_ref_pic_poc_lsb_sps[i], 1, i);
980
2/4
cbs_h265_read_sps:
✗ Branch 216 → 217 not taken.
✓ Branch 216 → 218 taken 16 times.
cbs_h265_write_sps:
✗ Branch 246 → 247 not taken.
✓ Branch 246 → 248 taken 16 times.
32 flags(used_by_curr_pic_lt_sps_flag[i], 1, i);
981 }
982 }
983
984
2/4
cbs_h265_read_sps:
✗ Branch 221 → 222 not taken.
✓ Branch 221 → 223 taken 73 times.
cbs_h265_write_sps:
✗ Branch 251 → 252 not taken.
✓ Branch 251 → 253 taken 65 times.
138 flag(sps_temporal_mvp_enabled_flag);
985
2/4
cbs_h265_read_sps:
✗ Branch 224 → 225 not taken.
✓ Branch 224 → 226 taken 73 times.
cbs_h265_write_sps:
✗ Branch 254 → 255 not taken.
✓ Branch 254 → 256 taken 65 times.
138 flag(strong_intra_smoothing_enabled_flag);
986
987
2/4
cbs_h265_read_sps:
✗ Branch 227 → 228 not taken.
✓ Branch 227 → 229 taken 73 times.
cbs_h265_write_sps:
✗ Branch 257 → 258 not taken.
✓ Branch 257 → 259 taken 65 times.
138 flag(vui_parameters_present_flag);
988
4/4
cbs_h265_read_sps:
✓ Branch 229 → 230 taken 29 times.
✓ Branch 229 → 233 taken 44 times.
cbs_h265_write_sps:
✓ Branch 259 → 260 taken 33 times.
✓ Branch 259 → 263 taken 32 times.
138 if (current->vui_parameters_present_flag)
989
2/4
cbs_h265_read_sps:
✗ Branch 231 → 232 not taken.
✓ Branch 231 → 236 taken 29 times.
cbs_h265_write_sps:
✗ Branch 261 → 262 not taken.
✓ Branch 261 → 266 taken 33 times.
62 CHECK(FUNC(vui_parameters)(ctx, rw, &current->vui, current));
990 else
991
2/4
cbs_h265_read_sps:
✗ Branch 234 → 235 not taken.
✓ Branch 234 → 236 taken 44 times.
cbs_h265_write_sps:
✗ Branch 264 → 265 not taken.
✓ Branch 264 → 266 taken 32 times.
76 CHECK(FUNC(vui_parameters_default)(ctx, rw, &current->vui, current));
992
993
2/4
cbs_h265_read_sps:
✗ Branch 237 → 238 not taken.
✓ Branch 237 → 239 taken 73 times.
cbs_h265_write_sps:
✗ Branch 267 → 268 not taken.
✓ Branch 267 → 269 taken 65 times.
138 flag(sps_extension_present_flag);
994
2/4
cbs_h265_read_sps:
✗ Branch 239 → 240 not taken.
✓ Branch 239 → 256 taken 73 times.
cbs_h265_write_sps:
✗ Branch 269 → 270 not taken.
✓ Branch 269 → 285 taken 65 times.
138 if (current->sps_extension_present_flag) {
995
0/4
cbs_h265_read_sps:
✗ Branch 241 → 242 not taken.
✗ Branch 241 → 243 not taken.
cbs_h265_write_sps:
✗ Branch 271 → 272 not taken.
✗ Branch 271 → 273 not taken.
✗ flag(sps_range_extension_flag);
996
0/4
cbs_h265_read_sps:
✗ Branch 244 → 245 not taken.
✗ Branch 244 → 246 not taken.
cbs_h265_write_sps:
✗ Branch 274 → 275 not taken.
✗ Branch 274 → 276 not taken.
✗ flag(sps_multilayer_extension_flag);
997
0/4
cbs_h265_read_sps:
✗ Branch 247 → 248 not taken.
✗ Branch 247 → 249 not taken.
cbs_h265_write_sps:
✗ Branch 277 → 278 not taken.
✗ Branch 277 → 279 not taken.
✗ flag(sps_3d_extension_flag);
998
0/4
cbs_h265_read_sps:
✗ Branch 250 → 251 not taken.
✗ Branch 250 → 252 not taken.
cbs_h265_write_sps:
✗ Branch 280 → 281 not taken.
✗ Branch 280 → 282 not taken.
✗ flag(sps_scc_extension_flag);
999
0/4
cbs_h265_read_sps:
✗ Branch 253 → 254 not taken.
✗ Branch 253 → 255 not taken.
cbs_h265_write_sps:
✗ Branch 283 → 284 not taken.
✗ Branch 283 → 285 not taken.
✗ ub(4, sps_extension_4bits);
1000 }
1001
1002
2/4
cbs_h265_read_sps:
✗ Branch 256 → 257 not taken.
✓ Branch 256 → 260 taken 73 times.
cbs_h265_write_sps:
✗ Branch 285 → 286 not taken.
✓ Branch 285 → 289 taken 65 times.
138 if (current->sps_range_extension_flag)
1003
0/4
cbs_h265_read_sps:
✗ Branch 258 → 259 not taken.
✗ Branch 258 → 260 not taken.
cbs_h265_write_sps:
✗ Branch 287 → 288 not taken.
✗ Branch 287 → 289 not taken.
✗ CHECK(FUNC(sps_range_extension)(ctx, rw, current));
1004
2/4
cbs_h265_read_sps:
✗ Branch 260 → 261 not taken.
✓ Branch 260 → 264 taken 73 times.
cbs_h265_write_sps:
✗ Branch 289 → 290 not taken.
✓ Branch 289 → 293 taken 65 times.
138 if (current->sps_multilayer_extension_flag)
1005
0/4
cbs_h265_read_sps:
✗ Branch 262 → 263 not taken.
✗ Branch 262 → 264 not taken.
cbs_h265_write_sps:
✗ Branch 291 → 292 not taken.
✗ Branch 291 → 293 not taken.
✗ CHECK(FUNC(sps_multilayer_extension)(ctx, rw, current));
1006
2/4
cbs_h265_read_sps:
✗ Branch 264 → 265 not taken.
✓ Branch 264 → 266 taken 73 times.
cbs_h265_write_sps:
✗ Branch 293 → 294 not taken.
✓ Branch 293 → 295 taken 65 times.
138 if (current->sps_3d_extension_flag)
1007 ✗ return AVERROR_PATCHWELCOME;
1008
2/4
cbs_h265_read_sps:
✗ Branch 266 → 267 not taken.
✓ Branch 266 → 270 taken 73 times.
cbs_h265_write_sps:
✗ Branch 295 → 296 not taken.
✓ Branch 295 → 299 taken 65 times.
138 if (current->sps_scc_extension_flag)
1009
0/4
cbs_h265_read_sps:
✗ Branch 268 → 269 not taken.
✗ Branch 268 → 270 not taken.
cbs_h265_write_sps:
✗ Branch 297 → 298 not taken.
✗ Branch 297 → 299 not taken.
✗ CHECK(FUNC(sps_scc_extension)(ctx, rw, current));
1010
2/4
cbs_h265_read_sps:
✗ Branch 270 → 271 not taken.
✓ Branch 270 → 274 taken 73 times.
cbs_h265_write_sps:
✗ Branch 299 → 300 not taken.
✓ Branch 299 → 303 taken 65 times.
138 if (current->sps_extension_4bits)
1011
0/4
cbs_h265_read_sps:
✗ Branch 272 → 273 not taken.
✗ Branch 272 → 274 not taken.
cbs_h265_write_sps:
✗ Branch 301 → 302 not taken.
✗ Branch 301 → 303 not taken.
✗ CHECK(FUNC(extension_data)(ctx, rw, &current->extension_data));
1012
1013
2/4
cbs_h265_read_sps:
✗ Branch 275 → 276 not taken.
✓ Branch 275 → 277 taken 73 times.
cbs_h265_write_sps:
✗ Branch 304 → 305 not taken.
✓ Branch 304 → 306 taken 65 times.
138 CHECK(FUNC(rbsp_trailing_bits)(ctx, rw));
1014
1015 138 return 0;
1016 }
1017
1018 ✗ static int FUNC(pps_range_extension)(CodedBitstreamContext *ctx, RWContext *rw,
1019 H265RawPPS *current)
1020 {
1021 ✗ CodedBitstreamH265Context *h265 = ctx->priv_data;
1022 ✗ const H265RawSPS *sps = h265->active_sps;
1023 int err, i;
1024
1025
0/4
cbs_h265_read_pps_range_extension:
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 7 not taken.
cbs_h265_write_pps_range_extension:
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 7 not taken.
✗ if (current->transform_skip_enabled_flag)
1026
0/4
cbs_h265_read_pps_range_extension:
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
cbs_h265_write_pps_range_extension:
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
✗ ue(log2_max_transform_skip_block_size_minus2, 0, 3);
1027
0/4
cbs_h265_read_pps_range_extension:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 10 not taken.
cbs_h265_write_pps_range_extension:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 10 not taken.
✗ flag(cross_component_prediction_enabled_flag);
1028
1029
0/4
cbs_h265_read_pps_range_extension:
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
cbs_h265_write_pps_range_extension:
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
✗ flag(chroma_qp_offset_list_enabled_flag);
1030
0/4
cbs_h265_read_pps_range_extension:
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 29 not taken.
cbs_h265_write_pps_range_extension:
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 29 not taken.
✗ if (current->chroma_qp_offset_list_enabled_flag) {
1031
0/4
cbs_h265_read_pps_range_extension:
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 17 not taken.
cbs_h265_write_pps_range_extension:
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 17 not taken.
✗ ue(diff_cu_chroma_qp_offset_depth,
1032 0, sps->log2_diff_max_min_luma_coding_block_size);
1033
0/4
cbs_h265_read_pps_range_extension:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
cbs_h265_write_pps_range_extension:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ ue(chroma_qp_offset_list_len_minus1, 0, 5);
1034
0/4
cbs_h265_read_pps_range_extension:
✗ Branch 28 → 21 not taken.
✗ Branch 28 → 29 not taken.
cbs_h265_write_pps_range_extension:
✗ Branch 28 → 21 not taken.
✗ Branch 28 → 29 not taken.
✗ for (i = 0; i <= current->chroma_qp_offset_list_len_minus1; i++) {
1035
0/4
cbs_h265_read_pps_range_extension:
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 24 not taken.
cbs_h265_write_pps_range_extension:
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 24 not taken.
✗ ses(cb_qp_offset_list[i], -12, +12, 1, i);
1036
0/4
cbs_h265_read_pps_range_extension:
✗ Branch 25 → 26 not taken.
✗ Branch 25 → 27 not taken.
cbs_h265_write_pps_range_extension:
✗ Branch 25 → 26 not taken.
✗ Branch 25 → 27 not taken.
✗ ses(cr_qp_offset_list[i], -12, +12, 1, i);
1037 }
1038 }
1039
1040
0/8
cbs_h265_read_pps_range_extension:
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 35 not taken.
cbs_h265_write_pps_range_extension:
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 35 not taken.
✗ ue(log2_sao_offset_scale_luma, 0, FFMAX(0, sps->bit_depth_luma_minus8 - 2));
1041
0/8
cbs_h265_read_pps_range_extension:
✗ Branch 35 → 36 not taken.
✗ Branch 35 → 37 not taken.
✗ Branch 39 → 40 not taken.
✗ Branch 39 → 41 not taken.
cbs_h265_write_pps_range_extension:
✗ Branch 35 → 36 not taken.
✗ Branch 35 → 37 not taken.
✗ Branch 39 → 40 not taken.
✗ Branch 39 → 41 not taken.
✗ ue(log2_sao_offset_scale_chroma, 0, FFMAX(0, sps->bit_depth_chroma_minus8 - 2));
1042
1043 ✗ return 0;
1044 }
1045
1046 ✗ static int FUNC(colour_mapping_octants)(CodedBitstreamContext *ctx, RWContext *rw,
1047 H265RawPPS *current, unsigned int inp_depth,
1048 unsigned int idx_y, unsigned int idx_cb,
1049 unsigned int idx_cr, unsigned int inp_length)
1050 {
1051 int part_num_y, cm_res_bits;
1052 int err;
1053
1054 ✗ part_num_y = 1 << current->cm_y_part_num_log2;
1055
1056
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 5 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 2 → 3 not taken.
✗ Branch 2 → 5 not taken.
✗ av_assert0(inp_depth <= 1);
1057
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 10 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 10 not taken.
✗ if (inp_depth < current->cm_octant_depth)
1058
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 9 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 9 not taken.
✗ flags(split_octant_flag[inp_depth], 1, inp_depth);
1059 else
1060
0/2
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 13 not taken.
✗ infer(split_octant_flag[inp_depth], 0);
1061
1062
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 24 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 26 not taken.
✗ if (current->split_octant_flag[inp_depth])
1063
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 23 → 13 not taken.
✗ Branch 23 → 56 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 25 → 15 not taken.
✗ Branch 25 → 71 not taken.
✗ for (int k = 0; k < 2; k++)
1064
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 21 → 14 not taken.
✗ Branch 21 → 22 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 23 → 16 not taken.
✗ Branch 23 → 24 not taken.
✗ for (int m = 0; m < 2; m++)
1065
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 19 → 15 not taken.
✗ Branch 19 → 20 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 21 → 17 not taken.
✗ Branch 21 → 22 not taken.
✗ for (int n = 0; n < 2; n++)
1066
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 16 → 17 not taken.
✗ Branch 16 → 18 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ CHECK(FUNC(colour_mapping_octants)(ctx, rw, current, inp_depth + 1,
1067 idx_y + part_num_y * k * inp_length / 2,
1068 idx_cb + m * inp_length / 2,
1069 idx_cr + n * inp_length / 2,
1070 inp_length / 2));
1071 else
1072
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 55 → 25 not taken.
✗ Branch 55 → 56 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 70 → 27 not taken.
✗ Branch 70 → 71 not taken.
✗ for (int i = 0; i < part_num_y; i++) {
1073 ✗ int idx_shift_y = idx_y + (i << (current->cm_octant_depth - inp_depth));
1074
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 53 → 26 not taken.
✗ Branch 53 → 54 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 68 → 28 not taken.
✗ Branch 68 → 69 not taken.
✗ for (int j = 0; j < 4; j++) {
1075
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 29 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
✗ flags(coded_res_flag[idx_shift_y][idx_cb][idx_cr][j],
1076 4, idx_shift_y, idx_cb, idx_cr, j);
1077
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 49 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 55 not taken.
✗ if (current->coded_res_flag[idx_shift_y][idx_cb][idx_cr][j]) {
1078
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 48 → 31 not taken.
✗ Branch 48 → 52 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 54 → 33 not taken.
✗ Branch 54 → 67 not taken.
✗ for (int c = 0; c < 3; c++) {
1079
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 32 → 33 not taken.
✗ Branch 32 → 34 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 34 → 35 not taken.
✗ Branch 34 → 36 not taken.
✗ ues(res_coeff_q[idx_shift_y][idx_cb][idx_cr][j][c], 0, 3,
1080 5, idx_shift_y, idx_cb, idx_cr, j, c);
1081 ✗ cm_res_bits = FFMAX(0, 10 + (current->luma_bit_depth_cm_input_minus8 + 8) -
1082 (current->luma_bit_depth_cm_output_minus8 + 8) -
1083 current->cm_res_quant_bits - (current->cm_delta_flc_bits_minus1 + 1));
1084
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 34 → 35 not taken.
✗ Branch 34 → 39 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 36 → 37 not taken.
✗ Branch 36 → 41 not taken.
✗ if (cm_res_bits)
1085
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 36 → 37 not taken.
✗ Branch 36 → 38 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 38 → 39 not taken.
✗ Branch 38 → 40 not taken.
✗ ubs(cm_res_bits, res_coeff_r[idx_shift_y][idx_cb][idx_cr][j][c],
1086 5, idx_shift_y, idx_cb, idx_cr, j, c);
1087 else
1088
0/2
✗ Branch 41 → 42 not taken.
✗ Branch 41 → 44 not taken.
✗ infer(res_coeff_r[idx_shift_y][idx_cb][idx_cr][j][c], 0);
1089
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 40 → 41 not taken.
✗ Branch 40 → 42 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 44 → 45 not taken.
✗ Branch 44 → 46 not taken.
✗ if (current->res_coeff_q[idx_shift_y][idx_cb][idx_cr][j][c] ||
1090
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 41 → 42 not taken.
✗ Branch 41 → 46 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 45 → 46 not taken.
✗ Branch 45 → 50 not taken.
✗ current->res_coeff_r[idx_shift_y][idx_cb][idx_cr][j][c])
1091
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 43 → 44 not taken.
✗ Branch 43 → 45 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 47 → 48 not taken.
✗ Branch 47 → 49 not taken.
✗ ub(1, res_coeff_s[idx_shift_y][idx_cb][idx_cr][j][c]);
1092 else
1093
0/2
✗ Branch 50 → 51 not taken.
✗ Branch 50 → 53 not taken.
✗ infer(res_coeff_s[idx_shift_y][idx_cb][idx_cr][j][c], 0);
1094 }
1095 } else {
1096
0/4
cbs_h265_read_colour_mapping_octants:
✗ Branch 51 → 50 not taken.
✗ Branch 51 → 52 not taken.
cbs_h265_write_colour_mapping_octants:
✗ Branch 66 → 56 not taken.
✗ Branch 66 → 67 not taken.
✗ for (int c = 0; c < 3; c++) {
1097
0/2
✗ Branch 56 → 57 not taken.
✗ Branch 56 → 59 not taken.
✗ infer(res_coeff_q[idx_shift_y][idx_cb][idx_cr][j][c], 0);
1098
0/2
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 62 not taken.
✗ infer(res_coeff_r[idx_shift_y][idx_cb][idx_cr][j][c], 0);
1099
0/2
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 65 not taken.
✗ infer(res_coeff_s[idx_shift_y][idx_cb][idx_cr][j][c], 0);
1100 }
1101 }
1102 }
1103 }
1104
1105 ✗ return 0;
1106 }
1107
1108 ✗ static int FUNC(colour_mapping_table)(CodedBitstreamContext *ctx, RWContext *rw,
1109 H265RawPPS *current)
1110 {
1111 int err;
1112
1113
0/4
cbs_h265_read_colour_mapping_table:
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 5 not taken.
cbs_h265_write_colour_mapping_table:
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 5 not taken.
✗ ue(num_cm_ref_layers_minus1, 0, 61);
1114
0/4
cbs_h265_read_colour_mapping_table:
✗ Branch 10 → 6 not taken.
✗ Branch 10 → 11 not taken.
cbs_h265_write_colour_mapping_table:
✗ Branch 10 → 6 not taken.
✗ Branch 10 → 11 not taken.
✗ for (int i = 0; i <= current->num_cm_ref_layers_minus1; i++)
1115
0/4
cbs_h265_read_colour_mapping_table:
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 9 not taken.
cbs_h265_write_colour_mapping_table:
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 9 not taken.
✗ ubs(6, cm_ref_layer_id[i], 1, i);
1116
1117
0/4
cbs_h265_read_colour_mapping_table:
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 14 not taken.
cbs_h265_write_colour_mapping_table:
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 14 not taken.
✗ u(2, cm_octant_depth, 0, 1);
1118
0/4
cbs_h265_read_colour_mapping_table:
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 17 not taken.
cbs_h265_write_colour_mapping_table:
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 17 not taken.
✗ u(2, cm_y_part_num_log2, 0, 3 - current->cm_octant_depth);
1119
1120
0/4
cbs_h265_read_colour_mapping_table:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
cbs_h265_write_colour_mapping_table:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ ue(luma_bit_depth_cm_input_minus8, 0, 8);
1121
0/4
cbs_h265_read_colour_mapping_table:
✗ Branch 21 → 22 not taken.
✗ Branch 21 → 23 not taken.
cbs_h265_write_colour_mapping_table:
✗ Branch 21 → 22 not taken.
✗ Branch 21 → 23 not taken.
✗ ue(chroma_bit_depth_cm_input_minus8, 0, 8);
1122
0/4
cbs_h265_read_colour_mapping_table:
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 26 not taken.
cbs_h265_write_colour_mapping_table:
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 26 not taken.
✗ ue(luma_bit_depth_cm_output_minus8, 0, 8);
1123
0/4
cbs_h265_read_colour_mapping_table:
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 29 not taken.
cbs_h265_write_colour_mapping_table:
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 29 not taken.
✗ ue(chroma_bit_depth_cm_output_minus8, 0, 8);
1124
1125
0/4
cbs_h265_read_colour_mapping_table:
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 32 not taken.
cbs_h265_write_colour_mapping_table:
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 32 not taken.
✗ ub(2, cm_res_quant_bits);
1126
0/4
cbs_h265_read_colour_mapping_table:
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 35 not taken.
cbs_h265_write_colour_mapping_table:
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 35 not taken.
✗ ub(2, cm_delta_flc_bits_minus1);
1127
1128
0/4
cbs_h265_read_colour_mapping_table:
✗ Branch 35 → 36 not taken.
✗ Branch 35 → 43 not taken.
cbs_h265_write_colour_mapping_table:
✗ Branch 35 → 36 not taken.
✗ Branch 35 → 43 not taken.
✗ if (current->cm_octant_depth == 1) {
1129
0/4
cbs_h265_read_colour_mapping_table:
✗ Branch 37 → 38 not taken.
✗ Branch 37 → 39 not taken.
cbs_h265_write_colour_mapping_table:
✗ Branch 37 → 38 not taken.
✗ Branch 37 → 39 not taken.
✗ se(cm_adapt_threshold_u_delta, -32768, 32767);
1130
0/4
cbs_h265_read_colour_mapping_table:
✗ Branch 40 → 41 not taken.
✗ Branch 40 → 42 not taken.
cbs_h265_write_colour_mapping_table:
✗ Branch 40 → 41 not taken.
✗ Branch 40 → 42 not taken.
✗ se(cm_adapt_threshold_v_delta, -32768, 32767);
1131 } else {
1132
0/2
✗ Branch 43 → 44 not taken.
✗ Branch 43 → 46 not taken.
✗ infer(cm_adapt_threshold_u_delta, 0);
1133
0/2
✗ Branch 46 → 47 not taken.
✗ Branch 46 → 49 not taken.
✗ infer(cm_adapt_threshold_v_delta, 0);
1134 }
1135
1136
0/4
cbs_h265_read_colour_mapping_table:
✗ Branch 45 → 46 not taken.
✗ Branch 45 → 47 not taken.
cbs_h265_write_colour_mapping_table:
✗ Branch 50 → 51 not taken.
✗ Branch 50 → 52 not taken.
✗ CHECK(FUNC(colour_mapping_octants)(ctx, rw, current, 0, 0, 0, 0, 1 << current->cm_octant_depth));
1137
1138 ✗ return 0;
1139 }
1140
1141 ✗ static int FUNC(pps_multilayer_extension)(CodedBitstreamContext *ctx, RWContext *rw,
1142 H265RawPPS *current)
1143 {
1144 ✗ CodedBitstreamH265Context *h265 = ctx->priv_data;
1145 ✗ const H265RawVPS *vps = h265->active_vps;
1146 int offset;
1147 int err, i;
1148
1149
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 5 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 5 not taken.
✗ flag(poc_reset_info_present_flag);
1150
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 8 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 8 not taken.
✗ flag(pps_infer_scaling_list_flag);
1151
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 13 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 12 not taken.
✗ if (current->pps_infer_scaling_list_flag)
1152
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 12 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 12 not taken.
✗ ub(6, pps_scaling_list_ref_layer_id);
1153
1154
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 16 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 15 not taken.
✗ if (!vps) {
1155 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "VPS missing for PPS Multilayer Extension.\n");
1156 ✗ return AVERROR_INVALIDDATA;
1157 }
1158
1159
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 17 → 18 not taken.
✗ Branch 17 → 19 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 16 → 17 not taken.
✗ Branch 16 → 18 not taken.
✗ ue(num_ref_loc_offsets, 0, vps->vps_max_layers_minus1);
1160
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 78 → 20 not taken.
✗ Branch 78 → 79 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 107 → 19 not taken.
✗ Branch 107 → 108 not taken.
✗ for (i = 0; i < current->num_ref_loc_offsets; i++) {
1161
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 21 → 22 not taken.
✗ Branch 21 → 23 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 20 → 21 not taken.
✗ Branch 20 → 22 not taken.
✗ ubs(6, ref_loc_offset_layer_id[i], 1, i);
1162 ✗ offset = current->ref_loc_offset_layer_id[i];
1163
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 26 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 23 → 24 not taken.
✗ Branch 23 → 25 not taken.
✗ flags(scaled_ref_layer_offset_present_flag[i], 1, i);
1164
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 26 → 27 not taken.
✗ Branch 26 → 40 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 25 → 26 not taken.
✗ Branch 25 → 39 not taken.
✗ if (current->scaled_ref_layer_offset_present_flag[i]) {
1165
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 28 → 29 not taken.
✗ Branch 28 → 30 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 29 not taken.
✗ ses(scaled_ref_layer_left_offset[offset], -16384, 16383, 1, offset);
1166
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 33 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 32 not taken.
✗ ses(scaled_ref_layer_top_offset[offset], -16384, 16383, 1, offset);
1167
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 34 → 35 not taken.
✗ Branch 34 → 36 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 35 not taken.
✗ ses(scaled_ref_layer_right_offset[offset], -16384, 16383, 1, offset);
1168
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 37 → 38 not taken.
✗ Branch 37 → 39 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 36 → 37 not taken.
✗ Branch 36 → 38 not taken.
✗ ses(scaled_ref_layer_bottom_offset[offset], -16384, 16383, 1, offset);
1169 } else {
1170
0/2
✗ Branch 39 → 40 not taken.
✗ Branch 39 → 42 not taken.
✗ infer(scaled_ref_layer_left_offset[offset], 0);
1171
0/2
✗ Branch 42 → 43 not taken.
✗ Branch 42 → 45 not taken.
✗ infer(scaled_ref_layer_top_offset[offset], 0);
1172
0/2
✗ Branch 45 → 46 not taken.
✗ Branch 45 → 48 not taken.
✗ infer(scaled_ref_layer_right_offset[offset], 0);
1173
0/2
✗ Branch 48 → 49 not taken.
✗ Branch 48 → 51 not taken.
✗ infer(scaled_ref_layer_bottom_offset[offset], 0);
1174 }
1175
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 42 → 43 not taken.
✗ Branch 42 → 44 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 52 → 53 not taken.
✗ Branch 52 → 54 not taken.
✗ flags(ref_region_offset_present_flag[i], 1, i);
1176
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 44 → 45 not taken.
✗ Branch 44 → 58 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 54 → 55 not taken.
✗ Branch 54 → 68 not taken.
✗ if (current->ref_region_offset_present_flag[i]) {
1177
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 46 → 47 not taken.
✗ Branch 46 → 48 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 56 → 57 not taken.
✗ Branch 56 → 58 not taken.
✗ ses(ref_region_left_offset[offset], -16384, 16383, 1, offset);
1178
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 49 → 50 not taken.
✗ Branch 49 → 51 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 61 not taken.
✗ ses(ref_region_top_offset[offset], -16384, 16383, 1, offset);
1179
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 52 → 53 not taken.
✗ Branch 52 → 54 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 64 not taken.
✗ ses(ref_region_right_offset[offset], -16384, 16383, 1, offset);
1180
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 55 → 56 not taken.
✗ Branch 55 → 57 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 65 → 66 not taken.
✗ Branch 65 → 67 not taken.
✗ ses(ref_region_bottom_offset[offset], -16384, 16383, 1, offset);
1181 } else {
1182
0/2
✗ Branch 68 → 69 not taken.
✗ Branch 68 → 71 not taken.
✗ infer(ref_region_left_offset[offset], 0);
1183
0/2
✗ Branch 71 → 72 not taken.
✗ Branch 71 → 74 not taken.
✗ infer(ref_region_top_offset[offset], 0);
1184
0/2
✗ Branch 74 → 75 not taken.
✗ Branch 74 → 77 not taken.
✗ infer(ref_region_right_offset[offset], 0);
1185
0/2
✗ Branch 77 → 78 not taken.
✗ Branch 77 → 80 not taken.
✗ infer(ref_region_bottom_offset[offset], 0);
1186 }
1187
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 60 → 61 not taken.
✗ Branch 60 → 62 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 81 → 82 not taken.
✗ Branch 81 → 83 not taken.
✗ flags(resample_phase_set_present_flag[i], 1, i);
1188
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 76 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 83 → 84 not taken.
✗ Branch 83 → 97 not taken.
✗ if (current->resample_phase_set_present_flag[i]) {
1189
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 66 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 85 → 86 not taken.
✗ Branch 85 → 87 not taken.
✗ ues(phase_hor_luma[offset], 0, 31, 1, offset);
1190
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 67 → 68 not taken.
✗ Branch 67 → 69 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 88 → 89 not taken.
✗ Branch 88 → 90 not taken.
✗ ues(phase_ver_luma[offset], 0, 31, 1, offset);
1191
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 70 → 71 not taken.
✗ Branch 70 → 72 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 91 → 92 not taken.
✗ Branch 91 → 93 not taken.
✗ ues(phase_hor_chroma_plus8[offset], 0, 63, 1, offset);
1192
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 73 → 74 not taken.
✗ Branch 73 → 75 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 94 → 95 not taken.
✗ Branch 94 → 96 not taken.
✗ ues(phase_ver_chroma_plus8[offset], 0, 63, 1, offset);
1193 } else {
1194
0/2
✗ Branch 97 → 98 not taken.
✗ Branch 97 → 100 not taken.
✗ infer(phase_hor_luma[offset], 0);
1195
0/2
✗ Branch 100 → 101 not taken.
✗ Branch 100 → 103 not taken.
✗ infer(phase_ver_luma[offset], 0);
1196
0/2
✗ Branch 103 → 104 not taken.
✗ Branch 103 → 106 not taken.
✗ infer(phase_hor_chroma_plus8[offset], 8);
1197 }
1198 }
1199
1200
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 80 → 81 not taken.
✗ Branch 80 → 82 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 109 → 110 not taken.
✗ Branch 109 → 111 not taken.
✗ flag(colour_mapping_enabled_flag);
1201
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 82 → 83 not taken.
✗ Branch 82 → 86 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 111 → 112 not taken.
✗ Branch 111 → 115 not taken.
✗ if (current->colour_mapping_enabled_flag)
1202
0/4
cbs_h265_read_pps_multilayer_extension:
✗ Branch 84 → 85 not taken.
✗ Branch 84 → 86 not taken.
cbs_h265_write_pps_multilayer_extension:
✗ Branch 113 → 114 not taken.
✗ Branch 113 → 115 not taken.
✗ CHECK(FUNC(colour_mapping_table)(ctx, rw, current));
1203
1204 ✗ return 0;
1205 }
1206
1207 ✗ static int FUNC(pps_scc_extension)(CodedBitstreamContext *ctx, RWContext *rw,
1208 H265RawPPS *current)
1209 {
1210 int err, comp, i;
1211
1212
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 5 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 5 not taken.
✗ flag(pps_curr_pic_ref_enabled_flag);
1213
1214
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 8 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 8 not taken.
✗ flag(residual_adaptive_colour_transform_enabled_flag);
1215
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 22 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 22 not taken.
✗ if (current->residual_adaptive_colour_transform_enabled_flag) {
1216
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 12 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 12 not taken.
✗ flag(pps_slice_act_qp_offsets_present_flag);
1217
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 15 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 15 not taken.
✗ se(pps_act_y_qp_offset_plus5, -7, +17);
1218
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 16 → 17 not taken.
✗ Branch 16 → 18 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 16 → 17 not taken.
✗ Branch 16 → 18 not taken.
✗ se(pps_act_cb_qp_offset_plus5, -7, +17);
1219
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 19 → 20 not taken.
✗ Branch 19 → 21 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 19 → 20 not taken.
✗ Branch 19 → 21 not taken.
✗ se(pps_act_cr_qp_offset_plus3, -9, +15);
1220 } else {
1221
0/2
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 25 not taken.
✗ infer(pps_slice_act_qp_offsets_present_flag, 0);
1222
0/2
✗ Branch 25 → 26 not taken.
✗ Branch 25 → 28 not taken.
✗ infer(pps_act_y_qp_offset_plus5, 0);
1223
0/2
✗ Branch 28 → 29 not taken.
✗ Branch 28 → 31 not taken.
✗ infer(pps_act_cb_qp_offset_plus5, 0);
1224
0/2
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 34 not taken.
✗ infer(pps_act_cr_qp_offset_plus3, 0);
1225 }
1226
1227
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 26 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 35 → 36 not taken.
✗ Branch 35 → 37 not taken.
✗ flag(pps_palette_predictor_initializer_present_flag);
1228
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 26 → 27 not taken.
✗ Branch 26 → 57 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 37 → 38 not taken.
✗ Branch 37 → 68 not taken.
✗ if (current->pps_palette_predictor_initializer_present_flag) {
1229
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 28 → 29 not taken.
✗ Branch 28 → 30 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 39 → 40 not taken.
✗ Branch 39 → 41 not taken.
✗ ue(pps_num_palette_predictor_initializer, 0, 128);
1230
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 57 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 41 → 42 not taken.
✗ Branch 41 → 68 not taken.
✗ if (current->pps_num_palette_predictor_initializer > 0) {
1231
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 32 → 33 not taken.
✗ Branch 32 → 34 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 43 → 44 not taken.
✗ Branch 43 → 45 not taken.
✗ flag(monochrome_palette_flag);
1232
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 35 → 36 not taken.
✗ Branch 35 → 37 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 46 → 47 not taken.
✗ Branch 46 → 48 not taken.
✗ ue(luma_bit_depth_entry_minus8, 0, 8);
1233
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 37 → 38 not taken.
✗ Branch 37 → 42 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 48 → 49 not taken.
✗ Branch 48 → 53 not taken.
✗ if (!current->monochrome_palette_flag)
1234
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 39 → 40 not taken.
✗ Branch 39 → 41 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 50 → 51 not taken.
✗ Branch 50 → 52 not taken.
✗ ue(chroma_bit_depth_entry_minus8, 0, 8);
1235
0/8
cbs_h265_read_pps_scc_extension:
✗ Branch 53 → 54 not taken.
✗ Branch 53 → 55 not taken.
✗ Branch 56 → 43 not taken.
✗ Branch 56 → 57 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 66 not taken.
✗ Branch 67 → 54 not taken.
✗ Branch 67 → 68 not taken.
✗ for (comp = 0; comp < (current->monochrome_palette_flag ? 1 : 3); comp++) {
1236 ✗ int bit_depth = comp == 0 ? current->luma_bit_depth_entry_minus8 + 8
1237
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 43 → 44 not taken.
✗ Branch 43 → 45 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 54 → 55 not taken.
✗ Branch 54 → 56 not taken.
✗ : current->chroma_bit_depth_entry_minus8 + 8;
1238
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 51 → 47 not taken.
✗ Branch 51 → 52 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 62 → 58 not taken.
✗ Branch 62 → 63 not taken.
✗ for (i = 0; i < current->pps_num_palette_predictor_initializer; i++)
1239
0/4
cbs_h265_read_pps_scc_extension:
✗ Branch 48 → 49 not taken.
✗ Branch 48 → 50 not taken.
cbs_h265_write_pps_scc_extension:
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 61 not taken.
✗ ubs(bit_depth, pps_palette_predictor_initializers[comp][i], 2, comp, i);
1240 }
1241 }
1242 }
1243
1244 ✗ return 0;
1245 }
1246
1247 714 static int FUNC(pps)(CodedBitstreamContext *ctx, RWContext *rw,
1248 H265RawPPS *current)
1249 {
1250 714 CodedBitstreamH265Context *h265 = ctx->priv_data;
1251 const H265RawSPS *sps;
1252 int err, i;
1253
1254 714 HEADER("Picture Parameter Set");
1255
1256
2/4
cbs_h265_read_pps:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 424 times.
cbs_h265_write_pps:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 290 times.
714 CHECK(FUNC(nal_unit_header)(ctx, rw, &current->nal_unit_header, HEVC_NAL_PPS));
1257
1258
2/4
cbs_h265_read_pps:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 424 times.
cbs_h265_write_pps:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 290 times.
714 ue(pps_pic_parameter_set_id, 0, 63);
1259
2/4
cbs_h265_read_pps:
✗ Branch 10 → 11 not taken.
✓ Branch 10 → 12 taken 424 times.
cbs_h265_write_pps:
✗ Branch 10 → 11 not taken.
✓ Branch 10 → 12 taken 290 times.
714 ue(pps_seq_parameter_set_id, 0, 15);
1260 714 sps = h265->sps[current->pps_seq_parameter_set_id];
1261
2/4
cbs_h265_read_pps:
✗ Branch 12 → 13 not taken.
✓ Branch 12 → 15 taken 424 times.
cbs_h265_write_pps:
✗ Branch 12 → 13 not taken.
✓ Branch 12 → 15 taken 290 times.
714 if (!sps) {
1262 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "SPS id %d not available.\n",
1263 ✗ current->pps_seq_parameter_set_id);
1264 ✗ return AVERROR_INVALIDDATA;
1265 }
1266 714 h265->active_sps = sps;
1267
1268
2/4
cbs_h265_read_pps:
✗ Branch 16 → 17 not taken.
✓ Branch 16 → 18 taken 424 times.
cbs_h265_write_pps:
✗ Branch 16 → 17 not taken.
✓ Branch 16 → 18 taken 290 times.
714 flag(dependent_slice_segments_enabled_flag);
1269
2/4
cbs_h265_read_pps:
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 424 times.
cbs_h265_write_pps:
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 290 times.
714 flag(output_flag_present_flag);
1270
2/4
cbs_h265_read_pps:
✗ Branch 22 → 23 not taken.
✓ Branch 22 → 24 taken 424 times.
cbs_h265_write_pps:
✗ Branch 22 → 23 not taken.
✓ Branch 22 → 24 taken 290 times.
714 ub(3, num_extra_slice_header_bits);
1271
2/4
cbs_h265_read_pps:
✗ Branch 25 → 26 not taken.
✓ Branch 25 → 27 taken 424 times.
cbs_h265_write_pps:
✗ Branch 25 → 26 not taken.
✓ Branch 25 → 27 taken 290 times.
714 flag(sign_data_hiding_enabled_flag);
1272
2/4
cbs_h265_read_pps:
✗ Branch 28 → 29 not taken.
✓ Branch 28 → 30 taken 424 times.
cbs_h265_write_pps:
✗ Branch 28 → 29 not taken.
✓ Branch 28 → 30 taken 290 times.
714 flag(cabac_init_present_flag);
1273
1274
2/4
cbs_h265_read_pps:
✗ Branch 31 → 32 not taken.
✓ Branch 31 → 33 taken 424 times.
cbs_h265_write_pps:
✗ Branch 31 → 32 not taken.
✓ Branch 31 → 33 taken 290 times.
714 ue(num_ref_idx_l0_default_active_minus1, 0, 14);
1275
2/4
cbs_h265_read_pps:
✗ Branch 34 → 35 not taken.
✓ Branch 34 → 36 taken 424 times.
cbs_h265_write_pps:
✗ Branch 34 → 35 not taken.
✓ Branch 34 → 36 taken 290 times.
714 ue(num_ref_idx_l1_default_active_minus1, 0, 14);
1276
1277
2/4
cbs_h265_read_pps:
✗ Branch 37 → 38 not taken.
✓ Branch 37 → 39 taken 424 times.
cbs_h265_write_pps:
✗ Branch 37 → 38 not taken.
✓ Branch 37 → 39 taken 290 times.
714 se(init_qp_minus26, -(26 + 6 * sps->bit_depth_luma_minus8), +25);
1278
1279
2/4
cbs_h265_read_pps:
✗ Branch 40 → 41 not taken.
✓ Branch 40 → 42 taken 424 times.
cbs_h265_write_pps:
✗ Branch 40 → 41 not taken.
✓ Branch 40 → 42 taken 290 times.
714 flag(constrained_intra_pred_flag);
1280
2/4
cbs_h265_read_pps:
✗ Branch 43 → 44 not taken.
✓ Branch 43 → 45 taken 424 times.
cbs_h265_write_pps:
✗ Branch 43 → 44 not taken.
✓ Branch 43 → 45 taken 290 times.
714 flag(transform_skip_enabled_flag);
1281
2/4
cbs_h265_read_pps:
✗ Branch 46 → 47 not taken.
✓ Branch 46 → 48 taken 424 times.
cbs_h265_write_pps:
✗ Branch 46 → 47 not taken.
✓ Branch 46 → 48 taken 290 times.
714 flag(cu_qp_delta_enabled_flag);
1282
4/4
cbs_h265_read_pps:
✓ Branch 48 → 49 taken 17 times.
✓ Branch 48 → 53 taken 407 times.
cbs_h265_write_pps:
✓ Branch 48 → 49 taken 17 times.
✓ Branch 48 → 53 taken 273 times.
714 if (current->cu_qp_delta_enabled_flag)
1283
2/4
cbs_h265_read_pps:
✗ Branch 50 → 51 not taken.
✓ Branch 50 → 52 taken 17 times.
cbs_h265_write_pps:
✗ Branch 50 → 51 not taken.
✓ Branch 50 → 52 taken 17 times.
34 ue(diff_cu_qp_delta_depth,
1284 0, sps->log2_diff_max_min_luma_coding_block_size);
1285 else
1286
1/2
✗ Branch 53 → 54 not taken.
✓ Branch 53 → 56 taken 273 times.
680 infer(diff_cu_qp_delta_depth, 0);
1287
1288
2/4
cbs_h265_read_pps:
✗ Branch 55 → 56 not taken.
✓ Branch 55 → 57 taken 424 times.
cbs_h265_write_pps:
✗ Branch 57 → 58 not taken.
✓ Branch 57 → 59 taken 290 times.
714 se(pps_cb_qp_offset, -12, +12);
1289
2/4
cbs_h265_read_pps:
✗ Branch 58 → 59 not taken.
✓ Branch 58 → 60 taken 424 times.
cbs_h265_write_pps:
✗ Branch 60 → 61 not taken.
✓ Branch 60 → 62 taken 290 times.
714 se(pps_cr_qp_offset, -12, +12);
1290
2/4
cbs_h265_read_pps:
✗ Branch 61 → 62 not taken.
✓ Branch 61 → 63 taken 424 times.
cbs_h265_write_pps:
✗ Branch 63 → 64 not taken.
✓ Branch 63 → 65 taken 290 times.
714 flag(pps_slice_chroma_qp_offsets_present_flag);
1291
1292
2/4
cbs_h265_read_pps:
✗ Branch 64 → 65 not taken.
✓ Branch 64 → 66 taken 424 times.
cbs_h265_write_pps:
✗ Branch 66 → 67 not taken.
✓ Branch 66 → 68 taken 290 times.
714 flag(weighted_pred_flag);
1293
2/4
cbs_h265_read_pps:
✗ Branch 67 → 68 not taken.
✓ Branch 67 → 69 taken 424 times.
cbs_h265_write_pps:
✗ Branch 69 → 70 not taken.
✓ Branch 69 → 71 taken 290 times.
714 flag(weighted_bipred_flag);
1294
1295
2/4
cbs_h265_read_pps:
✗ Branch 70 → 71 not taken.
✓ Branch 70 → 72 taken 424 times.
cbs_h265_write_pps:
✗ Branch 72 → 73 not taken.
✓ Branch 72 → 74 taken 290 times.
714 flag(transquant_bypass_enabled_flag);
1296
2/4
cbs_h265_read_pps:
✗ Branch 73 → 74 not taken.
✓ Branch 73 → 75 taken 424 times.
cbs_h265_write_pps:
✗ Branch 75 → 76 not taken.
✓ Branch 75 → 77 taken 290 times.
714 flag(tiles_enabled_flag);
1297
2/4
cbs_h265_read_pps:
✗ Branch 76 → 77 not taken.
✓ Branch 76 → 78 taken 424 times.
cbs_h265_write_pps:
✗ Branch 78 → 79 not taken.
✓ Branch 78 → 80 taken 290 times.
714 flag(entropy_coding_sync_enabled_flag);
1298
1299
4/4
cbs_h265_read_pps:
✓ Branch 78 → 79 taken 105 times.
✓ Branch 78 → 105 taken 319 times.
cbs_h265_write_pps:
✓ Branch 80 → 81 taken 105 times.
✓ Branch 80 → 106 taken 185 times.
714 if (current->tiles_enabled_flag) {
1300
2/4
cbs_h265_read_pps:
✗ Branch 80 → 81 not taken.
✓ Branch 80 → 82 taken 105 times.
cbs_h265_write_pps:
✗ Branch 82 → 83 not taken.
✓ Branch 82 → 84 taken 105 times.
210 ue(num_tile_columns_minus1, 0, HEVC_MAX_TILE_COLUMNS);
1301
2/4
cbs_h265_read_pps:
✗ Branch 83 → 84 not taken.
✓ Branch 83 → 85 taken 105 times.
cbs_h265_write_pps:
✗ Branch 85 → 86 not taken.
✓ Branch 85 → 87 taken 105 times.
210 ue(num_tile_rows_minus1, 0, HEVC_MAX_TILE_ROWS);
1302
2/4
cbs_h265_read_pps:
✗ Branch 86 → 87 not taken.
✓ Branch 86 → 88 taken 105 times.
cbs_h265_write_pps:
✗ Branch 88 → 89 not taken.
✓ Branch 88 → 90 taken 105 times.
210 flag(uniform_spacing_flag);
1303
4/4
cbs_h265_read_pps:
✓ Branch 88 → 89 taken 101 times.
✓ Branch 88 → 101 taken 4 times.
cbs_h265_write_pps:
✓ Branch 90 → 91 taken 101 times.
✓ Branch 90 → 103 taken 4 times.
210 if (!current->uniform_spacing_flag) {
1304
4/4
cbs_h265_read_pps:
✓ Branch 94 → 90 taken 404 times.
✓ Branch 94 → 95 taken 101 times.
cbs_h265_write_pps:
✓ Branch 96 → 92 taken 404 times.
✓ Branch 96 → 97 taken 101 times.
1010 for (i = 0; i < current->num_tile_columns_minus1; i++)
1305
2/4
cbs_h265_read_pps:
✗ Branch 91 → 92 not taken.
✓ Branch 91 → 93 taken 404 times.
cbs_h265_write_pps:
✗ Branch 93 → 94 not taken.
✓ Branch 93 → 95 taken 404 times.
808 ues(column_width_minus1[i], 0, sps->pic_width_in_luma_samples, 1, i);
1306
4/4
cbs_h265_read_pps:
✓ Branch 100 → 96 taken 404 times.
✓ Branch 100 → 101 taken 101 times.
cbs_h265_write_pps:
✓ Branch 102 → 98 taken 404 times.
✓ Branch 102 → 103 taken 101 times.
1010 for (i = 0; i < current->num_tile_rows_minus1; i++)
1307
2/4
cbs_h265_read_pps:
✗ Branch 97 → 98 not taken.
✓ Branch 97 → 99 taken 404 times.
cbs_h265_write_pps:
✗ Branch 99 → 100 not taken.
✓ Branch 99 → 101 taken 404 times.
808 ues(row_height_minus1[i], 0, sps->pic_height_in_luma_samples, 1, i);
1308 }
1309
2/4
cbs_h265_read_pps:
✗ Branch 102 → 103 not taken.
✓ Branch 102 → 104 taken 105 times.
cbs_h265_write_pps:
✗ Branch 104 → 105 not taken.
✓ Branch 104 → 112 taken 105 times.
210 flag(loop_filter_across_tiles_enabled_flag);
1310 } else {
1311
1/2
✗ Branch 106 → 107 not taken.
✓ Branch 106 → 109 taken 185 times.
504 infer(num_tile_columns_minus1, 0);
1312
1/2
✗ Branch 109 → 110 not taken.
✓ Branch 109 → 112 taken 185 times.
504 infer(num_tile_rows_minus1, 0);
1313 }
1314
1315
2/4
cbs_h265_read_pps:
✗ Branch 107 → 108 not taken.
✓ Branch 107 → 109 taken 424 times.
cbs_h265_write_pps:
✗ Branch 113 → 114 not taken.
✓ Branch 113 → 115 taken 290 times.
714 flag(pps_loop_filter_across_slices_enabled_flag);
1316
2/4
cbs_h265_read_pps:
✗ Branch 110 → 111 not taken.
✓ Branch 110 → 112 taken 424 times.
cbs_h265_write_pps:
✗ Branch 116 → 117 not taken.
✓ Branch 116 → 118 taken 290 times.
714 flag(deblocking_filter_control_present_flag);
1317
4/4
cbs_h265_read_pps:
✓ Branch 112 → 113 taken 113 times.
✓ Branch 112 → 128 taken 311 times.
cbs_h265_write_pps:
✓ Branch 118 → 119 taken 113 times.
✓ Branch 118 → 139 taken 177 times.
714 if (current->deblocking_filter_control_present_flag) {
1318
2/4
cbs_h265_read_pps:
✗ Branch 114 → 115 not taken.
✓ Branch 114 → 116 taken 113 times.
cbs_h265_write_pps:
✗ Branch 120 → 121 not taken.
✓ Branch 120 → 122 taken 113 times.
226 flag(deblocking_filter_override_enabled_flag);
1319
2/4
cbs_h265_read_pps:
✗ Branch 117 → 118 not taken.
✓ Branch 117 → 119 taken 113 times.
cbs_h265_write_pps:
✗ Branch 123 → 124 not taken.
✓ Branch 123 → 125 taken 113 times.
226 flag(pps_deblocking_filter_disabled_flag);
1320
4/4
cbs_h265_read_pps:
✓ Branch 119 → 120 taken 111 times.
✓ Branch 119 → 127 taken 2 times.
cbs_h265_write_pps:
✓ Branch 125 → 126 taken 111 times.
✓ Branch 125 → 133 taken 2 times.
226 if (!current->pps_deblocking_filter_disabled_flag) {
1321
2/4
cbs_h265_read_pps:
✗ Branch 121 → 122 not taken.
✓ Branch 121 → 123 taken 111 times.
cbs_h265_write_pps:
✗ Branch 127 → 128 not taken.
✓ Branch 127 → 129 taken 111 times.
222 se(pps_beta_offset_div2, -6, +6);
1322
2/4
cbs_h265_read_pps:
✗ Branch 124 → 125 not taken.
✓ Branch 124 → 126 taken 111 times.
cbs_h265_write_pps:
✗ Branch 130 → 131 not taken.
✓ Branch 130 → 132 taken 111 times.
222 se(pps_tc_offset_div2, -6, +6);
1323 } else {
1324
1/2
✗ Branch 133 → 134 not taken.
✓ Branch 133 → 136 taken 2 times.
4 infer(pps_beta_offset_div2, 0);
1325
1/2
✗ Branch 136 → 137 not taken.
✓ Branch 136 → 151 taken 2 times.
4 infer(pps_tc_offset_div2, 0);
1326 }
1327 } else {
1328
1/2
✗ Branch 139 → 140 not taken.
✓ Branch 139 → 142 taken 177 times.
488 infer(deblocking_filter_override_enabled_flag, 0);
1329
1/2
✗ Branch 142 → 143 not taken.
✓ Branch 142 → 145 taken 177 times.
488 infer(pps_deblocking_filter_disabled_flag, 0);
1330
1/2
✗ Branch 145 → 146 not taken.
✓ Branch 145 → 148 taken 177 times.
488 infer(pps_beta_offset_div2, 0);
1331
1/2
✗ Branch 148 → 149 not taken.
✓ Branch 148 → 151 taken 177 times.
488 infer(pps_tc_offset_div2, 0);
1332 }
1333
1334
2/4
cbs_h265_read_pps:
✗ Branch 130 → 131 not taken.
✓ Branch 130 → 132 taken 424 times.
cbs_h265_write_pps:
✗ Branch 152 → 153 not taken.
✓ Branch 152 → 154 taken 290 times.
714 flag(pps_scaling_list_data_present_flag);
1335
4/4
cbs_h265_read_pps:
✓ Branch 132 → 133 taken 168 times.
✓ Branch 132 → 136 taken 256 times.
cbs_h265_write_pps:
✓ Branch 154 → 155 taken 84 times.
✓ Branch 154 → 158 taken 206 times.
714 if (current->pps_scaling_list_data_present_flag)
1336
2/4
cbs_h265_read_pps:
✗ Branch 134 → 135 not taken.
✓ Branch 134 → 136 taken 168 times.
cbs_h265_write_pps:
✗ Branch 156 → 157 not taken.
✓ Branch 156 → 158 taken 84 times.
252 CHECK(FUNC(scaling_list_data)(ctx, rw, &current->scaling_list));
1337
1338
2/4
cbs_h265_read_pps:
✗ Branch 137 → 138 not taken.
✓ Branch 137 → 139 taken 424 times.
cbs_h265_write_pps:
✗ Branch 159 → 160 not taken.
✓ Branch 159 → 161 taken 290 times.
714 flag(lists_modification_present_flag);
1339
1340
2/4
cbs_h265_read_pps:
✗ Branch 140 → 141 not taken.
✓ Branch 140 → 142 taken 424 times.
cbs_h265_write_pps:
✗ Branch 162 → 163 not taken.
✓ Branch 162 → 164 taken 290 times.
714 ue(log2_parallel_merge_level_minus2,
1341 0, (sps->log2_min_luma_coding_block_size_minus3 + 3 +
1342 sps->log2_diff_max_min_luma_coding_block_size - 2));
1343
1344
2/4
cbs_h265_read_pps:
✗ Branch 143 → 144 not taken.
✓ Branch 143 → 145 taken 424 times.
cbs_h265_write_pps:
✗ Branch 165 → 166 not taken.
✓ Branch 165 → 167 taken 290 times.
714 flag(slice_segment_header_extension_present_flag);
1345
1346
2/4
cbs_h265_read_pps:
✗ Branch 146 → 147 not taken.
✓ Branch 146 → 148 taken 424 times.
cbs_h265_write_pps:
✗ Branch 168 → 169 not taken.
✓ Branch 168 → 170 taken 290 times.
714 flag(pps_extension_present_flag);
1347
2/4
cbs_h265_read_pps:
✗ Branch 148 → 149 not taken.
✓ Branch 148 → 165 taken 424 times.
cbs_h265_write_pps:
✗ Branch 170 → 171 not taken.
✓ Branch 170 → 186 taken 290 times.
714 if (current->pps_extension_present_flag) {
1348
0/4
cbs_h265_read_pps:
✗ Branch 150 → 151 not taken.
✗ Branch 150 → 152 not taken.
cbs_h265_write_pps:
✗ Branch 172 → 173 not taken.
✗ Branch 172 → 174 not taken.
✗ flag(pps_range_extension_flag);
1349
0/4
cbs_h265_read_pps:
✗ Branch 153 → 154 not taken.
✗ Branch 153 → 155 not taken.
cbs_h265_write_pps:
✗ Branch 175 → 176 not taken.
✗ Branch 175 → 177 not taken.
✗ flag(pps_multilayer_extension_flag);
1350
0/4
cbs_h265_read_pps:
✗ Branch 156 → 157 not taken.
✗ Branch 156 → 158 not taken.
cbs_h265_write_pps:
✗ Branch 178 → 179 not taken.
✗ Branch 178 → 180 not taken.
✗ flag(pps_3d_extension_flag);
1351
0/4
cbs_h265_read_pps:
✗ Branch 159 → 160 not taken.
✗ Branch 159 → 161 not taken.
cbs_h265_write_pps:
✗ Branch 181 → 182 not taken.
✗ Branch 181 → 183 not taken.
✗ flag(pps_scc_extension_flag);
1352
0/4
cbs_h265_read_pps:
✗ Branch 162 → 163 not taken.
✗ Branch 162 → 164 not taken.
cbs_h265_write_pps:
✗ Branch 184 → 185 not taken.
✗ Branch 184 → 186 not taken.
✗ ub(4, pps_extension_4bits);
1353 }
1354
2/4
cbs_h265_read_pps:
✗ Branch 165 → 166 not taken.
✓ Branch 165 → 169 taken 424 times.
cbs_h265_write_pps:
✗ Branch 186 → 187 not taken.
✓ Branch 186 → 190 taken 290 times.
714 if (current->pps_range_extension_flag)
1355
0/4
cbs_h265_read_pps:
✗ Branch 167 → 168 not taken.
✗ Branch 167 → 169 not taken.
cbs_h265_write_pps:
✗ Branch 188 → 189 not taken.
✗ Branch 188 → 190 not taken.
✗ CHECK(FUNC(pps_range_extension)(ctx, rw, current));
1356
2/4
cbs_h265_read_pps:
✗ Branch 169 → 170 not taken.
✓ Branch 169 → 173 taken 424 times.
cbs_h265_write_pps:
✗ Branch 190 → 191 not taken.
✓ Branch 190 → 194 taken 290 times.
714 if (current->pps_multilayer_extension_flag)
1357
0/4
cbs_h265_read_pps:
✗ Branch 171 → 172 not taken.
✗ Branch 171 → 173 not taken.
cbs_h265_write_pps:
✗ Branch 192 → 193 not taken.
✗ Branch 192 → 194 not taken.
✗ CHECK(FUNC(pps_multilayer_extension)(ctx, rw, current));
1358
2/4
cbs_h265_read_pps:
✗ Branch 173 → 174 not taken.
✓ Branch 173 → 175 taken 424 times.
cbs_h265_write_pps:
✗ Branch 194 → 195 not taken.
✓ Branch 194 → 196 taken 290 times.
714 if (current->pps_3d_extension_flag)
1359 ✗ return AVERROR_PATCHWELCOME;
1360
2/4
cbs_h265_read_pps:
✗ Branch 175 → 176 not taken.
✓ Branch 175 → 179 taken 424 times.
cbs_h265_write_pps:
✗ Branch 196 → 197 not taken.
✓ Branch 196 → 200 taken 290 times.
714 if (current->pps_scc_extension_flag)
1361
0/4
cbs_h265_read_pps:
✗ Branch 177 → 178 not taken.
✗ Branch 177 → 179 not taken.
cbs_h265_write_pps:
✗ Branch 198 → 199 not taken.
✗ Branch 198 → 200 not taken.
✗ CHECK(FUNC(pps_scc_extension)(ctx, rw, current));
1362
2/4
cbs_h265_read_pps:
✗ Branch 179 → 180 not taken.
✓ Branch 179 → 183 taken 424 times.
cbs_h265_write_pps:
✗ Branch 200 → 201 not taken.
✓ Branch 200 → 204 taken 290 times.
714 if (current->pps_extension_4bits)
1363
0/4
cbs_h265_read_pps:
✗ Branch 181 → 182 not taken.
✗ Branch 181 → 183 not taken.
cbs_h265_write_pps:
✗ Branch 202 → 203 not taken.
✗ Branch 202 → 204 not taken.
✗ CHECK(FUNC(extension_data)(ctx, rw, &current->extension_data));
1364
1365
2/4
cbs_h265_read_pps:
✗ Branch 184 → 185 not taken.
✓ Branch 184 → 186 taken 424 times.
cbs_h265_write_pps:
✗ Branch 205 → 206 not taken.
✓ Branch 205 → 207 taken 290 times.
714 CHECK(FUNC(rbsp_trailing_bits)(ctx, rw));
1366
1367 714 return 0;
1368 }
1369
1370 120 static int FUNC(aud)(CodedBitstreamContext *ctx, RWContext *rw,
1371 H265RawAUD *current)
1372 {
1373 int err;
1374
1375 120 HEADER("Access Unit Delimiter");
1376
1377
2/4
cbs_h265_read_aud:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 60 times.
cbs_h265_write_aud:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 60 times.
120 CHECK(FUNC(nal_unit_header)(ctx, rw, &current->nal_unit_header, HEVC_NAL_AUD));
1378
1379
2/4
cbs_h265_read_aud:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 60 times.
cbs_h265_write_aud:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 60 times.
120 u(3, pic_type, 0, 2);
1380
1381
2/4
cbs_h265_read_aud:
✗ Branch 10 → 11 not taken.
✓ Branch 10 → 12 taken 60 times.
cbs_h265_write_aud:
✗ Branch 10 → 11 not taken.
✓ Branch 10 → 12 taken 60 times.
120 CHECK(FUNC(rbsp_trailing_bits)(ctx, rw));
1382
1383 120 return 0;
1384 }
1385
1386 1496 static int FUNC(ref_pic_lists_modification)(CodedBitstreamContext *ctx, RWContext *rw,
1387 H265RawSliceHeader *current,
1388 unsigned int num_pic_total_curr)
1389 {
1390 unsigned int entry_size;
1391 int err, i;
1392
1393 1496 entry_size = av_log2(num_pic_total_curr - 1) + 1;
1394
1395
2/4
cbs_h265_read_ref_pic_lists_modification:
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 748 times.
cbs_h265_write_ref_pic_lists_modification:
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 748 times.
1496 flag(ref_pic_list_modification_flag_l0);
1396
4/4
cbs_h265_read_ref_pic_lists_modification:
✓ Branch 5 → 6 taken 363 times.
✓ Branch 5 → 12 taken 385 times.
cbs_h265_write_ref_pic_lists_modification:
✓ Branch 5 → 6 taken 363 times.
✓ Branch 5 → 12 taken 385 times.
1496 if (current->ref_pic_list_modification_flag_l0) {
1397
4/4
cbs_h265_read_ref_pic_lists_modification:
✓ Branch 11 → 7 taken 836 times.
✓ Branch 11 → 12 taken 363 times.
cbs_h265_write_ref_pic_lists_modification:
✓ Branch 11 → 7 taken 836 times.
✓ Branch 11 → 12 taken 363 times.
2398 for (i = 0; i <= current->num_ref_idx_l0_active_minus1; i++)
1398
2/4
cbs_h265_read_ref_pic_lists_modification:
✗ Branch 8 → 9 not taken.
✓ Branch 8 → 10 taken 836 times.
cbs_h265_write_ref_pic_lists_modification:
✗ Branch 8 → 9 not taken.
✓ Branch 8 → 10 taken 836 times.
1672 us(entry_size, list_entry_l0[i], 0, num_pic_total_curr - 1, 1, i);
1399 }
1400
1401
2/4
cbs_h265_read_ref_pic_lists_modification:
✓ Branch 12 → 13 taken 748 times.
✗ Branch 12 → 23 not taken.
cbs_h265_write_ref_pic_lists_modification:
✓ Branch 12 → 13 taken 748 times.
✗ Branch 12 → 23 not taken.
1496 if (current->slice_type == HEVC_SLICE_B) {
1402
2/4
cbs_h265_read_ref_pic_lists_modification:
✗ Branch 14 → 15 not taken.
✓ Branch 14 → 16 taken 748 times.
cbs_h265_write_ref_pic_lists_modification:
✗ Branch 14 → 15 not taken.
✓ Branch 14 → 16 taken 748 times.
1496 flag(ref_pic_list_modification_flag_l1);
1403
4/4
cbs_h265_read_ref_pic_lists_modification:
✓ Branch 16 → 17 taken 213 times.
✓ Branch 16 → 23 taken 535 times.
cbs_h265_write_ref_pic_lists_modification:
✓ Branch 16 → 17 taken 213 times.
✓ Branch 16 → 23 taken 535 times.
1496 if (current->ref_pic_list_modification_flag_l1) {
1404
4/4
cbs_h265_read_ref_pic_lists_modification:
✓ Branch 22 → 18 taken 505 times.
✓ Branch 22 → 23 taken 213 times.
cbs_h265_write_ref_pic_lists_modification:
✓ Branch 22 → 18 taken 505 times.
✓ Branch 22 → 23 taken 213 times.
1436 for (i = 0; i <= current->num_ref_idx_l1_active_minus1; i++)
1405
2/4
cbs_h265_read_ref_pic_lists_modification:
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 505 times.
cbs_h265_write_ref_pic_lists_modification:
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 505 times.
1010 us(entry_size, list_entry_l1[i], 0, num_pic_total_curr - 1, 1, i);
1406 }
1407 }
1408
1409 1496 return 0;
1410 }
1411
1412 514 static int FUNC(pred_weight_table)(CodedBitstreamContext *ctx, RWContext *rw,
1413 H265RawSliceHeader *current)
1414 {
1415 514 CodedBitstreamH265Context *h265 = ctx->priv_data;
1416 514 const H265RawSPS *sps = h265->active_sps;
1417 int err, i, j;
1418
2/4
cbs_h265_read_pred_weight_table:
✓ Branch 2 → 3 taken 257 times.
✗ Branch 2 → 5 not taken.
cbs_h265_write_pred_weight_table:
✓ Branch 2 → 3 taken 257 times.
✗ Branch 2 → 5 not taken.
1028 int chroma = !sps->separate_colour_plane_flag &&
1419
2/4
cbs_h265_read_pred_weight_table:
✓ Branch 3 → 4 taken 257 times.
✗ Branch 3 → 5 not taken.
cbs_h265_write_pred_weight_table:
✓ Branch 3 → 4 taken 257 times.
✗ Branch 3 → 5 not taken.
514 sps->chroma_format_idc != 0;
1420
1421
2/4
cbs_h265_read_pred_weight_table:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 257 times.
cbs_h265_write_pred_weight_table:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 257 times.
514 ue(luma_log2_weight_denom, 0, 7);
1422
2/4
cbs_h265_read_pred_weight_table:
✓ Branch 9 → 10 taken 257 times.
✗ Branch 9 → 14 not taken.
cbs_h265_write_pred_weight_table:
✓ Branch 9 → 10 taken 257 times.
✗ Branch 9 → 14 not taken.
514 if (chroma)
1423
2/4
cbs_h265_read_pred_weight_table:
✗ Branch 11 → 12 not taken.
✓ Branch 11 → 13 taken 257 times.
cbs_h265_write_pred_weight_table:
✗ Branch 11 → 12 not taken.
✓ Branch 11 → 13 taken 257 times.
514 se(delta_chroma_log2_weight_denom, -7, 7);
1424 else
1425
0/2
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 17 not taken.
✗ infer(delta_chroma_log2_weight_denom, 0);
1426
1427
4/4
cbs_h265_read_pred_weight_table:
✓ Branch 20 → 16 taken 1016 times.
✓ Branch 20 → 21 taken 257 times.
cbs_h265_write_pred_weight_table:
✓ Branch 22 → 18 taken 1016 times.
✓ Branch 22 → 23 taken 257 times.
2546 for (i = 0; i <= current->num_ref_idx_l0_active_minus1; i++) {
1428 if (1 /* is not same POC and same layer_id */)
1429
2/4
cbs_h265_read_pred_weight_table:
✗ Branch 17 → 18 not taken.
✓ Branch 17 → 19 taken 1016 times.
cbs_h265_write_pred_weight_table:
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 21 taken 1016 times.
2032 flags(luma_weight_l0_flag[i], 1, i);
1430 else
1431 infer(luma_weight_l0_flag[i], 0);
1432 }
1433
2/4
cbs_h265_read_pred_weight_table:
✓ Branch 21 → 22 taken 257 times.
✗ Branch 21 → 28 not taken.
cbs_h265_write_pred_weight_table:
✓ Branch 23 → 24 taken 257 times.
✗ Branch 23 → 30 not taken.
514 if (chroma) {
1434
4/4
cbs_h265_read_pred_weight_table:
✓ Branch 27 → 23 taken 1016 times.
✓ Branch 27 → 28 taken 257 times.
cbs_h265_write_pred_weight_table:
✓ Branch 29 → 25 taken 1016 times.
✓ Branch 29 → 30 taken 257 times.
2546 for (i = 0; i <= current->num_ref_idx_l0_active_minus1; i++) {
1435 if (1 /* is not same POC and same layer_id */)
1436
2/4
cbs_h265_read_pred_weight_table:
✗ Branch 24 → 25 not taken.
✓ Branch 24 → 26 taken 1016 times.
cbs_h265_write_pred_weight_table:
✗ Branch 26 → 27 not taken.
✓ Branch 26 → 28 taken 1016 times.
2032 flags(chroma_weight_l0_flag[i], 1, i);
1437 else
1438 infer(chroma_weight_l0_flag[i], 0);
1439 }
1440 }
1441
1442
4/4
cbs_h265_read_pred_weight_table:
✓ Branch 52 → 29 taken 1016 times.
✓ Branch 52 → 53 taken 257 times.
cbs_h265_write_pred_weight_table:
✓ Branch 65 → 31 taken 1016 times.
✓ Branch 65 → 66 taken 257 times.
2546 for (i = 0; i <= current->num_ref_idx_l0_active_minus1; i++) {
1443
4/4
cbs_h265_read_pred_weight_table:
✓ Branch 29 → 30 taken 770 times.
✓ Branch 29 → 37 taken 246 times.
cbs_h265_write_pred_weight_table:
✓ Branch 31 → 32 taken 770 times.
✓ Branch 31 → 39 taken 246 times.
2032 if (current->luma_weight_l0_flag[i]) {
1444
2/4
cbs_h265_read_pred_weight_table:
✗ Branch 31 → 32 not taken.
✓ Branch 31 → 33 taken 770 times.
cbs_h265_write_pred_weight_table:
✗ Branch 33 → 34 not taken.
✓ Branch 33 → 35 taken 770 times.
1540 ses(delta_luma_weight_l0[i], -128, +127, 1, i);
1445
2/4
cbs_h265_read_pred_weight_table:
✗ Branch 34 → 35 not taken.
✓ Branch 34 → 36 taken 770 times.
cbs_h265_write_pred_weight_table:
✗ Branch 36 → 37 not taken.
✓ Branch 36 → 38 taken 770 times.
1540 ses(luma_offset_l0[i],
1446 -(1 << (sps->bit_depth_luma_minus8 + 8 - 1)),
1447 ((1 << (sps->bit_depth_luma_minus8 + 8 - 1)) - 1), 1, i);
1448 } else {
1449
1/2
✗ Branch 39 → 40 not taken.
✓ Branch 39 → 42 taken 246 times.
492 infer(delta_luma_weight_l0[i], 0);
1450
1/2
✗ Branch 42 → 43 not taken.
✓ Branch 42 → 45 taken 246 times.
492 infer(luma_offset_l0[i], 0);
1451 }
1452
4/4
cbs_h265_read_pred_weight_table:
✓ Branch 38 → 39 taken 253 times.
✓ Branch 38 → 48 taken 763 times.
cbs_h265_write_pred_weight_table:
✓ Branch 45 → 46 taken 253 times.
✓ Branch 45 → 55 taken 763 times.
2032 if (current->chroma_weight_l0_flag[i]) {
1453
4/4
cbs_h265_read_pred_weight_table:
✓ Branch 47 → 40 taken 506 times.
✓ Branch 47 → 51 taken 253 times.
cbs_h265_write_pred_weight_table:
✓ Branch 54 → 47 taken 506 times.
✓ Branch 54 → 64 taken 253 times.
1518 for (j = 0; j < 2; j++) {
1454
2/4
cbs_h265_read_pred_weight_table:
✗ Branch 41 → 42 not taken.
✓ Branch 41 → 43 taken 506 times.
cbs_h265_write_pred_weight_table:
✗ Branch 48 → 49 not taken.
✓ Branch 48 → 50 taken 506 times.
1012 ses(delta_chroma_weight_l0[i][j], -128, +127, 2, i, j);
1455
2/4
cbs_h265_read_pred_weight_table:
✗ Branch 44 → 45 not taken.
✓ Branch 44 → 46 taken 506 times.
cbs_h265_write_pred_weight_table:
✗ Branch 51 → 52 not taken.
✓ Branch 51 → 53 taken 506 times.
1012 ses(chroma_offset_l0[i][j],
1456 -(4 << (sps->bit_depth_chroma_minus8 + 8 - 1)),
1457 ((4 << (sps->bit_depth_chroma_minus8 + 8 - 1)) - 1), 2, i, j);
1458 }
1459 } else {
1460
4/4
cbs_h265_read_pred_weight_table:
✓ Branch 50 → 49 taken 1526 times.
✓ Branch 50 → 51 taken 763 times.
cbs_h265_write_pred_weight_table:
✓ Branch 63 → 56 taken 1526 times.
✓ Branch 63 → 64 taken 763 times.
4578 for (j = 0; j < 2; j++) {
1461
1/2
✗ Branch 56 → 57 not taken.
✓ Branch 56 → 59 taken 1526 times.
3052 infer(delta_chroma_weight_l0[i][j], 0);
1462
1/2
✗ Branch 59 → 60 not taken.
✓ Branch 59 → 62 taken 1526 times.
3052 infer(chroma_offset_l0[i][j], 0);
1463 }
1464 }
1465 }
1466
1467
2/4
cbs_h265_read_pred_weight_table:
✗ Branch 53 → 54 not taken.
✓ Branch 53 → 92 taken 257 times.
cbs_h265_write_pred_weight_table:
✗ Branch 66 → 67 not taken.
✓ Branch 66 → 116 taken 257 times.
514 if (current->slice_type == HEVC_SLICE_B) {
1468
0/4
cbs_h265_read_pred_weight_table:
✗ Branch 59 → 55 not taken.
✗ Branch 59 → 60 not taken.
cbs_h265_write_pred_weight_table:
✗ Branch 72 → 68 not taken.
✗ Branch 72 → 73 not taken.
✗ for (i = 0; i <= current->num_ref_idx_l1_active_minus1; i++) {
1469 if (1 /* RefPicList1[i] is not CurrPic, nor is it in a different layer */)
1470
0/4
cbs_h265_read_pred_weight_table:
✗ Branch 56 → 57 not taken.
✗ Branch 56 → 58 not taken.
cbs_h265_write_pred_weight_table:
✗ Branch 69 → 70 not taken.
✗ Branch 69 → 71 not taken.
✗ flags(luma_weight_l1_flag[i], 1, i);
1471 else
1472 infer(luma_weight_l1_flag[i], 0);
1473 }
1474
0/4
cbs_h265_read_pred_weight_table:
✗ Branch 60 → 61 not taken.
✗ Branch 60 → 67 not taken.
cbs_h265_write_pred_weight_table:
✗ Branch 73 → 74 not taken.
✗ Branch 73 → 80 not taken.
✗ if (chroma) {
1475
0/4
cbs_h265_read_pred_weight_table:
✗ Branch 66 → 62 not taken.
✗ Branch 66 → 67 not taken.
cbs_h265_write_pred_weight_table:
✗ Branch 79 → 75 not taken.
✗ Branch 79 → 80 not taken.
✗ for (i = 0; i <= current->num_ref_idx_l1_active_minus1; i++) {
1476 if (1 /* RefPicList1[i] is not CurrPic, nor is it in a different layer */)
1477
0/4
cbs_h265_read_pred_weight_table:
✗ Branch 63 → 64 not taken.
✗ Branch 63 → 65 not taken.
cbs_h265_write_pred_weight_table:
✗ Branch 76 → 77 not taken.
✗ Branch 76 → 78 not taken.
✗ flags(chroma_weight_l1_flag[i], 1, i);
1478 else
1479 infer(chroma_weight_l1_flag[i], 0);
1480 }
1481 }
1482
1483
0/4
cbs_h265_read_pred_weight_table:
✗ Branch 91 → 68 not taken.
✗ Branch 91 → 92 not taken.
cbs_h265_write_pred_weight_table:
✗ Branch 115 → 81 not taken.
✗ Branch 115 → 116 not taken.
✗ for (i = 0; i <= current->num_ref_idx_l1_active_minus1; i++) {
1484
0/4
cbs_h265_read_pred_weight_table:
✗ Branch 68 → 69 not taken.
✗ Branch 68 → 76 not taken.
cbs_h265_write_pred_weight_table:
✗ Branch 81 → 82 not taken.
✗ Branch 81 → 89 not taken.
✗ if (current->luma_weight_l1_flag[i]) {
1485
0/4
cbs_h265_read_pred_weight_table:
✗ Branch 70 → 71 not taken.
✗ Branch 70 → 72 not taken.
cbs_h265_write_pred_weight_table:
✗ Branch 83 → 84 not taken.
✗ Branch 83 → 85 not taken.
✗ ses(delta_luma_weight_l1[i], -128, +127, 1, i);
1486
0/4
cbs_h265_read_pred_weight_table:
✗ Branch 73 → 74 not taken.
✗ Branch 73 → 75 not taken.
cbs_h265_write_pred_weight_table:
✗ Branch 86 → 87 not taken.
✗ Branch 86 → 88 not taken.
✗ ses(luma_offset_l1[i],
1487 -(1 << (sps->bit_depth_luma_minus8 + 8 - 1)),
1488 ((1 << (sps->bit_depth_luma_minus8 + 8 - 1)) - 1), 1, i);
1489 } else {
1490
0/2
✗ Branch 89 → 90 not taken.
✗ Branch 89 → 92 not taken.
✗ infer(delta_luma_weight_l1[i], 0);
1491
0/2
✗ Branch 92 → 93 not taken.
✗ Branch 92 → 95 not taken.
✗ infer(luma_offset_l1[i], 0);
1492 }
1493
0/4
cbs_h265_read_pred_weight_table:
✗ Branch 77 → 78 not taken.
✗ Branch 77 → 87 not taken.
cbs_h265_write_pred_weight_table:
✗ Branch 95 → 96 not taken.
✗ Branch 95 → 105 not taken.
✗ if (current->chroma_weight_l1_flag[i]) {
1494
0/4
cbs_h265_read_pred_weight_table:
✗ Branch 86 → 79 not taken.
✗ Branch 86 → 90 not taken.
cbs_h265_write_pred_weight_table:
✗ Branch 104 → 97 not taken.
✗ Branch 104 → 114 not taken.
✗ for (j = 0; j < 2; j++) {
1495
0/4
cbs_h265_read_pred_weight_table:
✗ Branch 80 → 81 not taken.
✗ Branch 80 → 82 not taken.
cbs_h265_write_pred_weight_table:
✗ Branch 98 → 99 not taken.
✗ Branch 98 → 100 not taken.
✗ ses(delta_chroma_weight_l1[i][j], -128, +127, 2, i, j);
1496
0/4
cbs_h265_read_pred_weight_table:
✗ Branch 83 → 84 not taken.
✗ Branch 83 → 85 not taken.
cbs_h265_write_pred_weight_table:
✗ Branch 101 → 102 not taken.
✗ Branch 101 → 103 not taken.
✗ ses(chroma_offset_l1[i][j],
1497 -(4 << (sps->bit_depth_chroma_minus8 + 8 - 1)),
1498 ((4 << (sps->bit_depth_chroma_minus8 + 8 - 1)) - 1), 2, i, j);
1499 }
1500 } else {
1501
0/4
cbs_h265_read_pred_weight_table:
✗ Branch 89 → 88 not taken.
✗ Branch 89 → 90 not taken.
cbs_h265_write_pred_weight_table:
✗ Branch 113 → 106 not taken.
✗ Branch 113 → 114 not taken.
✗ for (j = 0; j < 2; j++) {
1502
0/2
✗ Branch 106 → 107 not taken.
✗ Branch 106 → 109 not taken.
✗ infer(delta_chroma_weight_l1[i][j], 0);
1503
0/2
✗ Branch 109 → 110 not taken.
✗ Branch 109 → 112 not taken.
✗ infer(chroma_offset_l1[i][j], 0);
1504 }
1505 }
1506 }
1507 }
1508
1509 514 return 0;
1510 }
1511
1512 13588 static int FUNC(slice_segment_header)(CodedBitstreamContext *ctx, RWContext *rw,
1513 H265RawSliceHeader *current)
1514 {
1515 13588 CodedBitstreamH265Context *h265 = ctx->priv_data;
1516 const H265RawSPS *sps;
1517 const H265RawPPS *pps;
1518 unsigned int pic_width_in_ctbs_y, pic_height_in_ctbs_y, pic_size_in_ctbs_y;
1519 13588 unsigned int num_pic_total_curr = 0;
1520 int err, i;
1521
1522 13588 HEADER("Slice Segment Header");
1523
1524
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 7484 times.
cbs_h265_write_slice_segment_header:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 6104 times.
13588 CHECK(FUNC(nal_unit_header)(ctx, rw, &current->nal_unit_header, -1));
1525
1526
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 7484 times.
cbs_h265_write_slice_segment_header:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 6104 times.
13588 flag(first_slice_segment_in_pic_flag);
1527
1528
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 9 → 10 taken 147 times.
✓ Branch 9 → 15 taken 7337 times.
cbs_h265_write_slice_segment_header:
✓ Branch 9 → 10 taken 138 times.
✓ Branch 9 → 14 taken 5966 times.
13588 if (current->nal_unit_header.nal_unit_type >= HEVC_NAL_BLA_W_LP &&
1529
2/4
cbs_h265_read_slice_segment_header:
✓ Branch 10 → 11 taken 147 times.
✗ Branch 10 → 15 not taken.
cbs_h265_write_slice_segment_header:
✓ Branch 10 → 11 taken 138 times.
✗ Branch 10 → 14 not taken.
285 current->nal_unit_header.nal_unit_type <= HEVC_NAL_RSV_IRAP_VCL23)
1530
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 12 → 13 not taken.
✓ Branch 12 → 14 taken 147 times.
cbs_h265_write_slice_segment_header:
✗ Branch 12 → 13 not taken.
✓ Branch 12 → 14 taken 138 times.
285 flag(no_output_of_prior_pics_flag);
1531
1532
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 16 → 17 not taken.
✓ Branch 16 → 18 taken 7484 times.
cbs_h265_write_slice_segment_header:
✗ Branch 15 → 16 not taken.
✓ Branch 15 → 17 taken 6104 times.
13588 ue(slice_pic_parameter_set_id, 0, 63);
1533
1534 13588 pps = h265->pps[current->slice_pic_parameter_set_id];
1535
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 18 → 19 not taken.
✓ Branch 18 → 21 taken 7484 times.
cbs_h265_write_slice_segment_header:
✗ Branch 17 → 18 not taken.
✓ Branch 17 → 20 taken 6104 times.
13588 if (!pps) {
1536 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "PPS id %d not available.\n",
1537 ✗ current->slice_pic_parameter_set_id);
1538 ✗ return AVERROR_INVALIDDATA;
1539 }
1540 13588 h265->active_pps = pps;
1541
1542 13588 sps = h265->sps[pps->pps_seq_parameter_set_id];
1543
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 21 → 22 not taken.
✓ Branch 21 → 24 taken 7484 times.
cbs_h265_write_slice_segment_header:
✗ Branch 20 → 21 not taken.
✓ Branch 20 → 23 taken 6104 times.
13588 if (!sps) {
1544 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "SPS id %d not available.\n",
1545 ✗ pps->pps_seq_parameter_set_id);
1546 ✗ return AVERROR_INVALIDDATA;
1547 }
1548 13588 h265->active_sps = sps;
1549
1550 13588 cbs_h265_pic_size_in_ctbs(sps, &pic_width_in_ctbs_y, &pic_height_in_ctbs_y);
1551 13588 pic_size_in_ctbs_y = pic_width_in_ctbs_y * pic_height_in_ctbs_y;
1552
1553
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 25 → 26 taken 4864 times.
✓ Branch 25 → 36 taken 2620 times.
cbs_h265_write_slice_segment_header:
✓ Branch 24 → 25 taken 3872 times.
✓ Branch 24 → 36 taken 2232 times.
13588 if (!current->first_slice_segment_in_pic_flag) {
1554 8736 unsigned int address_size = av_log2(pic_size_in_ctbs_y - 1) + 1;
1555
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 26 → 27 taken 3173 times.
✓ Branch 26 → 31 taken 1691 times.
cbs_h265_write_slice_segment_header:
✓ Branch 25 → 26 taken 2181 times.
✓ Branch 25 → 29 taken 1691 times.
8736 if (pps->dependent_slice_segments_enabled_flag)
1556
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 28 → 29 not taken.
✓ Branch 28 → 30 taken 3173 times.
cbs_h265_write_slice_segment_header:
✗ Branch 27 → 28 not taken.
✓ Branch 27 → 32 taken 2181 times.
5354 flag(dependent_slice_segment_flag);
1557 else
1558
1/2
✗ Branch 29 → 30 not taken.
✓ Branch 29 → 32 taken 1691 times.
3382 infer(dependent_slice_segment_flag, 0);
1559
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 33 → 34 not taken.
✓ Branch 33 → 35 taken 4864 times.
cbs_h265_write_slice_segment_header:
✗ Branch 33 → 34 not taken.
✓ Branch 33 → 35 taken 3872 times.
8736 u(address_size, slice_segment_address, 0, pic_size_in_ctbs_y - 1);
1560 } else {
1561
1/2
✗ Branch 36 → 37 not taken.
✓ Branch 36 → 39 taken 2232 times.
4852 infer(dependent_slice_segment_flag, 0);
1562 }
1563
1564
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 37 → 38 taken 4944 times.
✓ Branch 37 → 280 taken 2540 times.
cbs_h265_write_slice_segment_header:
✓ Branch 39 → 40 taken 4134 times.
✓ Branch 39 → 340 taken 1970 times.
13588 if (!current->dependent_slice_segment_flag) {
1565
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 43 → 39 not taken.
✓ Branch 43 → 44 taken 4944 times.
cbs_h265_write_slice_segment_header:
✗ Branch 45 → 41 not taken.
✓ Branch 45 → 46 taken 4134 times.
9078 for (i = 0; i < pps->num_extra_slice_header_bits; i++)
1566
0/4
cbs_h265_read_slice_segment_header:
✗ Branch 40 → 41 not taken.
✗ Branch 40 → 42 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 42 → 43 not taken.
✗ Branch 42 → 44 not taken.
✗ flags(slice_reserved_flag[i], 1, i);
1567
1568
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 45 → 46 not taken.
✓ Branch 45 → 47 taken 4944 times.
cbs_h265_write_slice_segment_header:
✗ Branch 47 → 48 not taken.
✓ Branch 47 → 49 taken 4134 times.
9078 ue(slice_type, 0, 2);
1569
1570
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 47 → 48 not taken.
✓ Branch 47 → 52 taken 4944 times.
cbs_h265_write_slice_segment_header:
✗ Branch 49 → 50 not taken.
✓ Branch 49 → 53 taken 4134 times.
9078 if (pps->output_flag_present_flag)
1571
0/4
cbs_h265_read_slice_segment_header:
✗ Branch 49 → 50 not taken.
✗ Branch 49 → 51 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 51 → 52 not taken.
✗ Branch 51 → 53 not taken.
✗ flag(pic_output_flag);
1572
1573
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 52 → 53 not taken.
✓ Branch 52 → 57 taken 4944 times.
cbs_h265_write_slice_segment_header:
✗ Branch 53 → 54 not taken.
✓ Branch 53 → 58 taken 4134 times.
9078 if (sps->separate_colour_plane_flag)
1574
0/4
cbs_h265_read_slice_segment_header:
✗ Branch 54 → 55 not taken.
✗ Branch 54 → 56 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 55 → 56 not taken.
✗ Branch 55 → 57 not taken.
✗ u(2, colour_plane_id, 0, 2);
1575
1576
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 57 → 58 taken 4879 times.
✓ Branch 57 → 140 taken 65 times.
cbs_h265_write_slice_segment_header:
✓ Branch 58 → 59 taken 4073 times.
✓ Branch 58 → 150 taken 61 times.
9078 if (current->nal_unit_header.nal_unit_type != HEVC_NAL_IDR_W_RADL &&
1577
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 58 → 59 taken 4878 times.
✓ Branch 58 → 140 taken 1 time.
cbs_h265_write_slice_segment_header:
✓ Branch 59 → 60 taken 4072 times.
✓ Branch 59 → 150 taken 1 time.
8952 current->nal_unit_header.nal_unit_type != HEVC_NAL_IDR_N_LP) {
1578 const H265RawSTRefPicSet *rps;
1579 int dpb_slots_remaining;
1580
1581
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 60 → 61 not taken.
✓ Branch 60 → 62 taken 4878 times.
cbs_h265_write_slice_segment_header:
✗ Branch 61 → 62 not taken.
✓ Branch 61 → 63 taken 4072 times.
8950 ub(sps->log2_max_pic_order_cnt_lsb_minus4 + 4, slice_pic_order_cnt_lsb);
1582
1583
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 63 → 64 not taken.
✓ Branch 63 → 65 taken 4878 times.
cbs_h265_write_slice_segment_header:
✗ Branch 64 → 65 not taken.
✓ Branch 64 → 66 taken 4072 times.
8950 flag(short_term_ref_pic_set_sps_flag);
1584
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 65 → 66 taken 1923 times.
✓ Branch 65 → 70 taken 2955 times.
cbs_h265_write_slice_segment_header:
✓ Branch 66 → 67 taken 1874 times.
✓ Branch 66 → 71 taken 2198 times.
8950 if (!current->short_term_ref_pic_set_sps_flag) {
1585
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 67 → 68 not taken.
✓ Branch 67 → 69 taken 1923 times.
cbs_h265_write_slice_segment_header:
✗ Branch 68 → 69 not taken.
✓ Branch 68 → 70 taken 1874 times.
3797 CHECK(FUNC(st_ref_pic_set)(ctx, rw, &current->short_term_ref_pic_set,
1586 sps->num_short_term_ref_pic_sets, sps));
1587 3797 rps = &current->short_term_ref_pic_set;
1588
2/4
cbs_h265_read_slice_segment_header:
✓ Branch 70 → 71 taken 2955 times.
✗ Branch 70 → 75 not taken.
cbs_h265_write_slice_segment_header:
✓ Branch 71 → 72 taken 2198 times.
✗ Branch 71 → 76 not taken.
5153 } else if (sps->num_short_term_ref_pic_sets > 1) {
1589 5153 unsigned int idx_size = av_log2(sps->num_short_term_ref_pic_sets - 1) + 1;
1590
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 72 → 73 not taken.
✓ Branch 72 → 74 taken 2955 times.
cbs_h265_write_slice_segment_header:
✗ Branch 73 → 74 not taken.
✓ Branch 73 → 75 taken 2198 times.
5153 u(idx_size, short_term_ref_pic_set_idx,
1591 0, sps->num_short_term_ref_pic_sets - 1);
1592 5153 rps = &sps->st_ref_pic_set[current->short_term_ref_pic_set_idx];
1593 } else {
1594
0/2
✗ Branch 76 → 77 not taken.
✗ Branch 76 → 79 not taken.
✗ infer(short_term_ref_pic_set_idx, 0);
1595 ✗ rps = &sps->st_ref_pic_set[0];
1596 }
1597
1598 8950 dpb_slots_remaining = HEVC_MAX_DPB_SIZE - 1 -
1599 8950 rps->num_negative_pics - rps->num_positive_pics;
1600
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 76 → 77 not taken.
✓ Branch 76 → 84 taken 4878 times.
cbs_h265_write_slice_segment_header:
✗ Branch 80 → 81 not taken.
✓ Branch 80 → 88 taken 4072 times.
8950 if (pps->pps_curr_pic_ref_enabled_flag &&
1601
0/4
cbs_h265_read_slice_segment_header:
✗ Branch 77 → 78 not taken.
✗ Branch 77 → 80 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 81 → 82 not taken.
✗ Branch 81 → 84 not taken.
✗ (sps->sample_adaptive_offset_enabled_flag ||
1602
0/4
cbs_h265_read_slice_segment_header:
✗ Branch 78 → 79 not taken.
✗ Branch 78 → 80 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 82 → 83 not taken.
✗ Branch 82 → 84 not taken.
✗ !pps->pps_deblocking_filter_disabled_flag ||
1603
0/4
cbs_h265_read_slice_segment_header:
✗ Branch 79 → 80 not taken.
✗ Branch 79 → 84 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 83 → 84 not taken.
✗ Branch 83 → 88 not taken.
✗ pps->deblocking_filter_override_enabled_flag)) {
1604 // This picture will occupy two DPB slots.
1605
0/4
cbs_h265_read_slice_segment_header:
✗ Branch 80 → 81 not taken.
✗ Branch 80 → 83 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 84 → 85 not taken.
✗ Branch 84 → 87 not taken.
✗ if (dpb_slots_remaining == 0) {
1606 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid stream: "
1607 "short-term ref pic set contains too many pictures "
1608 "to use with current picture reference enabled.\n");
1609 ✗ return AVERROR_INVALIDDATA;
1610 }
1611 ✗ --dpb_slots_remaining;
1612 }
1613
1614 8950 num_pic_total_curr = 0;
1615
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 88 → 85 taken 12787 times.
✓ Branch 88 → 89 taken 4878 times.
cbs_h265_write_slice_segment_header:
✓ Branch 92 → 89 taken 11089 times.
✓ Branch 92 → 93 taken 4072 times.
32826 for (i = 0; i < rps->num_negative_pics; i++)
1616
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 85 → 86 taken 12239 times.
✓ Branch 85 → 87 taken 548 times.
cbs_h265_write_slice_segment_header:
✓ Branch 89 → 90 taken 10561 times.
✓ Branch 89 → 91 taken 528 times.
23876 if (rps->used_by_curr_pic_s0_flag[i])
1617 22800 ++num_pic_total_curr;
1618
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 93 → 90 taken 4144 times.
✓ Branch 93 → 94 taken 4878 times.
cbs_h265_write_slice_segment_header:
✓ Branch 97 → 94 taken 2808 times.
✓ Branch 97 → 98 taken 4072 times.
15902 for (i = 0; i < rps->num_positive_pics; i++)
1619
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 90 → 91 taken 3999 times.
✓ Branch 90 → 92 taken 145 times.
cbs_h265_write_slice_segment_header:
✓ Branch 94 → 95 taken 2663 times.
✓ Branch 94 → 96 taken 145 times.
6952 if (rps->used_by_curr_pic_s1_flag[i])
1620 6662 ++num_pic_total_curr;
1621
1622
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 94 → 95 taken 832 times.
✓ Branch 94 → 132 taken 4046 times.
cbs_h265_write_slice_segment_header:
✓ Branch 98 → 99 taken 832 times.
✓ Branch 98 → 141 taken 3240 times.
8950 if (sps->long_term_ref_pics_present_flag) {
1623 unsigned int idx_size;
1624
1625
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 95 → 96 taken 499 times.
✓ Branch 95 → 100 taken 333 times.
cbs_h265_write_slice_segment_header:
✓ Branch 99 → 100 taken 499 times.
✓ Branch 99 → 104 taken 333 times.
1664 if (sps->num_long_term_ref_pics_sps > 0) {
1626
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 97 → 98 not taken.
✓ Branch 97 → 99 taken 499 times.
cbs_h265_write_slice_segment_header:
✗ Branch 101 → 102 not taken.
✓ Branch 101 → 103 taken 499 times.
998 ue(num_long_term_sps, 0, FFMIN(sps->num_long_term_ref_pics_sps,
1627 dpb_slots_remaining));
1628 998 idx_size = av_log2(sps->num_long_term_ref_pics_sps - 1) + 1;
1629 998 dpb_slots_remaining -= current->num_long_term_sps;
1630 } else {
1631
1/2
✗ Branch 104 → 105 not taken.
✓ Branch 104 → 107 taken 333 times.
666 infer(num_long_term_sps, 0);
1632 666 idx_size = 0;
1633 }
1634
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 102 → 103 not taken.
✓ Branch 102 → 104 taken 832 times.
cbs_h265_write_slice_segment_header:
✗ Branch 109 → 110 not taken.
✓ Branch 109 → 111 taken 832 times.
1664 ue(num_long_term_pics, 0, dpb_slots_remaining);
1635
1636 1664 for (i = 0; i < current->num_long_term_sps +
1637
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 131 → 105 taken 1410 times.
✓ Branch 131 → 132 taken 832 times.
cbs_h265_write_slice_segment_header:
✓ Branch 140 → 112 taken 1410 times.
✓ Branch 140 → 141 taken 832 times.
4484 current->num_long_term_pics; i++) {
1638
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 105 → 106 taken 184 times.
✓ Branch 105 → 113 taken 1226 times.
cbs_h265_write_slice_segment_header:
✓ Branch 112 → 113 taken 184 times.
✓ Branch 112 → 120 taken 1226 times.
2820 if (i < current->num_long_term_sps) {
1639
2/4
cbs_h265_read_slice_segment_header:
✓ Branch 106 → 107 taken 184 times.
✗ Branch 106 → 111 not taken.
cbs_h265_write_slice_segment_header:
✓ Branch 113 → 114 taken 184 times.
✗ Branch 113 → 118 not taken.
368 if (sps->num_long_term_ref_pics_sps > 1)
1640
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 108 → 109 not taken.
✓ Branch 108 → 110 taken 184 times.
cbs_h265_write_slice_segment_header:
✗ Branch 115 → 116 not taken.
✓ Branch 115 → 117 taken 184 times.
368 us(idx_size, lt_idx_sps[i],
1641 0, sps->num_long_term_ref_pics_sps - 1, 1, i);
1642
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 111 → 112 taken 88 times.
✓ Branch 111 → 121 taken 96 times.
cbs_h265_write_slice_segment_header:
✓ Branch 118 → 119 taken 88 times.
✓ Branch 118 → 128 taken 96 times.
368 if (sps->used_by_curr_pic_lt_sps_flag[current->lt_idx_sps[i]])
1643 176 ++num_pic_total_curr;
1644 } else {
1645
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 114 → 115 not taken.
✓ Branch 114 → 116 taken 1226 times.
cbs_h265_write_slice_segment_header:
✗ Branch 121 → 122 not taken.
✓ Branch 121 → 123 taken 1226 times.
2452 ubs(sps->log2_max_pic_order_cnt_lsb_minus4 + 4, poc_lsb_lt[i], 1, i);
1646
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 117 → 118 not taken.
✓ Branch 117 → 119 taken 1226 times.
cbs_h265_write_slice_segment_header:
✗ Branch 124 → 125 not taken.
✓ Branch 124 → 126 taken 1226 times.
2452 flags(used_by_curr_pic_lt_flag[i], 1, i);
1647
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 119 → 120 taken 378 times.
✓ Branch 119 → 121 taken 848 times.
cbs_h265_write_slice_segment_header:
✓ Branch 126 → 127 taken 378 times.
✓ Branch 126 → 128 taken 848 times.
2452 if (current->used_by_curr_pic_lt_flag[i])
1648 756 ++num_pic_total_curr;
1649 }
1650
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 122 → 123 not taken.
✓ Branch 122 → 124 taken 1410 times.
cbs_h265_write_slice_segment_header:
✗ Branch 129 → 130 not taken.
✓ Branch 129 → 131 taken 1410 times.
2820 flags(delta_poc_msb_present_flag[i], 1, i);
1651
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 124 → 125 not taken.
✓ Branch 124 → 129 taken 1410 times.
cbs_h265_write_slice_segment_header:
✗ Branch 131 → 132 not taken.
✓ Branch 131 → 136 taken 1410 times.
2820 if (current->delta_poc_msb_present_flag[i])
1652
0/4
cbs_h265_read_slice_segment_header:
✗ Branch 126 → 127 not taken.
✗ Branch 126 → 128 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 133 → 134 not taken.
✗ Branch 133 → 135 not taken.
✗ ues(delta_poc_msb_cycle_lt[i], 0, UINT32_MAX - 1, 1, i);
1653 else
1654
1/2
✗ Branch 136 → 137 not taken.
✓ Branch 136 → 139 taken 1410 times.
2820 infer(delta_poc_msb_cycle_lt[i], 0);
1655 }
1656 }
1657
1658
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 132 → 133 taken 3555 times.
✓ Branch 132 → 137 taken 1323 times.
cbs_h265_write_slice_segment_header:
✓ Branch 141 → 142 taken 2749 times.
✓ Branch 141 → 145 taken 1323 times.
8950 if (sps->sps_temporal_mvp_enabled_flag)
1659
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 134 → 135 not taken.
✓ Branch 134 → 136 taken 3555 times.
cbs_h265_write_slice_segment_header:
✗ Branch 143 → 144 not taken.
✓ Branch 143 → 148 taken 2749 times.
6304 flag(slice_temporal_mvp_enabled_flag);
1660 else
1661
1/2
✗ Branch 145 → 146 not taken.
✓ Branch 145 → 148 taken 1323 times.
2646 infer(slice_temporal_mvp_enabled_flag, 0);
1662
1663
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 138 → 139 not taken.
✓ Branch 138 → 140 taken 4878 times.
cbs_h265_write_slice_segment_header:
✗ Branch 148 → 149 not taken.
✓ Branch 148 → 150 taken 4072 times.
8950 if (pps->pps_curr_pic_ref_enabled_flag)
1664 ✗ ++num_pic_total_curr;
1665 }
1666
1667
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 140 → 141 taken 3180 times.
✓ Branch 140 → 152 taken 1764 times.
cbs_h265_write_slice_segment_header:
✓ Branch 150 → 151 taken 2500 times.
✓ Branch 150 → 164 taken 1634 times.
9078 if (sps->sample_adaptive_offset_enabled_flag) {
1668
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 142 → 143 not taken.
✓ Branch 142 → 144 taken 3180 times.
cbs_h265_write_slice_segment_header:
✗ Branch 152 → 153 not taken.
✓ Branch 152 → 154 taken 2500 times.
5680 flag(slice_sao_luma_flag);
1669
4/8
cbs_h265_read_slice_segment_header:
✓ Branch 144 → 145 taken 3180 times.
✗ Branch 144 → 150 not taken.
✓ Branch 145 → 146 taken 3180 times.
✗ Branch 145 → 150 not taken.
cbs_h265_write_slice_segment_header:
✓ Branch 154 → 155 taken 2500 times.
✗ Branch 154 → 160 not taken.
✓ Branch 155 → 156 taken 2500 times.
✗ Branch 155 → 160 not taken.
5680 if (!sps->separate_colour_plane_flag && sps->chroma_format_idc != 0)
1670
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 147 → 148 not taken.
✓ Branch 147 → 149 taken 3180 times.
cbs_h265_write_slice_segment_header:
✗ Branch 157 → 158 not taken.
✓ Branch 157 → 159 taken 2500 times.
5680 flag(slice_sao_chroma_flag);
1671 else
1672
0/2
✗ Branch 160 → 161 not taken.
✗ Branch 160 → 163 not taken.
✗ infer(slice_sao_chroma_flag, 0);
1673 } else {
1674
1/2
✗ Branch 164 → 165 not taken.
✓ Branch 164 → 167 taken 1634 times.
3398 infer(slice_sao_luma_flag, 0);
1675
1/2
✗ Branch 167 → 168 not taken.
✓ Branch 167 → 170 taken 1634 times.
3398 infer(slice_sao_chroma_flag, 0);
1676 }
1677
1678
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 153 → 154 taken 3258 times.
✓ Branch 153 → 155 taken 1686 times.
cbs_h265_write_slice_segment_header:
✓ Branch 170 → 171 taken 2448 times.
✓ Branch 170 → 172 taken 1686 times.
9078 if (current->slice_type == HEVC_SLICE_P ||
1679
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 154 → 155 taken 3137 times.
✓ Branch 154 → 221 taken 121 times.
cbs_h265_write_slice_segment_header:
✓ Branch 171 → 172 taken 2336 times.
✓ Branch 171 → 251 taken 112 times.
5706 current->slice_type == HEVC_SLICE_B) {
1680
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 156 → 157 not taken.
✓ Branch 156 → 158 taken 4823 times.
cbs_h265_write_slice_segment_header:
✗ Branch 173 → 174 not taken.
✓ Branch 173 → 175 taken 4022 times.
8845 flag(num_ref_idx_active_override_flag);
1681
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 158 → 159 taken 1875 times.
✓ Branch 158 → 168 taken 2948 times.
cbs_h265_write_slice_segment_header:
✓ Branch 175 → 176 taken 1838 times.
✓ Branch 175 → 187 taken 2184 times.
8845 if (current->num_ref_idx_active_override_flag) {
1682
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 160 → 161 not taken.
✓ Branch 160 → 162 taken 1875 times.
cbs_h265_write_slice_segment_header:
✗ Branch 177 → 178 not taken.
✓ Branch 177 → 179 taken 1838 times.
3713 ue(num_ref_idx_l0_active_minus1, 0, 14);
1683
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 162 → 163 taken 505 times.
✓ Branch 162 → 167 taken 1370 times.
cbs_h265_write_slice_segment_header:
✓ Branch 179 → 180 taken 468 times.
✓ Branch 179 → 184 taken 1370 times.
3713 if (current->slice_type == HEVC_SLICE_B)
1684
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 164 → 165 not taken.
✓ Branch 164 → 166 taken 505 times.
cbs_h265_write_slice_segment_header:
✗ Branch 181 → 182 not taken.
✓ Branch 181 → 183 taken 468 times.
973 ue(num_ref_idx_l1_active_minus1, 0, 14);
1685 else
1686
1/2
✗ Branch 184 → 185 not taken.
✓ Branch 184 → 193 taken 1370 times.
2740 infer(num_ref_idx_l1_active_minus1, pps->num_ref_idx_l1_default_active_minus1);
1687 } else {
1688
1/2
✗ Branch 187 → 188 not taken.
✓ Branch 187 → 190 taken 2184 times.
5132 infer(num_ref_idx_l0_active_minus1, pps->num_ref_idx_l0_default_active_minus1);
1689
1/2
✗ Branch 190 → 191 not taken.
✓ Branch 190 → 193 taken 2184 times.
5132 infer(num_ref_idx_l1_active_minus1, pps->num_ref_idx_l1_default_active_minus1);
1690 }
1691
1692
8/8
cbs_h265_read_slice_segment_header:
✓ Branch 169 → 170 taken 774 times.
✓ Branch 169 → 174 taken 4049 times.
✓ Branch 170 → 171 taken 748 times.
✓ Branch 170 → 174 taken 26 times.
cbs_h265_write_slice_segment_header:
✓ Branch 193 → 194 taken 774 times.
✓ Branch 193 → 198 taken 3248 times.
✓ Branch 194 → 195 taken 748 times.
✓ Branch 194 → 198 taken 26 times.
8845 if (pps->lists_modification_present_flag && num_pic_total_curr > 1)
1693
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 172 → 173 not taken.
✓ Branch 172 → 174 taken 748 times.
cbs_h265_write_slice_segment_header:
✗ Branch 196 → 197 not taken.
✓ Branch 196 → 198 taken 748 times.
1496 CHECK(FUNC(ref_pic_lists_modification)(ctx, rw, current,
1694 num_pic_total_curr));
1695
1696
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 174 → 175 taken 3137 times.
✓ Branch 174 → 179 taken 1686 times.
cbs_h265_write_slice_segment_header:
✓ Branch 198 → 199 taken 2336 times.
✓ Branch 198 → 202 taken 1686 times.
8845 if (current->slice_type == HEVC_SLICE_B)
1697
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 176 → 177 not taken.
✓ Branch 176 → 178 taken 3137 times.
cbs_h265_write_slice_segment_header:
✗ Branch 200 → 201 not taken.
✓ Branch 200 → 202 taken 2336 times.
5473 flag(mvd_l1_zero_flag);
1698
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 179 → 180 taken 3413 times.
✓ Branch 179 → 184 taken 1410 times.
cbs_h265_write_slice_segment_header:
✓ Branch 202 → 203 taken 2612 times.
✓ Branch 202 → 206 taken 1410 times.
8845 if (pps->cabac_init_present_flag)
1699
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 181 → 182 not taken.
✓ Branch 181 → 183 taken 3413 times.
cbs_h265_write_slice_segment_header:
✗ Branch 204 → 205 not taken.
✓ Branch 204 → 209 taken 2612 times.
6025 flag(cabac_init_flag);
1700 else
1701
1/2
✗ Branch 206 → 207 not taken.
✓ Branch 206 → 209 taken 1410 times.
2820 infer(cabac_init_flag, 0);
1702
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 185 → 186 taken 3505 times.
✓ Branch 185 → 205 taken 1318 times.
cbs_h265_write_slice_segment_header:
✓ Branch 209 → 210 taken 2704 times.
✓ Branch 209 → 234 taken 1318 times.
8845 if (current->slice_temporal_mvp_enabled_flag) {
1703
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 186 → 187 taken 3137 times.
✓ Branch 186 → 191 taken 368 times.
cbs_h265_write_slice_segment_header:
✓ Branch 210 → 211 taken 2336 times.
✓ Branch 210 → 214 taken 368 times.
6209 if (current->slice_type == HEVC_SLICE_B)
1704
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 188 → 189 not taken.
✓ Branch 188 → 190 taken 3137 times.
cbs_h265_write_slice_segment_header:
✗ Branch 212 → 213 not taken.
✓ Branch 212 → 217 taken 2336 times.
5473 flag(collocated_from_l0_flag);
1705 else
1706
1/2
✗ Branch 214 → 215 not taken.
✓ Branch 214 → 217 taken 368 times.
736 infer(collocated_from_l0_flag, 1);
1707
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 192 → 193 taken 1642 times.
✓ Branch 192 → 199 taken 1863 times.
cbs_h265_write_slice_segment_header:
✓ Branch 217 → 218 taken 1223 times.
✓ Branch 217 → 226 taken 1481 times.
6209 if (current->collocated_from_l0_flag) {
1708
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 193 → 194 taken 1522 times.
✓ Branch 193 → 198 taken 120 times.
cbs_h265_write_slice_segment_header:
✓ Branch 218 → 219 taken 1103 times.
✓ Branch 218 → 223 taken 120 times.
2865 if (current->num_ref_idx_l0_active_minus1 > 0)
1709
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 195 → 196 not taken.
✓ Branch 195 → 197 taken 1522 times.
cbs_h265_write_slice_segment_header:
✗ Branch 220 → 221 not taken.
✓ Branch 220 → 222 taken 1103 times.
2625 ue(collocated_ref_idx, 0, current->num_ref_idx_l0_active_minus1);
1710 else
1711
1/2
✗ Branch 223 → 224 not taken.
✓ Branch 223 → 234 taken 120 times.
240 infer(collocated_ref_idx, 0);
1712 } else {
1713
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 199 → 200 taken 1756 times.
✓ Branch 199 → 204 taken 107 times.
cbs_h265_write_slice_segment_header:
✓ Branch 226 → 227 taken 1386 times.
✓ Branch 226 → 231 taken 95 times.
3344 if (current->num_ref_idx_l1_active_minus1 > 0)
1714
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 201 → 202 not taken.
✓ Branch 201 → 203 taken 1756 times.
cbs_h265_write_slice_segment_header:
✗ Branch 228 → 229 not taken.
✓ Branch 228 → 230 taken 1386 times.
3142 ue(collocated_ref_idx, 0, current->num_ref_idx_l1_active_minus1);
1715 else
1716
1/2
✗ Branch 231 → 232 not taken.
✓ Branch 231 → 234 taken 95 times.
202 infer(collocated_ref_idx, 0);
1717 }
1718 }
1719
1720
6/8
cbs_h265_read_slice_segment_header:
✓ Branch 205 → 206 taken 257 times.
✓ Branch 205 → 207 taken 4566 times.
✗ Branch 206 → 207 not taken.
✓ Branch 206 → 209 taken 257 times.
cbs_h265_write_slice_segment_header:
✓ Branch 234 → 235 taken 257 times.
✓ Branch 234 → 236 taken 3765 times.
✗ Branch 235 → 236 not taken.
✓ Branch 235 → 238 taken 257 times.
8845 if ((pps->weighted_pred_flag && current->slice_type == HEVC_SLICE_P) ||
1721
2/8
cbs_h265_read_slice_segment_header:
✗ Branch 207 → 208 not taken.
✓ Branch 207 → 212 taken 4566 times.
✗ Branch 208 → 209 not taken.
✗ Branch 208 → 212 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 236 → 237 not taken.
✓ Branch 236 → 241 taken 3765 times.
✗ Branch 237 → 238 not taken.
✗ Branch 237 → 241 not taken.
8331 (pps->weighted_bipred_flag && current->slice_type == HEVC_SLICE_B))
1722
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 210 → 211 not taken.
✓ Branch 210 → 212 taken 257 times.
cbs_h265_write_slice_segment_header:
✗ Branch 239 → 240 not taken.
✓ Branch 239 → 241 taken 257 times.
514 CHECK(FUNC(pred_weight_table)(ctx, rw, current));
1723
1724
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 213 → 214 not taken.
✓ Branch 213 → 215 taken 4823 times.
cbs_h265_write_slice_segment_header:
✗ Branch 242 → 243 not taken.
✓ Branch 242 → 244 taken 4022 times.
8845 ue(five_minus_max_num_merge_cand, 0, 4);
1725
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 215 → 216 not taken.
✓ Branch 215 → 220 taken 4823 times.
cbs_h265_write_slice_segment_header:
✗ Branch 244 → 245 not taken.
✓ Branch 244 → 248 taken 4022 times.
8845 if (sps->motion_vector_resolution_control_idc == 2)
1726
0/4
cbs_h265_read_slice_segment_header:
✗ Branch 217 → 218 not taken.
✗ Branch 217 → 219 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 246 → 247 not taken.
✗ Branch 246 → 251 not taken.
✗ flag(use_integer_mv_flag);
1727 else
1728
1/2
✗ Branch 248 → 249 not taken.
✓ Branch 248 → 251 taken 4022 times.
8845 infer(use_integer_mv_flag, sps->motion_vector_resolution_control_idc);
1729 }
1730
1731
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 222 → 223 not taken.
✓ Branch 222 → 224 taken 4944 times.
cbs_h265_write_slice_segment_header:
✗ Branch 252 → 253 not taken.
✓ Branch 252 → 254 taken 4134 times.
9078 se(slice_qp_delta,
1732 - 6 * sps->bit_depth_luma_minus8 - (pps->init_qp_minus26 + 26),
1733 + 51 - (pps->init_qp_minus26 + 26));
1734
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 224 → 225 not taken.
✓ Branch 224 → 232 taken 4944 times.
cbs_h265_write_slice_segment_header:
✗ Branch 254 → 255 not taken.
✓ Branch 254 → 262 taken 4134 times.
9078 if (pps->pps_slice_chroma_qp_offsets_present_flag) {
1735
0/4
cbs_h265_read_slice_segment_header:
✗ Branch 226 → 227 not taken.
✗ Branch 226 → 228 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 256 → 257 not taken.
✗ Branch 256 → 258 not taken.
✗ se(slice_cb_qp_offset, -12, +12);
1736
0/4
cbs_h265_read_slice_segment_header:
✗ Branch 229 → 230 not taken.
✗ Branch 229 → 231 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 259 → 260 not taken.
✗ Branch 259 → 261 not taken.
✗ se(slice_cr_qp_offset, -12, +12);
1737 } else {
1738
1/2
✗ Branch 262 → 263 not taken.
✓ Branch 262 → 265 taken 4134 times.
9078 infer(slice_cb_qp_offset, 0);
1739
1/2
✗ Branch 265 → 266 not taken.
✓ Branch 265 → 268 taken 4134 times.
9078 infer(slice_cr_qp_offset, 0);
1740 }
1741
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 233 → 234 not taken.
✓ Branch 233 → 244 taken 4944 times.
cbs_h265_write_slice_segment_header:
✗ Branch 268 → 269 not taken.
✓ Branch 268 → 279 taken 4134 times.
9078 if (pps->pps_slice_act_qp_offsets_present_flag) {
1742
0/4
cbs_h265_read_slice_segment_header:
✗ Branch 235 → 236 not taken.
✗ Branch 235 → 237 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 270 → 271 not taken.
✗ Branch 270 → 272 not taken.
✗ se(slice_act_y_qp_offset,
1743 -12 - (pps->pps_act_y_qp_offset_plus5 - 5),
1744 +12 - (pps->pps_act_y_qp_offset_plus5 - 5));
1745
0/4
cbs_h265_read_slice_segment_header:
✗ Branch 238 → 239 not taken.
✗ Branch 238 → 240 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 273 → 274 not taken.
✗ Branch 273 → 275 not taken.
✗ se(slice_act_cb_qp_offset,
1746 -12 - (pps->pps_act_cb_qp_offset_plus5 - 5),
1747 +12 - (pps->pps_act_cb_qp_offset_plus5 - 5));
1748
0/4
cbs_h265_read_slice_segment_header:
✗ Branch 241 → 242 not taken.
✗ Branch 241 → 243 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 276 → 277 not taken.
✗ Branch 276 → 278 not taken.
✗ se(slice_act_cr_qp_offset,
1749 -12 - (pps->pps_act_cr_qp_offset_plus3 - 3),
1750 +12 - (pps->pps_act_cr_qp_offset_plus3 - 3));
1751 } else {
1752
1/2
✗ Branch 279 → 280 not taken.
✓ Branch 279 → 282 taken 4134 times.
9078 infer(slice_act_y_qp_offset, 0);
1753
1/2
✗ Branch 282 → 283 not taken.
✓ Branch 282 → 285 taken 4134 times.
9078 infer(slice_act_cb_qp_offset, 0);
1754
1/2
✗ Branch 285 → 286 not taken.
✓ Branch 285 → 288 taken 4134 times.
9078 infer(slice_act_cr_qp_offset, 0);
1755 }
1756
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 245 → 246 not taken.
✓ Branch 245 → 250 taken 4944 times.
cbs_h265_write_slice_segment_header:
✗ Branch 288 → 289 not taken.
✓ Branch 288 → 292 taken 4134 times.
9078 if (pps->chroma_qp_offset_list_enabled_flag)
1757
0/4
cbs_h265_read_slice_segment_header:
✗ Branch 247 → 248 not taken.
✗ Branch 247 → 249 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 290 → 291 not taken.
✗ Branch 290 → 295 not taken.
✗ flag(cu_chroma_qp_offset_enabled_flag);
1758 else
1759
1/2
✗ Branch 292 → 293 not taken.
✓ Branch 292 → 295 taken 4134 times.
9078 infer(cu_chroma_qp_offset_enabled_flag, 0);
1760
1761
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 251 → 252 taken 37 times.
✓ Branch 251 → 256 taken 4907 times.
cbs_h265_write_slice_segment_header:
✓ Branch 295 → 296 taken 37 times.
✓ Branch 295 → 299 taken 4097 times.
9078 if (pps->deblocking_filter_override_enabled_flag)
1762
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 253 → 254 not taken.
✓ Branch 253 → 255 taken 37 times.
cbs_h265_write_slice_segment_header:
✗ Branch 297 → 298 not taken.
✓ Branch 297 → 302 taken 37 times.
74 flag(deblocking_filter_override_flag);
1763 else
1764
1/2
✗ Branch 299 → 300 not taken.
✓ Branch 299 → 302 taken 4097 times.
9004 infer(deblocking_filter_override_flag, 0);
1765
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 257 → 258 taken 1 time.
✓ Branch 257 → 270 taken 4943 times.
cbs_h265_write_slice_segment_header:
✓ Branch 302 → 303 taken 1 time.
✓ Branch 302 → 320 taken 4133 times.
9078 if (current->deblocking_filter_override_flag) {
1766
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 259 → 260 not taken.
✓ Branch 259 → 261 taken 1 time.
cbs_h265_write_slice_segment_header:
✗ Branch 304 → 305 not taken.
✓ Branch 304 → 306 taken 1 time.
2 flag(slice_deblocking_filter_disabled_flag);
1767
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 261 → 262 not taken.
✓ Branch 261 → 269 taken 1 time.
cbs_h265_write_slice_segment_header:
✗ Branch 306 → 307 not taken.
✓ Branch 306 → 314 taken 1 time.
2 if (!current->slice_deblocking_filter_disabled_flag) {
1768
0/4
cbs_h265_read_slice_segment_header:
✗ Branch 263 → 264 not taken.
✗ Branch 263 → 265 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 308 → 309 not taken.
✗ Branch 308 → 310 not taken.
✗ se(slice_beta_offset_div2, -6, +6);
1769
0/4
cbs_h265_read_slice_segment_header:
✗ Branch 266 → 267 not taken.
✗ Branch 266 → 268 not taken.
cbs_h265_write_slice_segment_header:
✗ Branch 311 → 312 not taken.
✗ Branch 311 → 313 not taken.
✗ se(slice_tc_offset_div2, -6, +6);
1770 } else {
1771
1/2
✗ Branch 314 → 315 not taken.
✓ Branch 314 → 317 taken 1 time.
2 infer(slice_beta_offset_div2, pps->pps_beta_offset_div2);
1772
1/2
✗ Branch 317 → 318 not taken.
✓ Branch 317 → 329 taken 1 time.
2 infer(slice_tc_offset_div2, pps->pps_tc_offset_div2);
1773 }
1774 } else {
1775
1/2
✗ Branch 320 → 321 not taken.
✓ Branch 320 → 323 taken 4133 times.
9076 infer(slice_deblocking_filter_disabled_flag,
1776 pps->pps_deblocking_filter_disabled_flag);
1777
1/2
✗ Branch 323 → 324 not taken.
✓ Branch 323 → 326 taken 4133 times.
9076 infer(slice_beta_offset_div2, pps->pps_beta_offset_div2);
1778
1/2
✗ Branch 326 → 327 not taken.
✓ Branch 326 → 329 taken 4133 times.
9076 infer(slice_tc_offset_div2, pps->pps_tc_offset_div2);
1779 }
1780
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 271 → 272 taken 4199 times.
✓ Branch 271 → 279 taken 745 times.
cbs_h265_write_slice_segment_header:
✓ Branch 329 → 330 taken 3389 times.
✓ Branch 329 → 337 taken 745 times.
9078 if (pps->pps_loop_filter_across_slices_enabled_flag &&
1781
6/8
cbs_h265_read_slice_segment_header:
✓ Branch 272 → 273 taken 3060 times.
✓ Branch 272 → 275 taken 1139 times.
✓ Branch 273 → 274 taken 3060 times.
✗ Branch 273 → 275 not taken.
cbs_h265_write_slice_segment_header:
✓ Branch 330 → 331 taken 2330 times.
✓ Branch 330 → 333 taken 1059 times.
✓ Branch 331 → 332 taken 2330 times.
✗ Branch 331 → 333 not taken.
7588 (current->slice_sao_luma_flag || current->slice_sao_chroma_flag ||
1782
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 274 → 275 taken 3059 times.
✓ Branch 274 → 279 taken 1 time.
cbs_h265_write_slice_segment_header:
✓ Branch 332 → 333 taken 2329 times.
✓ Branch 332 → 337 taken 1 time.
5390 !current->slice_deblocking_filter_disabled_flag))
1783
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 276 → 277 not taken.
✓ Branch 276 → 278 taken 4198 times.
cbs_h265_write_slice_segment_header:
✗ Branch 334 → 335 not taken.
✓ Branch 334 → 336 taken 3388 times.
7586 flag(slice_loop_filter_across_slices_enabled_flag);
1784 else
1785
1/2
✗ Branch 337 → 338 not taken.
✓ Branch 337 → 340 taken 746 times.
1492 infer(slice_loop_filter_across_slices_enabled_flag,
1786 pps->pps_loop_filter_across_slices_enabled_flag);
1787 }
1788
1789
8/8
cbs_h265_read_slice_segment_header:
✓ Branch 280 → 281 taken 6116 times.
✓ Branch 280 → 282 taken 1368 times.
✓ Branch 281 → 282 taken 1761 times.
✓ Branch 281 → 305 taken 4355 times.
cbs_h265_write_slice_segment_header:
✓ Branch 340 → 341 taken 4736 times.
✓ Branch 340 → 342 taken 1368 times.
✓ Branch 341 → 342 taken 604 times.
✓ Branch 341 → 365 taken 4132 times.
13588 if (pps->tiles_enabled_flag || pps->entropy_coding_sync_enabled_flag) {
1790 unsigned int num_entry_point_offsets_limit;
1791
6/8
cbs_h265_read_slice_segment_header:
✓ Branch 282 → 283 taken 1761 times.
✓ Branch 282 → 285 taken 1368 times.
✓ Branch 283 → 284 taken 1761 times.
✗ Branch 283 → 285 not taken.
cbs_h265_write_slice_segment_header:
✓ Branch 342 → 343 taken 604 times.
✓ Branch 342 → 345 taken 1368 times.
✓ Branch 343 → 344 taken 604 times.
✗ Branch 343 → 345 not taken.
5101 if (!pps->tiles_enabled_flag && pps->entropy_coding_sync_enabled_flag)
1792 2365 num_entry_point_offsets_limit = pic_height_in_ctbs_y - 1;
1793
4/8
cbs_h265_read_slice_segment_header:
✓ Branch 285 → 286 taken 1368 times.
✗ Branch 285 → 288 not taken.
✓ Branch 286 → 287 taken 1368 times.
✗ Branch 286 → 288 not taken.
cbs_h265_write_slice_segment_header:
✓ Branch 345 → 346 taken 1368 times.
✗ Branch 345 → 348 not taken.
✓ Branch 346 → 347 taken 1368 times.
✗ Branch 346 → 348 not taken.
2736 else if (pps->tiles_enabled_flag && !pps->entropy_coding_sync_enabled_flag)
1794 2736 num_entry_point_offsets_limit =
1795 2736 (pps->num_tile_columns_minus1 + 1) * (pps->num_tile_rows_minus1 + 1);
1796 else
1797 ✗ num_entry_point_offsets_limit =
1798 ✗ (pps->num_tile_columns_minus1 + 1) * pic_height_in_ctbs_y - 1;
1799
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 290 → 291 not taken.
✓ Branch 290 → 292 taken 3129 times.
cbs_h265_write_slice_segment_header:
✗ Branch 350 → 351 not taken.
✓ Branch 350 → 352 taken 1972 times.
5101 ue(num_entry_point_offsets, 0, num_entry_point_offsets_limit);
1800
1801
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 292 → 293 not taken.
✓ Branch 292 → 295 taken 3129 times.
cbs_h265_write_slice_segment_header:
✗ Branch 352 → 353 not taken.
✓ Branch 352 → 355 taken 1972 times.
5101 if (current->num_entry_point_offsets > HEVC_MAX_ENTRY_POINT_OFFSETS) {
1802 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "Too many entry points: "
1803 ✗ "%"PRIu16".\n", current->num_entry_point_offsets);
1804 ✗ return AVERROR_PATCHWELCOME;
1805 }
1806
1807
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 295 → 296 taken 913 times.
✓ Branch 295 → 305 taken 2216 times.
cbs_h265_write_slice_segment_header:
✓ Branch 355 → 356 taken 790 times.
✓ Branch 355 → 365 taken 1182 times.
5101 if (current->num_entry_point_offsets > 0) {
1808
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 297 → 298 not taken.
✓ Branch 297 → 299 taken 913 times.
cbs_h265_write_slice_segment_header:
✗ Branch 357 → 358 not taken.
✓ Branch 357 → 359 taken 790 times.
1703 ue(offset_len_minus1, 0, 31);
1809
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 304 → 300 taken 1876 times.
✓ Branch 304 → 305 taken 913 times.
cbs_h265_write_slice_segment_header:
✓ Branch 364 → 360 taken 1605 times.
✓ Branch 364 → 365 taken 790 times.
5184 for (i = 0; i < current->num_entry_point_offsets; i++)
1810
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 301 → 302 not taken.
✓ Branch 301 → 303 taken 1876 times.
cbs_h265_write_slice_segment_header:
✗ Branch 361 → 362 not taken.
✓ Branch 361 → 363 taken 1605 times.
3481 ubs(current->offset_len_minus1 + 1, entry_point_offset_minus1[i], 1, i);
1811 }
1812 }
1813
1814
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 305 → 306 taken 1761 times.
✓ Branch 305 → 315 taken 5723 times.
cbs_h265_write_slice_segment_header:
✓ Branch 365 → 366 taken 604 times.
✓ Branch 365 → 375 taken 5500 times.
13588 if (pps->slice_segment_header_extension_present_flag) {
1815
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 307 → 308 not taken.
✓ Branch 307 → 309 taken 1761 times.
cbs_h265_write_slice_segment_header:
✗ Branch 367 → 368 not taken.
✓ Branch 367 → 369 taken 604 times.
2365 ue(slice_segment_header_extension_length, 0, 256);
1816
4/4
cbs_h265_read_slice_segment_header:
✓ Branch 314 → 310 taken 12506 times.
✓ Branch 314 → 315 taken 1761 times.
cbs_h265_write_slice_segment_header:
✓ Branch 374 → 370 taken 4329 times.
✓ Branch 374 → 375 taken 604 times.
19200 for (i = 0; i < current->slice_segment_header_extension_length; i++)
1817
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 311 → 312 not taken.
✓ Branch 311 → 313 taken 12506 times.
cbs_h265_write_slice_segment_header:
✗ Branch 371 → 372 not taken.
✓ Branch 371 → 373 taken 4329 times.
16835 us(8, slice_segment_header_extension_data_byte[i], 0x00, 0xff, 1, i);
1818 }
1819
1820
2/4
cbs_h265_read_slice_segment_header:
✗ Branch 316 → 317 not taken.
✓ Branch 316 → 318 taken 7484 times.
cbs_h265_write_slice_segment_header:
✗ Branch 376 → 377 not taken.
✓ Branch 376 → 378 taken 6104 times.
13588 CHECK(FUNC(byte_alignment)(ctx, rw));
1821
1822 13588 return 0;
1823 }
1824
1825 30 SEI_FUNC(sei_buffering_period, (CodedBitstreamContext *ctx, RWContext *rw,
1826 H265RawSEIBufferingPeriod *current,
1827 SEIMessageState *sei))
1828 {
1829 15 CodedBitstreamH265Context *h265 = ctx->priv_data;
1830 const H265RawSPS *sps;
1831 const H265RawHRDParameters *hrd;
1832 int err, i, length;
1833
1834 #ifdef READ
1835 int start_pos, end_pos;
1836 5 start_pos = get_bits_count(rw);
1837 #endif
1838
1839 15 HEADER("Buffering Period");
1840
1841
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 5 → 6 not taken.
✓ Branch 5 → 7 taken 5 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 10 times.
15 ue(bp_seq_parameter_set_id, 0, HEVC_MAX_SPS_COUNT - 1);
1842
1843 15 sps = h265->sps[current->bp_seq_parameter_set_id];
1844
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 10 taken 5 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 6 → 7 not taken.
✓ Branch 6 → 9 taken 10 times.
15 if (!sps) {
1845 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "SPS id %d not available.\n",
1846 ✗ current->bp_seq_parameter_set_id);
1847 ✗ return AVERROR_INVALIDDATA;
1848 }
1849 15 h265->active_sps = sps;
1850
1851
2/4
cbs_h265_read_sei_buffering_period:
✓ Branch 10 → 11 taken 5 times.
✗ Branch 10 → 12 not taken.
cbs_h265_write_sei_buffering_period:
✓ Branch 9 → 10 taken 10 times.
✗ Branch 9 → 11 not taken.
15 if (!sps->vui_parameters_present_flag ||
1852
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 11 → 12 not taken.
✓ Branch 11 → 14 taken 5 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 10 → 11 not taken.
✓ Branch 10 → 13 taken 10 times.
15 !sps->vui.vui_hrd_parameters_present_flag) {
1853 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "Buffering period SEI requires "
1854 "HRD parameters to be present in SPS.\n");
1855 ✗ return AVERROR_INVALIDDATA;
1856 }
1857 15 hrd = &sps->vui.hrd_parameters;
1858
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 14 → 15 not taken.
✓ Branch 14 → 18 taken 5 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 13 → 14 not taken.
✓ Branch 13 → 17 taken 10 times.
15 if (!hrd->nal_hrd_parameters_present_flag &&
1859
0/4
cbs_h265_read_sei_buffering_period:
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 18 not taken.
cbs_h265_write_sei_buffering_period:
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 17 not taken.
✗ !hrd->vcl_hrd_parameters_present_flag) {
1860 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "Buffering period SEI requires "
1861 "NAL or VCL HRD parameters to be present.\n");
1862 ✗ return AVERROR_INVALIDDATA;
1863 }
1864
1865
4/4
cbs_h265_read_sei_buffering_period:
✓ Branch 18 → 19 taken 2 times.
✓ Branch 18 → 23 taken 3 times.
cbs_h265_write_sei_buffering_period:
✓ Branch 17 → 18 taken 4 times.
✓ Branch 17 → 21 taken 6 times.
15 if (!hrd->sub_pic_hrd_params_present_flag)
1866
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 20 → 21 not taken.
✓ Branch 20 → 22 taken 2 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 24 taken 4 times.
6 flag(irap_cpb_params_present_flag);
1867 else
1868
1/2
✗ Branch 21 → 22 not taken.
✓ Branch 21 → 24 taken 6 times.
9 infer(irap_cpb_params_present_flag, 0);
1869
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 24 → 25 not taken.
✓ Branch 24 → 32 taken 5 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 24 → 25 not taken.
✓ Branch 24 → 31 taken 10 times.
15 if (current->irap_cpb_params_present_flag) {
1870 ✗ length = hrd->au_cpb_removal_delay_length_minus1 + 1;
1871
0/4
cbs_h265_read_sei_buffering_period:
✗ Branch 26 → 27 not taken.
✗ Branch 26 → 28 not taken.
cbs_h265_write_sei_buffering_period:
✗ Branch 26 → 27 not taken.
✗ Branch 26 → 28 not taken.
✗ ub(length, cpb_delay_offset);
1872 ✗ length = hrd->dpb_output_delay_length_minus1 + 1;
1873
0/4
cbs_h265_read_sei_buffering_period:
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
cbs_h265_write_sei_buffering_period:
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 37 not taken.
✗ ub(length, dpb_delay_offset);
1874 } else {
1875
1/2
✗ Branch 31 → 32 not taken.
✓ Branch 31 → 34 taken 10 times.
15 infer(cpb_delay_offset, 0);
1876
1/2
✗ Branch 34 → 35 not taken.
✓ Branch 34 → 37 taken 10 times.
15 infer(dpb_delay_offset, 0);
1877 }
1878
1879
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 34 → 35 not taken.
✓ Branch 34 → 36 taken 5 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 38 → 39 not taken.
✓ Branch 38 → 40 taken 10 times.
15 flag(concatenation_flag);
1880
1881 15 length = hrd->au_cpb_removal_delay_length_minus1 + 1;
1882
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 37 → 38 not taken.
✓ Branch 37 → 39 taken 5 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 41 → 42 not taken.
✓ Branch 41 → 43 taken 10 times.
15 ub(length, au_cpb_removal_delay_delta_minus1);
1883
1884
2/4
cbs_h265_read_sei_buffering_period:
✓ Branch 39 → 40 taken 5 times.
✗ Branch 39 → 58 not taken.
cbs_h265_write_sei_buffering_period:
✓ Branch 43 → 44 taken 10 times.
✗ Branch 43 → 62 not taken.
15 if (hrd->nal_hrd_parameters_present_flag) {
1885
4/4
cbs_h265_read_sei_buffering_period:
✓ Branch 57 → 41 taken 5 times.
✓ Branch 57 → 58 taken 5 times.
cbs_h265_write_sei_buffering_period:
✓ Branch 61 → 45 taken 10 times.
✓ Branch 61 → 62 taken 10 times.
30 for (i = 0; i <= hrd->cpb_cnt_minus1[0]; i++) {
1886 15 length = hrd->initial_cpb_removal_delay_length_minus1 + 1;
1887
1888
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 42 → 43 not taken.
✓ Branch 42 → 44 taken 5 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 46 → 47 not taken.
✓ Branch 46 → 48 taken 10 times.
15 ubs(length, nal_initial_cpb_removal_delay[i], 1, i);
1889
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 45 → 46 not taken.
✓ Branch 45 → 47 taken 5 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 49 → 50 not taken.
✓ Branch 49 → 51 taken 10 times.
15 ubs(length, nal_initial_cpb_removal_offset[i], 1, i);
1890
1891
4/4
cbs_h265_read_sei_buffering_period:
✓ Branch 47 → 48 taken 2 times.
✓ Branch 47 → 49 taken 3 times.
cbs_h265_write_sei_buffering_period:
✓ Branch 51 → 52 taken 4 times.
✓ Branch 51 → 53 taken 6 times.
15 if (hrd->sub_pic_hrd_params_present_flag ||
1892
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 48 → 49 not taken.
✓ Branch 48 → 56 taken 2 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 52 → 53 not taken.
✓ Branch 52 → 60 taken 4 times.
6 current->irap_cpb_params_present_flag) {
1893
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 50 → 51 not taken.
✓ Branch 50 → 52 taken 3 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 54 → 55 not taken.
✓ Branch 54 → 56 taken 6 times.
9 ubs(length, nal_initial_alt_cpb_removal_delay[i], 1, i);
1894
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 53 → 54 not taken.
✓ Branch 53 → 55 taken 3 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 57 → 58 not taken.
✓ Branch 57 → 59 taken 6 times.
9 ubs(length, nal_initial_alt_cpb_removal_offset[i], 1, i);
1895 }
1896 }
1897 }
1898
2/4
cbs_h265_read_sei_buffering_period:
✓ Branch 58 → 59 taken 5 times.
✗ Branch 58 → 77 not taken.
cbs_h265_write_sei_buffering_period:
✓ Branch 62 → 63 taken 10 times.
✗ Branch 62 → 81 not taken.
15 if (hrd->vcl_hrd_parameters_present_flag) {
1899
4/4
cbs_h265_read_sei_buffering_period:
✓ Branch 76 → 60 taken 5 times.
✓ Branch 76 → 77 taken 5 times.
cbs_h265_write_sei_buffering_period:
✓ Branch 80 → 64 taken 10 times.
✓ Branch 80 → 81 taken 10 times.
30 for (i = 0; i <= hrd->cpb_cnt_minus1[0]; i++) {
1900 15 length = hrd->initial_cpb_removal_delay_length_minus1 + 1;
1901
1902
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 61 → 62 not taken.
✓ Branch 61 → 63 taken 5 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 65 → 66 not taken.
✓ Branch 65 → 67 taken 10 times.
15 ubs(length, vcl_initial_cpb_removal_delay[i], 1, i);
1903
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 64 → 65 not taken.
✓ Branch 64 → 66 taken 5 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 68 → 69 not taken.
✓ Branch 68 → 70 taken 10 times.
15 ubs(length, vcl_initial_cpb_removal_offset[i], 1, i);
1904
1905
4/4
cbs_h265_read_sei_buffering_period:
✓ Branch 66 → 67 taken 2 times.
✓ Branch 66 → 68 taken 3 times.
cbs_h265_write_sei_buffering_period:
✓ Branch 70 → 71 taken 4 times.
✓ Branch 70 → 72 taken 6 times.
15 if (hrd->sub_pic_hrd_params_present_flag ||
1906
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 67 → 68 not taken.
✓ Branch 67 → 75 taken 2 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 71 → 72 not taken.
✓ Branch 71 → 79 taken 4 times.
6 current->irap_cpb_params_present_flag) {
1907
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 69 → 70 not taken.
✓ Branch 69 → 71 taken 3 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 73 → 74 not taken.
✓ Branch 73 → 75 taken 6 times.
9 ubs(length, vcl_initial_alt_cpb_removal_delay[i], 1, i);
1908
2/4
cbs_h265_read_sei_buffering_period:
✗ Branch 72 → 73 not taken.
✓ Branch 72 → 74 taken 3 times.
cbs_h265_write_sei_buffering_period:
✗ Branch 76 → 77 not taken.
✓ Branch 76 → 78 taken 6 times.
9 ubs(length, vcl_initial_alt_cpb_removal_offset[i], 1, i);
1909 }
1910 }
1911 }
1912
1913 #ifdef READ
1914 5 end_pos = get_bits_count(rw);
1915
1/2
✗ Branch 79 → 80 not taken.
✓ Branch 79 → 84 taken 5 times.
5 if (ff_cbs_h2645_payload_extension_present(rw, sei->payload_size,
1916 end_pos - start_pos))
1917
0/2
✗ Branch 81 → 82 not taken.
✗ Branch 81 → 83 not taken.
✗ flag(use_alt_cpb_params_flag);
1918 else
1919 5 infer(use_alt_cpb_params_flag, 0);
1920 #else
1921 // If unknown extension data exists, then use_alt_cpb_params_flag is
1922 // coded in the bitstream and must be written even if it's 0.
1923
2/4
✓ Branch 81 → 82 taken 10 times.
✗ Branch 81 → 83 not taken.
✗ Branch 82 → 83 not taken.
✓ Branch 82 → 87 taken 10 times.
10 if (current->use_alt_cpb_params_flag || sei->extension_present) {
1924
0/2
✗ Branch 84 → 85 not taken.
✗ Branch 84 → 86 not taken.
✗ flag(use_alt_cpb_params_flag);
1925 // Ensure this bit is not the last in the payload by making the
1926 // more_data_in_payload() check evaluate to true, so it may not
1927 // be mistaken as something else by decoders.
1928 ✗ sei->extension_present = 1;
1929 }
1930 #endif
1931
1932 15 return 0;
1933 }
1934
1935 936 SEI_FUNC(sei_pic_timing, (CodedBitstreamContext *ctx, RWContext *rw,
1936 H265RawSEIPicTiming *current, SEIMessageState *sei))
1937 {
1938 468 CodedBitstreamH265Context *h265 = ctx->priv_data;
1939 const H265RawSPS *sps;
1940 const H265RawHRDParameters *hrd;
1941 int err, expected_source_scan_type, i, length;
1942
1943 468 HEADER("Picture Timing");
1944
1945 468 sps = h265->active_sps;
1946
2/4
cbs_h265_read_sei_pic_timing:
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 6 taken 156 times.
cbs_h265_write_sei_pic_timing:
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 6 taken 312 times.
468 if (!sps) {
1947 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR,
1948 "No active SPS for pic_timing.\n");
1949 ✗ return AVERROR_INVALIDDATA;
1950 }
1951
1952 468 expected_source_scan_type = 2 -
1953 468 2 * sps->profile_tier_level.general_interlaced_source_flag -
1954 468 sps->profile_tier_level.general_progressive_source_flag;
1955
1956
4/4
cbs_h265_read_sei_pic_timing:
✓ Branch 6 → 7 taken 60 times.
✓ Branch 6 → 20 taken 96 times.
cbs_h265_write_sei_pic_timing:
✓ Branch 6 → 7 taken 120 times.
✓ Branch 6 → 19 taken 192 times.
468 if (sps->vui.frame_field_info_present_flag) {
1957
2/4
cbs_h265_read_sei_pic_timing:
✗ Branch 8 → 9 not taken.
✓ Branch 8 → 10 taken 60 times.
cbs_h265_write_sei_pic_timing:
✗ Branch 8 → 9 not taken.
✓ Branch 8 → 10 taken 120 times.
180 u(4, pic_struct, 0, 12);
1958
4/8
cbs_h265_read_sei_pic_timing:
✓ Branch 10 → 11 taken 60 times.
✗ Branch 10 → 12 not taken.
✗ Branch 14 → 15 not taken.
✓ Branch 14 → 16 taken 60 times.
cbs_h265_write_sei_pic_timing:
✓ Branch 10 → 11 taken 120 times.
✗ Branch 10 → 12 not taken.
✗ Branch 14 → 15 not taken.
✓ Branch 14 → 16 taken 120 times.
180 u(2, source_scan_type,
1959 expected_source_scan_type >= 0 ? expected_source_scan_type : 0,
1960 expected_source_scan_type >= 0 ? expected_source_scan_type : 2);
1961
2/4
cbs_h265_read_sei_pic_timing:
✗ Branch 17 → 18 not taken.
✓ Branch 17 → 19 taken 60 times.
cbs_h265_write_sei_pic_timing:
✗ Branch 17 → 18 not taken.
✓ Branch 17 → 34 taken 120 times.
180 flag(duplicate_flag);
1962 } else {
1963
1/2
✗ Branch 19 → 20 not taken.
✓ Branch 19 → 22 taken 192 times.
288 infer(pic_struct, 0);
1964
3/8
cbs_h265_read_sei_pic_timing:
✓ Branch 20 → 21 taken 96 times.
✗ Branch 20 → 22 not taken.
cbs_h265_write_sei_pic_timing:
✓ Branch 22 → 23 taken 192 times.
✗ Branch 22 → 24 not taken.
✗ Branch 25 → 26 not taken.
✓ Branch 25 → 31 taken 192 times.
✗ Branch 26 → 27 not taken.
✗ Branch 26 → 28 not taken.
288 infer(source_scan_type,
1965 expected_source_scan_type >= 0 ? expected_source_scan_type : 2);
1966
1/2
✗ Branch 31 → 32 not taken.
✓ Branch 31 → 34 taken 192 times.
288 infer(duplicate_flag, 0);
1967 }
1968
1969
2/4
cbs_h265_read_sei_pic_timing:
✓ Branch 24 → 25 taken 156 times.
✗ Branch 24 → 27 not taken.
cbs_h265_write_sei_pic_timing:
✓ Branch 34 → 35 taken 312 times.
✗ Branch 34 → 37 not taken.
468 if (sps->vui_parameters_present_flag &&
1970
2/4
cbs_h265_read_sei_pic_timing:
✓ Branch 25 → 26 taken 156 times.
✗ Branch 25 → 27 not taken.
cbs_h265_write_sei_pic_timing:
✓ Branch 35 → 36 taken 312 times.
✗ Branch 35 → 37 not taken.
468 sps->vui.vui_hrd_parameters_present_flag)
1971 468 hrd = &sps->vui.hrd_parameters;
1972 else
1973 ✗ hrd = NULL;
1974
4/8
cbs_h265_read_sei_pic_timing:
✓ Branch 28 → 29 taken 156 times.
✗ Branch 28 → 70 not taken.
✗ Branch 29 → 30 not taken.
✓ Branch 29 → 31 taken 156 times.
cbs_h265_write_sei_pic_timing:
✓ Branch 38 → 39 taken 312 times.
✗ Branch 38 → 78 not taken.
✗ Branch 39 → 40 not taken.
✓ Branch 39 → 41 taken 312 times.
468 if (hrd && (hrd->nal_hrd_parameters_present_flag ||
1975
0/4
cbs_h265_read_sei_pic_timing:
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 70 not taken.
cbs_h265_write_sei_pic_timing:
✗ Branch 40 → 41 not taken.
✗ Branch 40 → 78 not taken.
✗ hrd->vcl_hrd_parameters_present_flag)) {
1976 468 length = hrd->au_cpb_removal_delay_length_minus1 + 1;
1977
2/4
cbs_h265_read_sei_pic_timing:
✗ Branch 32 → 33 not taken.
✓ Branch 32 → 34 taken 156 times.
cbs_h265_write_sei_pic_timing:
✗ Branch 42 → 43 not taken.
✓ Branch 42 → 44 taken 312 times.
468 ub(length, au_cpb_removal_delay_minus1);
1978
1979 468 length = hrd->dpb_output_delay_length_minus1 + 1;
1980
2/4
cbs_h265_read_sei_pic_timing:
✗ Branch 35 → 36 not taken.
✓ Branch 35 → 37 taken 156 times.
cbs_h265_write_sei_pic_timing:
✗ Branch 45 → 46 not taken.
✓ Branch 45 → 47 taken 312 times.
468 ub(length, pic_dpb_output_delay);
1981
1982
4/4
cbs_h265_read_sei_pic_timing:
✓ Branch 37 → 38 taken 96 times.
✓ Branch 37 → 42 taken 60 times.
cbs_h265_write_sei_pic_timing:
✓ Branch 47 → 48 taken 192 times.
✓ Branch 47 → 51 taken 120 times.
468 if (hrd->sub_pic_hrd_params_present_flag) {
1983 288 length = hrd->dpb_output_delay_du_length_minus1 + 1;
1984
2/4
cbs_h265_read_sei_pic_timing:
✗ Branch 39 → 40 not taken.
✓ Branch 39 → 41 taken 96 times.
cbs_h265_write_sei_pic_timing:
✗ Branch 49 → 50 not taken.
✓ Branch 49 → 51 taken 192 times.
288 ub(length, pic_dpb_output_du_delay);
1985 }
1986
1987
4/4
cbs_h265_read_sei_pic_timing:
✓ Branch 42 → 43 taken 96 times.
✓ Branch 42 → 70 taken 60 times.
cbs_h265_write_sei_pic_timing:
✓ Branch 51 → 52 taken 192 times.
✓ Branch 51 → 78 taken 120 times.
468 if (hrd->sub_pic_hrd_params_present_flag &&
1988
2/4
cbs_h265_read_sei_pic_timing:
✓ Branch 43 → 44 taken 96 times.
✗ Branch 43 → 70 not taken.
cbs_h265_write_sei_pic_timing:
✓ Branch 52 → 53 taken 192 times.
✗ Branch 52 → 78 not taken.
288 hrd->sub_pic_cpb_params_in_pic_timing_sei_flag) {
1989 unsigned int pic_width_in_ctbs_y, pic_height_in_ctbs_y;
1990 288 cbs_h265_pic_size_in_ctbs(sps, &pic_width_in_ctbs_y, &pic_height_in_ctbs_y);
1991 // D.3.3 bounds this by PicSizeInCtbsY - 1. A decoding unit holds at
1992 // least one VCL NAL unit (3.47) and no level allows a picture more
1993 // than HEVC_MAX_SLICE_SEGMENTS slice segments (A.4.2), which is also
1994 // the size of the arrays indexed by it.
1995
2/4
cbs_h265_read_sei_pic_timing:
✗ Branch 46 → 47 not taken.
✓ Branch 46 → 48 taken 96 times.
cbs_h265_write_sei_pic_timing:
✗ Branch 55 → 56 not taken.
✓ Branch 55 → 57 taken 192 times.
288 ue(num_decoding_units_minus1, 0,
1996 FFMIN(pic_width_in_ctbs_y * pic_height_in_ctbs_y, HEVC_MAX_SLICE_SEGMENTS) - 1);
1997
2/4
cbs_h265_read_sei_pic_timing:
✗ Branch 49 → 50 not taken.
✓ Branch 49 → 51 taken 96 times.
cbs_h265_write_sei_pic_timing:
✗ Branch 58 → 59 not taken.
✓ Branch 58 → 60 taken 192 times.
288 flag(du_common_cpb_removal_delay_flag);
1998
1999 288 length = hrd->du_cpb_removal_delay_increment_length_minus1 + 1;
2000
2/4
cbs_h265_read_sei_pic_timing:
✗ Branch 51 → 52 not taken.
✓ Branch 51 → 56 taken 96 times.
cbs_h265_write_sei_pic_timing:
✗ Branch 60 → 61 not taken.
✓ Branch 60 → 64 taken 192 times.
288 if (current->du_common_cpb_removal_delay_flag)
2001
0/4
cbs_h265_read_sei_pic_timing:
✗ Branch 53 → 54 not taken.
✗ Branch 53 → 55 not taken.
cbs_h265_write_sei_pic_timing:
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 64 not taken.
✗ ub(length, du_common_cpb_removal_delay_increment_minus1);
2002
2003
4/4
cbs_h265_read_sei_pic_timing:
✓ Branch 67 → 57 taken 384 times.
✓ Branch 67 → 68 taken 96 times.
cbs_h265_write_sei_pic_timing:
✓ Branch 75 → 65 taken 768 times.
✓ Branch 75 → 76 taken 192 times.
1440 for (i = 0; i <= current->num_decoding_units_minus1; i++) {
2004
2/4
cbs_h265_read_sei_pic_timing:
✗ Branch 58 → 59 not taken.
✓ Branch 58 → 60 taken 384 times.
cbs_h265_write_sei_pic_timing:
✗ Branch 66 → 67 not taken.
✓ Branch 66 → 68 taken 768 times.
1152 ues(num_nalus_in_du_minus1[i],
2005 0, HEVC_MAX_SLICE_SEGMENTS, 1, i);
2006
2/4
cbs_h265_read_sei_pic_timing:
✓ Branch 60 → 61 taken 384 times.
✗ Branch 60 → 66 not taken.
cbs_h265_write_sei_pic_timing:
✓ Branch 68 → 69 taken 768 times.
✗ Branch 68 → 74 not taken.
1152 if (!current->du_common_cpb_removal_delay_flag &&
2007
4/4
cbs_h265_read_sei_pic_timing:
✓ Branch 61 → 62 taken 288 times.
✓ Branch 61 → 66 taken 96 times.
cbs_h265_write_sei_pic_timing:
✓ Branch 69 → 70 taken 576 times.
✓ Branch 69 → 74 taken 192 times.
1152 i < current->num_decoding_units_minus1)
2008
2/4
cbs_h265_read_sei_pic_timing:
✗ Branch 63 → 64 not taken.
✓ Branch 63 → 65 taken 288 times.
cbs_h265_write_sei_pic_timing:
✗ Branch 71 → 72 not taken.
✓ Branch 71 → 73 taken 576 times.
864 ubs(length, du_cpb_removal_delay_increment_minus1[i], 1, i);
2009 }
2010 }
2011 }
2012
2013 468 return 0;
2014 }
2015
2016 ✗ SEI_FUNC(sei_pan_scan_rect, (CodedBitstreamContext *ctx, RWContext *rw,
2017 H265RawSEIPanScanRect *current,
2018 SEIMessageState *sei))
2019 {
2020 int err, i;
2021
2022 ✗ HEADER("Pan-Scan Rectangle");
2023
2024
0/4
cbs_h265_read_sei_pan_scan_rect:
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
cbs_h265_write_sei_pan_scan_rect:
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
✗ ue(pan_scan_rect_id, 0, UINT32_MAX - 1);
2025
0/4
cbs_h265_read_sei_pan_scan_rect:
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 9 not taken.
cbs_h265_write_sei_pan_scan_rect:
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 9 not taken.
✗ flag(pan_scan_rect_cancel_flag);
2026
2027
0/4
cbs_h265_read_sei_pan_scan_rect:
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 32 not taken.
cbs_h265_write_sei_pan_scan_rect:
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 31 not taken.
✗ if (!current->pan_scan_rect_cancel_flag) {
2028
0/4
cbs_h265_read_sei_pan_scan_rect:
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
cbs_h265_write_sei_pan_scan_rect:
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
✗ ue(pan_scan_cnt_minus1, 0, 2);
2029
2030
0/4
cbs_h265_read_sei_pan_scan_rect:
✗ Branch 27 → 14 not taken.
✗ Branch 27 → 28 not taken.
cbs_h265_write_sei_pan_scan_rect:
✗ Branch 27 → 14 not taken.
✗ Branch 27 → 28 not taken.
✗ for (i = 0; i <= current->pan_scan_cnt_minus1; i++) {
2031
0/4
cbs_h265_read_sei_pan_scan_rect:
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 17 not taken.
cbs_h265_write_sei_pan_scan_rect:
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 17 not taken.
✗ ses(pan_scan_rect_left_offset[i], INT32_MIN + 1, INT32_MAX, 1, i);
2032
0/4
cbs_h265_read_sei_pan_scan_rect:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
cbs_h265_write_sei_pan_scan_rect:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ ses(pan_scan_rect_right_offset[i], INT32_MIN + 1, INT32_MAX, 1, i);
2033
0/4
cbs_h265_read_sei_pan_scan_rect:
✗ Branch 21 → 22 not taken.
✗ Branch 21 → 23 not taken.
cbs_h265_write_sei_pan_scan_rect:
✗ Branch 21 → 22 not taken.
✗ Branch 21 → 23 not taken.
✗ ses(pan_scan_rect_top_offset[i], INT32_MIN + 1, INT32_MAX, 1, i);
2034
0/4
cbs_h265_read_sei_pan_scan_rect:
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 26 not taken.
cbs_h265_write_sei_pan_scan_rect:
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 26 not taken.
✗ ses(pan_scan_rect_bottom_offset[i], INT32_MIN + 1, INT32_MAX, 1, i);
2035 }
2036
2037
0/4
cbs_h265_read_sei_pan_scan_rect:
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
cbs_h265_write_sei_pan_scan_rect:
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 31 not taken.
✗ flag(pan_scan_rect_persistence_flag);
2038 }
2039
2040 ✗ return 0;
2041 }
2042
2043 30 SEI_FUNC(sei_recovery_point, (CodedBitstreamContext *ctx, RWContext *rw,
2044 H265RawSEIRecoveryPoint *current,
2045 SEIMessageState *sei))
2046 {
2047 int err;
2048
2049 15 HEADER("Recovery Point");
2050
2051
2/4
cbs_h265_read_sei_recovery_point:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 5 times.
cbs_h265_write_sei_recovery_point:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 10 times.
15 se(recovery_poc_cnt, -32768, 32767);
2052
2053
2/4
cbs_h265_read_sei_recovery_point:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 5 times.
cbs_h265_write_sei_recovery_point:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 10 times.
15 flag(exact_match_flag);
2054
2/4
cbs_h265_read_sei_recovery_point:
✗ Branch 10 → 11 not taken.
✓ Branch 10 → 12 taken 5 times.
cbs_h265_write_sei_recovery_point:
✗ Branch 10 → 11 not taken.
✓ Branch 10 → 12 taken 10 times.
15 flag(broken_link_flag);
2055
2056 15 return 0;
2057 }
2058
2059 ✗ SEI_FUNC(film_grain_characteristics, (CodedBitstreamContext *ctx, RWContext *rw,
2060 H265RawFilmGrainCharacteristics *current,
2061 SEIMessageState *state))
2062 {
2063 ✗ CodedBitstreamH265Context *h265 = ctx->priv_data;
2064 ✗ const H265RawSPS *sps = h265->active_sps;
2065 int err, c, i, j;
2066
2067 ✗ HEADER("Film Grain Characteristics");
2068
2069
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
✗ flag(film_grain_characteristics_cancel_flag);
2070
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 79 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 95 not taken.
✗ if (!current->film_grain_characteristics_cancel_flag) {
2071 int filmGrainBitDepth[3];
2072
2073
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 10 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 10 not taken.
✗ u(2, film_grain_model_id, 0, 1);
2074
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
✗ flag(separate_colour_description_present_flag);
2075
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 33 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 32 not taken.
✗ if (current->separate_colour_description_present_flag) {
2076
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 17 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 17 not taken.
✗ ub(3, film_grain_bit_depth_luma_minus8);
2077
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ ub(3, film_grain_bit_depth_chroma_minus8);
2078
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 21 → 22 not taken.
✗ Branch 21 → 23 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 21 → 22 not taken.
✗ Branch 21 → 23 not taken.
✗ flag(film_grain_full_range_flag);
2079
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 26 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 26 not taken.
✗ ub(8, film_grain_colour_primaries);
2080
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 29 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 29 not taken.
✗ ub(8, film_grain_transfer_characteristics);
2081
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 32 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 53 not taken.
✗ ub(8, film_grain_matrix_coeffs);
2082 } else {
2083
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 33 → 34 not taken.
✗ Branch 33 → 36 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 32 → 33 not taken.
✗ Branch 32 → 35 not taken.
✗ if (!sps) {
2084 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR,
2085 "No active SPS for film_grain_characteristics.\n");
2086 ✗ return AVERROR_INVALIDDATA;
2087 }
2088
0/2
✗ Branch 35 → 36 not taken.
✗ Branch 35 → 38 not taken.
✗ infer(film_grain_bit_depth_luma_minus8, sps->bit_depth_luma_minus8);
2089
0/2
✗ Branch 38 → 39 not taken.
✗ Branch 38 → 41 not taken.
✗ infer(film_grain_bit_depth_chroma_minus8, sps->bit_depth_chroma_minus8);
2090
0/2
✗ Branch 41 → 42 not taken.
✗ Branch 41 → 44 not taken.
✗ infer(film_grain_full_range_flag, sps->vui.video_full_range_flag);
2091
0/2
✗ Branch 44 → 45 not taken.
✗ Branch 44 → 47 not taken.
✗ infer(film_grain_colour_primaries, sps->vui.colour_primaries);
2092
0/2
✗ Branch 47 → 48 not taken.
✗ Branch 47 → 50 not taken.
✗ infer(film_grain_transfer_characteristics, sps->vui.transfer_characteristics);
2093
0/2
✗ Branch 50 → 51 not taken.
✗ Branch 50 → 53 not taken.
✗ infer(film_grain_matrix_coeffs, sps->vui.matrix_coefficients);
2094 }
2095
2096 ✗ filmGrainBitDepth[0] = current->film_grain_bit_depth_luma_minus8 + 8;
2097 ✗ filmGrainBitDepth[1] =
2098 ✗ filmGrainBitDepth[2] = current->film_grain_bit_depth_chroma_minus8 + 8;
2099
2100
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 38 → 39 not taken.
✗ Branch 38 → 40 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 54 → 55 not taken.
✗ Branch 54 → 56 not taken.
✗ u(2, blending_mode_id, 0, 1);
2101
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 41 → 42 not taken.
✗ Branch 41 → 43 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 57 → 58 not taken.
✗ Branch 57 → 59 not taken.
✗ ub(4, log2_scale_factor);
2102
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 48 → 44 not taken.
✗ Branch 48 → 49 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 64 → 60 not taken.
✗ Branch 64 → 65 not taken.
✗ for (c = 0; c < 3; c++)
2103
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 45 → 46 not taken.
✗ Branch 45 → 47 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 61 → 62 not taken.
✗ Branch 61 → 63 not taken.
✗ flags(comp_model_present_flag[c], 1, c);
2104
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 73 → 50 not taken.
✗ Branch 73 → 74 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 89 → 66 not taken.
✗ Branch 89 → 90 not taken.
✗ for (c = 0; c < 3; c++) {
2105
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 50 → 51 not taken.
✗ Branch 50 → 72 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 66 → 67 not taken.
✗ Branch 66 → 88 not taken.
✗ if (current->comp_model_present_flag[c]) {
2106
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 52 → 53 not taken.
✗ Branch 52 → 54 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 68 → 69 not taken.
✗ Branch 68 → 70 not taken.
✗ ubs(8, num_intensity_intervals_minus1[c], 1, c);
2107
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 55 → 56 not taken.
✗ Branch 55 → 57 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 71 → 72 not taken.
✗ Branch 71 → 73 not taken.
✗ us(3, num_model_values_minus1[c], 0, 5, 1, c);
2108
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 71 → 58 not taken.
✗ Branch 71 → 72 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 87 → 74 not taken.
✗ Branch 87 → 88 not taken.
✗ for (i = 0; i <= current->num_intensity_intervals_minus1[c]; i++) {
2109
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 61 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 75 → 76 not taken.
✗ Branch 75 → 77 not taken.
✗ ubs(8, intensity_interval_lower_bound[c][i], 2, c, i);
2110
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 64 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 78 → 79 not taken.
✗ Branch 78 → 80 not taken.
✗ ubs(8, intensity_interval_upper_bound[c][i], 2, c, i);
2111
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 69 → 65 not taken.
✗ Branch 69 → 70 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 85 → 81 not taken.
✗ Branch 85 → 86 not taken.
✗ for (j = 0; j <= current->num_model_values_minus1[c]; j++)
2112
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 66 → 67 not taken.
✗ Branch 66 → 68 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 82 → 83 not taken.
✗ Branch 82 → 84 not taken.
✗ ses(comp_model_value[c][i][j], 0 - current->film_grain_model_id * (1 << (filmGrainBitDepth[c] - 1)),
2113 ((1 << filmGrainBitDepth[c]) - 1) - current->film_grain_model_id * (1 << (filmGrainBitDepth[c] - 1)),
2114 3, c, i, j);
2115 }
2116 }
2117 }
2118
0/4
cbs_h265_read_film_grain_characteristics:
✗ Branch 75 → 76 not taken.
✗ Branch 75 → 77 not taken.
cbs_h265_write_film_grain_characteristics:
✗ Branch 91 → 92 not taken.
✗ Branch 91 → 93 not taken.
✗ flag(film_grain_characteristics_persistence_flag);
2119 }
2120
2121 ✗ return 0;
2122 }
2123
2124 ✗ SEI_FUNC(sei_display_orientation, (CodedBitstreamContext *ctx, RWContext *rw,
2125 H265RawSEIDisplayOrientation *current,
2126 SEIMessageState *sei))
2127 {
2128 int err;
2129
2130 ✗ HEADER("Display Orientation");
2131
2132
0/4
cbs_h265_read_sei_display_orientation:
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
cbs_h265_write_sei_display_orientation:
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
✗ flag(display_orientation_cancel_flag);
2133
0/4
cbs_h265_read_sei_display_orientation:
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 20 not taken.
cbs_h265_write_sei_display_orientation:
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 19 not taken.
✗ if (!current->display_orientation_cancel_flag) {
2134
0/4
cbs_h265_read_sei_display_orientation:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 10 not taken.
cbs_h265_write_sei_display_orientation:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 10 not taken.
✗ flag(hor_flip);
2135
0/4
cbs_h265_read_sei_display_orientation:
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
cbs_h265_write_sei_display_orientation:
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
✗ flag(ver_flip);
2136
0/4
cbs_h265_read_sei_display_orientation:
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 16 not taken.
cbs_h265_write_sei_display_orientation:
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 16 not taken.
✗ ub(16, anticlockwise_rotation);
2137
0/4
cbs_h265_read_sei_display_orientation:
✗ Branch 17 → 18 not taken.
✗ Branch 17 → 19 not taken.
cbs_h265_write_sei_display_orientation:
✗ Branch 17 → 18 not taken.
✗ Branch 17 → 19 not taken.
✗ flag(display_orientation_persistence_flag);
2138 }
2139
2140 ✗ return 0;
2141 }
2142
2143 18 SEI_FUNC(sei_active_parameter_sets, (CodedBitstreamContext *ctx, RWContext *rw,
2144 H265RawSEIActiveParameterSets *current,
2145 SEIMessageState *sei))
2146 {
2147 9 CodedBitstreamH265Context *h265 = ctx->priv_data;
2148 const H265RawVPS *vps;
2149 int err, i;
2150
2151 9 HEADER("Active Parameter Sets");
2152
2153
2/4
cbs_h265_read_sei_active_parameter_sets:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 3 times.
cbs_h265_write_sei_active_parameter_sets:
✗ Branch 4 → 5 not taken.
✓ Branch 4 → 6 taken 6 times.
9 u(4, active_video_parameter_set_id, 0, HEVC_MAX_VPS_COUNT);
2154 9 vps = h265->vps[current->active_video_parameter_set_id];
2155
2/4
cbs_h265_read_sei_active_parameter_sets:
✗ Branch 6 → 7 not taken.
✓ Branch 6 → 9 taken 3 times.
cbs_h265_write_sei_active_parameter_sets:
✗ Branch 6 → 7 not taken.
✓ Branch 6 → 9 taken 6 times.
9 if (!vps) {
2156 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "VPS id %d not available for active "
2157 ✗ "parameter sets.\n", current->active_video_parameter_set_id);
2158 ✗ return AVERROR_INVALIDDATA;
2159 }
2160 9 h265->active_vps = vps;
2161
2162
2/4
cbs_h265_read_sei_active_parameter_sets:
✗ Branch 10 → 11 not taken.
✓ Branch 10 → 12 taken 3 times.
cbs_h265_write_sei_active_parameter_sets:
✗ Branch 10 → 11 not taken.
✓ Branch 10 → 12 taken 6 times.
9 flag(self_contained_cvs_flag);
2163
2/4
cbs_h265_read_sei_active_parameter_sets:
✗ Branch 13 → 14 not taken.
✓ Branch 13 → 15 taken 3 times.
cbs_h265_write_sei_active_parameter_sets:
✗ Branch 13 → 14 not taken.
✓ Branch 13 → 15 taken 6 times.
9 flag(no_parameter_set_update_flag);
2164
2165
2/4
cbs_h265_read_sei_active_parameter_sets:
✗ Branch 16 → 17 not taken.
✓ Branch 16 → 18 taken 3 times.
cbs_h265_write_sei_active_parameter_sets:
✗ Branch 16 → 17 not taken.
✓ Branch 16 → 18 taken 6 times.
9 ue(num_sps_ids_minus1, 0, HEVC_MAX_SPS_COUNT - 1);
2166
4/4
cbs_h265_read_sei_active_parameter_sets:
✓ Branch 23 → 19 taken 3 times.
✓ Branch 23 → 24 taken 3 times.
cbs_h265_write_sei_active_parameter_sets:
✓ Branch 23 → 19 taken 6 times.
✓ Branch 23 → 24 taken 6 times.
18 for (i = 0; i <= current->num_sps_ids_minus1; i++)
2167
2/4
cbs_h265_read_sei_active_parameter_sets:
✗ Branch 20 → 21 not taken.
✓ Branch 20 → 22 taken 3 times.
cbs_h265_write_sei_active_parameter_sets:
✗ Branch 20 → 21 not taken.
✓ Branch 20 → 22 taken 6 times.
9 ues(active_seq_parameter_set_id[i], 0, HEVC_MAX_SPS_COUNT - 1, 1, i);
2168
2169 9 for (i = vps->vps_base_layer_internal_flag;
2170
2/4
cbs_h265_read_sei_active_parameter_sets:
✗ Branch 31 → 25 not taken.
✓ Branch 31 → 32 taken 3 times.
cbs_h265_write_sei_active_parameter_sets:
✗ Branch 31 → 25 not taken.
✓ Branch 31 → 32 taken 6 times.
9 i <= FFMIN(62, vps->vps_max_layers_minus1); i++) {
2171
0/4
cbs_h265_read_sei_active_parameter_sets:
✗ Branch 26 → 27 not taken.
✗ Branch 26 → 28 not taken.
cbs_h265_write_sei_active_parameter_sets:
✗ Branch 26 → 27 not taken.
✗ Branch 26 → 28 not taken.
✗ ues(layer_sps_idx[i], 0, current->num_sps_ids_minus1, 1, i);
2172
2173
0/4
cbs_h265_read_sei_active_parameter_sets:
✗ Branch 28 → 29 not taken.
✗ Branch 28 → 30 not taken.
cbs_h265_write_sei_active_parameter_sets:
✗ Branch 28 → 29 not taken.
✗ Branch 28 → 30 not taken.
✗ if (i == 0)
2174 ✗ h265->active_sps = h265->sps[current->active_seq_parameter_set_id[current->layer_sps_idx[0]]];
2175 }
2176
2177 9 return 0;
2178 }
2179
2180 8948 SEI_FUNC(sei_decoded_picture_hash, (CodedBitstreamContext *ctx, RWContext *rw,
2181 H265RawSEIDecodedPictureHash *current,
2182 SEIMessageState *sei))
2183 {
2184 4474 CodedBitstreamH265Context *h265 = ctx->priv_data;
2185 4474 const H265RawSPS *sps = h265->active_sps;
2186 int err, c, i;
2187
2188 4474 HEADER("Decoded Picture Hash");
2189
2190
2/4
cbs_h265_read_sei_decoded_picture_hash:
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 6 taken 1688 times.
cbs_h265_write_sei_decoded_picture_hash:
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 6 taken 2786 times.
4474 if (!sps) {
2191 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR,
2192 "No active SPS for decoded picture hash.\n");
2193 ✗ return AVERROR_INVALIDDATA;
2194 }
2195
2196
2/4
cbs_h265_read_sei_decoded_picture_hash:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 1688 times.
cbs_h265_write_sei_decoded_picture_hash:
✗ Branch 7 → 8 not taken.
✓ Branch 7 → 9 taken 2786 times.
4474 u(8, hash_type, 0, 2);
2197
2198
6/8
cbs_h265_read_sei_decoded_picture_hash:
✗ Branch 28 → 29 not taken.
✓ Branch 28 → 30 taken 6752 times.
✓ Branch 31 → 10 taken 5064 times.
✓ Branch 31 → 32 taken 1688 times.
cbs_h265_write_sei_decoded_picture_hash:
✗ Branch 28 → 29 not taken.
✓ Branch 28 → 30 taken 11144 times.
✓ Branch 31 → 10 taken 8358 times.
✓ Branch 31 → 32 taken 2786 times.
17896 for (c = 0; c < (sps->chroma_format_idc == 0 ? 1 : 3); c++) {
2199
4/4
cbs_h265_read_sei_decoded_picture_hash:
✓ Branch 10 → 11 taken 4716 times.
✓ Branch 10 → 17 taken 348 times.
cbs_h265_write_sei_decoded_picture_hash:
✓ Branch 10 → 11 taken 7662 times.
✓ Branch 10 → 17 taken 696 times.
13422 if (current->hash_type == 0) {
2200
4/4
cbs_h265_read_sei_decoded_picture_hash:
✓ Branch 16 → 12 taken 75456 times.
✓ Branch 16 → 27 taken 4716 times.
cbs_h265_write_sei_decoded_picture_hash:
✓ Branch 16 → 12 taken 122592 times.
✓ Branch 16 → 27 taken 7662 times.
210426 for (i = 0; i < 16; i++)
2201
2/4
cbs_h265_read_sei_decoded_picture_hash:
✗ Branch 13 → 14 not taken.
✓ Branch 13 → 15 taken 75456 times.
cbs_h265_write_sei_decoded_picture_hash:
✗ Branch 13 → 14 not taken.
✓ Branch 13 → 15 taken 122592 times.
198048 us(8, picture_md5[c][i], 0x00, 0xff, 2, c, i);
2202
2/4
cbs_h265_read_sei_decoded_picture_hash:
✗ Branch 17 → 18 not taken.
✓ Branch 17 → 22 taken 348 times.
cbs_h265_write_sei_decoded_picture_hash:
✗ Branch 17 → 18 not taken.
✓ Branch 17 → 22 taken 696 times.
1044 } else if (current->hash_type == 1) {
2203
0/4
cbs_h265_read_sei_decoded_picture_hash:
✗ Branch 19 → 20 not taken.
✗ Branch 19 → 21 not taken.
cbs_h265_write_sei_decoded_picture_hash:
✗ Branch 19 → 20 not taken.
✗ Branch 19 → 21 not taken.
✗ us(16, picture_crc[c], 0x0000, 0xffff, 1, c);
2204
2/4
cbs_h265_read_sei_decoded_picture_hash:
✓ Branch 22 → 23 taken 348 times.
✗ Branch 22 → 27 not taken.
cbs_h265_write_sei_decoded_picture_hash:
✓ Branch 22 → 23 taken 696 times.
✗ Branch 22 → 27 not taken.
1044 } else if (current->hash_type == 2) {
2205
2/4
cbs_h265_read_sei_decoded_picture_hash:
✗ Branch 24 → 25 not taken.
✓ Branch 24 → 26 taken 348 times.
cbs_h265_write_sei_decoded_picture_hash:
✗ Branch 24 → 25 not taken.
✓ Branch 24 → 26 taken 696 times.
1044 us(32, picture_checksum[c], 0x00000000, 0xffffffff, 1, c);
2206 }
2207 }
2208
2209 4474 return 0;
2210 }
2211
2212 ✗ SEI_FUNC(sei_time_code, (CodedBitstreamContext *ctx, RWContext *rw,
2213 H265RawSEITimeCode *current, SEIMessageState *sei))
2214 {
2215 int err, i;
2216
2217 ✗ HEADER("Time Code");
2218
2219
0/4
cbs_h265_read_sei_time_code:
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
✗ u(2, num_clock_ts, 1, 3);
2220
2221
0/4
cbs_h265_read_sei_time_code:
✗ Branch 72 → 7 not taken.
✗ Branch 72 → 73 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 74 → 7 not taken.
✗ Branch 74 → 75 not taken.
✗ for (i = 0; i < current->num_clock_ts; i++) {
2222
0/4
cbs_h265_read_sei_time_code:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 10 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 10 not taken.
✗ flags(clock_timestamp_flag[i], 1, i);
2223
2224
0/4
cbs_h265_read_sei_time_code:
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 71 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 73 not taken.
✗ if (current->clock_timestamp_flag[i]) {
2225
0/4
cbs_h265_read_sei_time_code:
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 14 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 14 not taken.
✗ flags(units_field_based_flag[i], 1, i);
2226
0/4
cbs_h265_read_sei_time_code:
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 17 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 17 not taken.
✗ us(5, counting_type[i], 0, 6, 1, i);
2227
0/4
cbs_h265_read_sei_time_code:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 18 → 19 not taken.
✗ Branch 18 → 20 not taken.
✗ flags(full_timestamp_flag[i], 1, i);
2228
0/4
cbs_h265_read_sei_time_code:
✗ Branch 21 → 22 not taken.
✗ Branch 21 → 23 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 21 → 22 not taken.
✗ Branch 21 → 23 not taken.
✗ flags(discontinuity_flag[i], 1, i);
2229
0/4
cbs_h265_read_sei_time_code:
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 26 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 24 → 25 not taken.
✗ Branch 24 → 26 not taken.
✗ flags(cnt_dropped_flag[i], 1, i);
2230
2231
0/4
cbs_h265_read_sei_time_code:
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 29 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 29 not taken.
✗ ubs(9, n_frames[i], 1, i);
2232
2233
0/4
cbs_h265_read_sei_time_code:
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 40 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 40 not taken.
✗ if (current->full_timestamp_flag[i]) {
2234
0/4
cbs_h265_read_sei_time_code:
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 33 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 31 → 32 not taken.
✗ Branch 31 → 33 not taken.
✗ us(6, seconds_value[i], 0, 59, 1, i);
2235
0/4
cbs_h265_read_sei_time_code:
✗ Branch 34 → 35 not taken.
✗ Branch 34 → 36 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 34 → 35 not taken.
✗ Branch 34 → 36 not taken.
✗ us(6, minutes_value[i], 0, 59, 1, i);
2236
0/4
cbs_h265_read_sei_time_code:
✗ Branch 37 → 38 not taken.
✗ Branch 37 → 39 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 37 → 38 not taken.
✗ Branch 37 → 39 not taken.
✗ us(5, hours_value[i], 0, 23, 1, i);
2237 } else {
2238
0/4
cbs_h265_read_sei_time_code:
✗ Branch 41 → 42 not taken.
✗ Branch 41 → 43 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 41 → 42 not taken.
✗ Branch 41 → 43 not taken.
✗ flags(seconds_flag[i], 1, i);
2239
0/4
cbs_h265_read_sei_time_code:
✗ Branch 43 → 44 not taken.
✗ Branch 43 → 62 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 43 → 44 not taken.
✗ Branch 43 → 62 not taken.
✗ if (current->seconds_flag[i]) {
2240
0/4
cbs_h265_read_sei_time_code:
✗ Branch 45 → 46 not taken.
✗ Branch 45 → 47 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 45 → 46 not taken.
✗ Branch 45 → 47 not taken.
✗ us(6, seconds_value[i], 0, 59, 1, i);
2241
0/4
cbs_h265_read_sei_time_code:
✗ Branch 48 → 49 not taken.
✗ Branch 48 → 50 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 48 → 49 not taken.
✗ Branch 48 → 50 not taken.
✗ flags(minutes_flag[i], 1, i);
2242
0/4
cbs_h265_read_sei_time_code:
✗ Branch 50 → 51 not taken.
✗ Branch 50 → 62 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 50 → 51 not taken.
✗ Branch 50 → 62 not taken.
✗ if (current->minutes_flag[i]) {
2243
0/4
cbs_h265_read_sei_time_code:
✗ Branch 52 → 53 not taken.
✗ Branch 52 → 54 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 52 → 53 not taken.
✗ Branch 52 → 54 not taken.
✗ us(6, minutes_value[i], 0, 59, 1, i);
2244
0/4
cbs_h265_read_sei_time_code:
✗ Branch 55 → 56 not taken.
✗ Branch 55 → 57 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 55 → 56 not taken.
✗ Branch 55 → 57 not taken.
✗ flags(hours_flag[i], 1, i);
2245
0/4
cbs_h265_read_sei_time_code:
✗ Branch 57 → 58 not taken.
✗ Branch 57 → 62 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 57 → 58 not taken.
✗ Branch 57 → 62 not taken.
✗ if (current->hours_flag[i])
2246
0/4
cbs_h265_read_sei_time_code:
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 61 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 59 → 60 not taken.
✗ Branch 59 → 61 not taken.
✗ us(5, hours_value[i], 0, 23, 1, i);
2247 }
2248 }
2249 }
2250
2251
0/4
cbs_h265_read_sei_time_code:
✗ Branch 63 → 64 not taken.
✗ Branch 63 → 65 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 63 → 64 not taken.
✗ Branch 63 → 65 not taken.
✗ ubs(5, time_offset_length[i], 1, i);
2252
0/4
cbs_h265_read_sei_time_code:
✗ Branch 65 → 66 not taken.
✗ Branch 65 → 70 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 65 → 66 not taken.
✗ Branch 65 → 70 not taken.
✗ if (current->time_offset_length[i] > 0)
2253
0/4
cbs_h265_read_sei_time_code:
✗ Branch 67 → 68 not taken.
✗ Branch 67 → 69 not taken.
cbs_h265_write_sei_time_code:
✗ Branch 67 → 68 not taken.
✗ Branch 67 → 69 not taken.
✗ ibs(current->time_offset_length[i], time_offset_value[i], 1, i);
2254 else
2255
0/2
✗ Branch 70 → 71 not taken.
✗ Branch 70 → 73 not taken.
✗ infer(time_offset_value[i], 0);
2256 }
2257 }
2258
2259 ✗ return 0;
2260 }
2261
2262 ✗ SEI_FUNC(sei_alpha_channel_info, (CodedBitstreamContext *ctx, RWContext *rw,
2263 H265RawSEIAlphaChannelInfo *current,
2264 SEIMessageState *sei))
2265 {
2266 int err, length;
2267
2268 ✗ HEADER("Alpha Channel Information");
2269
2270
0/4
cbs_h265_read_sei_alpha_channel_info:
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
cbs_h265_write_sei_alpha_channel_info:
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
✗ flag(alpha_channel_cancel_flag);
2271
0/4
cbs_h265_read_sei_alpha_channel_info:
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 30 not taken.
cbs_h265_write_sei_alpha_channel_info:
✗ Branch 6 → 7 not taken.
✗ Branch 6 → 29 not taken.
✗ if (!current->alpha_channel_cancel_flag) {
2272
0/4
cbs_h265_read_sei_alpha_channel_info:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 10 not taken.
cbs_h265_write_sei_alpha_channel_info:
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 10 not taken.
✗ ub(3, alpha_channel_use_idc);
2273
0/4
cbs_h265_read_sei_alpha_channel_info:
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
cbs_h265_write_sei_alpha_channel_info:
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
✗ ub(3, alpha_channel_bit_depth_minus8);
2274 ✗ length = current->alpha_channel_bit_depth_minus8 + 9;
2275
0/4
cbs_h265_read_sei_alpha_channel_info:
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 16 not taken.
cbs_h265_write_sei_alpha_channel_info:
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 16 not taken.
✗ ub(length, alpha_transparent_value);
2276
0/4
cbs_h265_read_sei_alpha_channel_info:
✗ Branch 17 → 18 not taken.
✗ Branch 17 → 19 not taken.
cbs_h265_write_sei_alpha_channel_info:
✗ Branch 17 → 18 not taken.
✗ Branch 17 → 19 not taken.
✗ ub(length, alpha_opaque_value);
2277
0/4
cbs_h265_read_sei_alpha_channel_info:
✗ Branch 20 → 21 not taken.
✗ Branch 20 → 22 not taken.
cbs_h265_write_sei_alpha_channel_info:
✗ Branch 20 → 21 not taken.
✗ Branch 20 → 22 not taken.
✗ flag(alpha_channel_incr_flag);
2278
0/4
cbs_h265_read_sei_alpha_channel_info:
✗ Branch 23 → 24 not taken.
✗ Branch 23 → 25 not taken.
cbs_h265_write_sei_alpha_channel_info:
✗ Branch 23 → 24 not taken.
✗ Branch 23 → 25 not taken.
✗ flag(alpha_channel_clip_flag);
2279
0/4
cbs_h265_read_sei_alpha_channel_info:
✗ Branch 25 → 26 not taken.
✗ Branch 25 → 31 not taken.
cbs_h265_write_sei_alpha_channel_info:
✗ Branch 25 → 26 not taken.
✗ Branch 25 → 38 not taken.
✗ if (current->alpha_channel_clip_flag)
2280
0/4
cbs_h265_read_sei_alpha_channel_info:
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 29 not taken.
cbs_h265_write_sei_alpha_channel_info:
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 38 not taken.
✗ flag(alpha_channel_clip_type_flag);
2281 } else {
2282
0/2
✗ Branch 29 → 30 not taken.
✗ Branch 29 → 32 not taken.
✗ infer(alpha_channel_use_idc, 2);
2283
0/2
✗ Branch 32 → 33 not taken.
✗ Branch 32 → 35 not taken.
✗ infer(alpha_channel_incr_flag, 0);
2284
0/2
✗ Branch 35 → 36 not taken.
✗ Branch 35 → 38 not taken.
✗ infer(alpha_channel_clip_flag, 0);
2285 }
2286
2287 ✗ return 0;
2288 }
2289
2290 ✗ SEI_FUNC(sei_3d_reference_displays_info, (CodedBitstreamContext *ctx, RWContext *rw,
2291 H265RawSEI3DReferenceDisplaysInfo *current,
2292 SEIMessageState *sei))
2293 {
2294 int length;
2295 int err, i;
2296
2297 ✗ HEADER("Three Dimensional Reference Displays Information");
2298
2299
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
✗ ue(prec_ref_display_width, 0, 31);
2300
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 9 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 7 → 8 not taken.
✗ Branch 7 → 9 not taken.
✗ flag(ref_viewing_distance_flag);
2301
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 14 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 14 not taken.
✗ if (current->ref_viewing_distance_flag)
2302
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 13 not taken.
✗ ue(prec_ref_viewing_dist, 0, 31);
2303
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 17 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 15 → 16 not taken.
✗ Branch 15 → 17 not taken.
✗ ue(num_ref_displays_minus1, 0, 31);
2304
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 68 → 18 not taken.
✗ Branch 68 → 69 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 72 → 18 not taken.
✗ Branch 72 → 73 not taken.
✗ for (i = 0; i <= current->num_ref_displays_minus1; i++) {
2305
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 19 → 20 not taken.
✗ Branch 19 → 21 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 19 → 20 not taken.
✗ Branch 19 → 21 not taken.
✗ ues(left_view_id[i], 0, MAX_UINT_BITS(15), 1, i);
2306
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 24 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 22 → 23 not taken.
✗ Branch 22 → 24 not taken.
✗ ues(right_view_id[i], 0, MAX_UINT_BITS(15), 1, i);
2307
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 25 → 26 not taken.
✗ Branch 25 → 27 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 25 → 26 not taken.
✗ Branch 25 → 27 not taken.
✗ us(6, exponent_ref_display_width[i], 0, 62, 1, i);
2308
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 31 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 27 → 28 not taken.
✗ Branch 27 → 31 not taken.
✗ if (!current->exponent_ref_display_width[i])
2309
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 28 → 29 not taken.
✗ Branch 28 → 30 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 28 → 29 not taken.
✗ Branch 28 → 30 not taken.
✗ length = FFMAX(0, (int)current->prec_ref_display_width - 30);
2310 else
2311 ✗ length = FFMAX(0, (int)current->exponent_ref_display_width[i] +
2312 (int)current->prec_ref_display_width - 31);
2313
2314
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 32 → 33 not taken.
✗ Branch 32 → 35 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 32 → 33 not taken.
✗ Branch 32 → 35 not taken.
✗ if (length > 32) {
2315 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "refDispWidthBits > 32 is not supported\n");
2316 ✗ return AVERROR_PATCHWELCOME;
2317 }
2318
2319
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 35 → 36 not taken.
✗ Branch 35 → 40 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 35 → 36 not taken.
✗ Branch 35 → 40 not taken.
✗ if (length)
2320
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 37 → 38 not taken.
✗ Branch 37 → 39 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 37 → 38 not taken.
✗ Branch 37 → 39 not taken.
✗ ubs(length, mantissa_ref_display_width[i], 1, i);
2321 else
2322
0/2
✗ Branch 40 → 41 not taken.
✗ Branch 40 → 43 not taken.
✗ infer(mantissa_ref_display_width[i], 0);
2323
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 41 → 42 not taken.
✗ Branch 41 → 59 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 43 → 44 not taken.
✗ Branch 43 → 63 not taken.
✗ if (current->ref_viewing_distance_flag) {
2324
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 43 → 44 not taken.
✗ Branch 43 → 45 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 45 → 46 not taken.
✗ Branch 45 → 47 not taken.
✗ us(6, exponent_ref_viewing_distance[i], 0, 62, 1, i);
2325
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 45 → 46 not taken.
✗ Branch 45 → 49 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 47 → 48 not taken.
✗ Branch 47 → 51 not taken.
✗ if (!current->exponent_ref_viewing_distance[i])
2326
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 46 → 47 not taken.
✗ Branch 46 → 48 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 48 → 49 not taken.
✗ Branch 48 → 50 not taken.
✗ length = FFMAX(0, (int)current->prec_ref_viewing_dist - 30);
2327 else
2328 ✗ length = FFMAX(0, (int)current->exponent_ref_viewing_distance[i] +
2329 (int)current->prec_ref_viewing_dist - 31);
2330
2331
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 50 → 51 not taken.
✗ Branch 50 → 53 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 52 → 53 not taken.
✗ Branch 52 → 55 not taken.
✗ if (length > 32) {
2332 ✗ av_log(ctx->log_ctx, AV_LOG_ERROR, "refViewDistBits > 32 is not supported\n");
2333 ✗ return AVERROR_PATCHWELCOME;
2334 }
2335
2336
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 53 → 54 not taken.
✗ Branch 53 → 58 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 55 → 56 not taken.
✗ Branch 55 → 60 not taken.
✗ if (length)
2337
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 55 → 56 not taken.
✗ Branch 55 → 57 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 57 → 58 not taken.
✗ Branch 57 → 59 not taken.
✗ ubs(length, mantissa_ref_viewing_distance[i], 1, i);
2338 else
2339
0/2
✗ Branch 60 → 61 not taken.
✗ Branch 60 → 63 not taken.
✗ infer(mantissa_ref_viewing_distance[i], 0);
2340 }
2341
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 60 → 61 not taken.
✗ Branch 60 → 62 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 66 not taken.
✗ flags(additional_shift_present_flag[i], 1, i);
2342
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 62 → 63 not taken.
✗ Branch 62 → 67 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 66 → 67 not taken.
✗ Branch 66 → 71 not taken.
✗ if (current->additional_shift_present_flag[i])
2343
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 64 → 65 not taken.
✗ Branch 64 → 66 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 68 → 69 not taken.
✗ Branch 68 → 70 not taken.
✗ us(10, num_sample_shift_plus512[i], 0, 1023, 1, i);
2344 }
2345
0/4
cbs_h265_read_sei_3d_reference_displays_info:
✗ Branch 70 → 71 not taken.
✗ Branch 70 → 72 not taken.
cbs_h265_write_sei_3d_reference_displays_info:
✗ Branch 74 → 75 not taken.
✗ Branch 74 → 76 not taken.
✗ flag(three_dimensional_reference_displays_extension_flag);
2346
2347 ✗ return 0;
2348 }
2349
2350 3423 static int FUNC(sei)(CodedBitstreamContext *ctx, RWContext *rw,
2351 H265RawSEI *current, int prefix)
2352 {
2353 int err;
2354
2355
4/4
cbs_h265_read_sei:
✓ Branch 2 → 3 taken 171 times.
✓ Branch 2 → 4 taken 1688 times.
cbs_h265_write_sei:
✓ Branch 2 → 3 taken 171 times.
✓ Branch 2 → 4 taken 1393 times.
3423 if (prefix)
2356 342 HEADER("Prefix Supplemental Enhancement Information");
2357 else
2358 3081 HEADER("Suffix Supplemental Enhancement Information");
2359
2360
6/8
cbs_h265_read_sei:
✓ Branch 5 → 6 taken 171 times.
✓ Branch 5 → 7 taken 1688 times.
✗ Branch 9 → 10 not taken.
✓ Branch 9 → 11 taken 1859 times.
cbs_h265_write_sei:
✓ Branch 5 → 6 taken 171 times.
✓ Branch 5 → 7 taken 1393 times.
✗ Branch 9 → 10 not taken.
✓ Branch 9 → 11 taken 1564 times.
3423 CHECK(FUNC(nal_unit_header)(ctx, rw, &current->nal_unit_header,
2361 prefix ? HEVC_NAL_SEI_PREFIX
2362 : HEVC_NAL_SEI_SUFFIX));
2363
2364
2/4
cbs_h265_read_sei:
✗ Branch 12 → 13 not taken.
✓ Branch 12 → 14 taken 1859 times.
cbs_h265_write_sei:
✗ Branch 12 → 13 not taken.
✓ Branch 12 → 14 taken 1564 times.
3423 CHECK(FUNC_SEI(message_list)(ctx, rw, &current->message_list, prefix));
2365
2366
2/4
cbs_h265_read_sei:
✗ Branch 15 → 16 not taken.
✓ Branch 15 → 17 taken 1859 times.
cbs_h265_write_sei:
✗ Branch 15 → 16 not taken.
✓ Branch 15 → 17 taken 1564 times.
3423 CHECK(FUNC(rbsp_trailing_bits)(ctx, rw));
2367
2368 3423 return 0;
2369 }
2370
2371
2372 ✗ static int FUNC(filler)(CodedBitstreamContext *ctx, RWContext *rw,
2373 H265RawFiller *current)
2374 {
2375 int err;
2376
2377 ✗ HEADER("Filler Data");
2378
2379
0/4
cbs_h265_read_filler:
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
cbs_h265_write_filler:
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 6 not taken.
✗ CHECK(FUNC(nal_unit_header)(ctx, rw, &current->nal_unit_header,
2380 HEVC_NAL_FD_NUT));
2381
2382 #ifdef READ
2383
0/2
✗ Branch 12 → 7 not taken.
✗ Branch 12 → 13 not taken.
✗ while (show_bits(rw, 8) == 0xff) {
2384
0/2
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 10 not taken.
✗ fixed(8, ff_byte, 0xff);
2385 ✗ ++current->filler_size;
2386 }
2387 #else
2388 {
2389 uint32_t i;
2390
0/2
✗ Branch 11 → 7 not taken.
✗ Branch 11 → 12 not taken.
✗ for (i = 0; i < current->filler_size; i++)
2391
0/2
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 10 not taken.
✗ fixed(8, ff_byte, 0xff);
2392 }
2393 #endif
2394
2395
0/4
cbs_h265_read_filler:
✗ Branch 14 → 15 not taken.
✗ Branch 14 → 16 not taken.
cbs_h265_write_filler:
✗ Branch 13 → 14 not taken.
✗ Branch 13 → 15 not taken.
✗ CHECK(FUNC(rbsp_trailing_bits)(ctx, rw));
2396
2397 ✗ return 0;
2398 }
2399