FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libavcodec/cbs_h266_syntax_template.c
Date: 2024-02-16 17:37:06
Exec Total Coverage
Lines: 1491 2130 70.0%
Functions: 60 64 93.8%
Branches: 1509 3350 45.0%

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 18108 static int FUNC(rbsp_trailing_bits) (CodedBitstreamContext *ctx,
20 RWContext *rw)
21 {
22 int err;
23
24
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 9054 times.
18108 fixed(1, rbsp_stop_one_bit, 1);
25
2/2
✓ Branch 1 taken 49107 times.
✓ Branch 2 taken 9054 times.
116322 while (byte_alignment(rw) != 0)
26
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 49107 times.
98214 fixed(1, rbsp_alignment_zero_bit, 0);
27 18108 return 0;
28 }
29
30 39038 static int FUNC(nal_unit_header) (CodedBitstreamContext *ctx, RWContext *rw,
31 H266RawNALUnitHeader *current,
32 int expected_nal_unit_type)
33 {
34 int err;
35
36
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 19519 times.
39038 fixed(1, forbidden_zero_bit, 0);
37
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 19519 times.
39038 flag(nuh_reserved_zero_bit);
38
39
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 19519 times.
39038 u(6, nuh_layer_id, 0, 55);
40
41
2/2
✓ Branch 0 taken 9054 times.
✓ Branch 1 taken 10465 times.
39038 if (expected_nal_unit_type >= 0)
42
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 9054 times.
18108 u(5, nal_unit_type, expected_nal_unit_type, expected_nal_unit_type);
43 else
44
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 10465 times.
20930 ub(5, nal_unit_type);
45
46
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 19519 times.
39038 u(3, nuh_temporal_id_plus1, 1, 7);
47 39038 return 0;
48 }
49
50 20930 static int FUNC(byte_alignment) (CodedBitstreamContext *ctx, RWContext *rw)
51 {
52 int err;
53
54
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 10465 times.
20930 fixed(1, byte_alignment_bit_equal_to_one, 1);
55
2/2
✓ Branch 1 taken 28046 times.
✓ Branch 2 taken 10465 times.
77022 while (byte_alignment(rw) != 0)
56
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 28046 times.
56092 fixed(1, byte_alignment_bit_equal_to_zero, 0);
57 20930 return 0;
58 }
59
60 2490 static int FUNC(general_constraints_info) (CodedBitstreamContext *ctx,
61 RWContext *rw,
62 H266GeneralConstraintsInfo *current)
63 {
64 int err, i, num_additional_bits_used;
65
66
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1245 times.
2490 flag(gci_present_flag);
67
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1245 times.
2490 if (current->gci_present_flag) {
68 /* general */
69 flag(gci_intra_only_constraint_flag);
70 flag(gci_all_layers_independent_constraint_flag);
71 flag(gci_one_au_only_constraint_flag);
72
73 /* picture format */
74 u(4, gci_sixteen_minus_max_bitdepth_constraint_idc, 0, 8);
75 ub(2, gci_three_minus_max_chroma_format_constraint_idc);
76
77 /* NAL unit type related */
78 flag(gci_no_mixed_nalu_types_in_pic_constraint_flag);
79 flag(gci_no_trail_constraint_flag);
80 flag(gci_no_stsa_constraint_flag);
81 flag(gci_no_rasl_constraint_flag);
82 flag(gci_no_radl_constraint_flag);
83 flag(gci_no_idr_constraint_flag);
84 flag(gci_no_cra_constraint_flag);
85 flag(gci_no_gdr_constraint_flag);
86 flag(gci_no_aps_constraint_flag);
87 flag(gci_no_idr_rpl_constraint_flag);
88
89 /* tile, slice, subpicture partitioning */
90 flag(gci_one_tile_per_pic_constraint_flag);
91 flag(gci_pic_header_in_slice_header_constraint_flag);
92 flag(gci_one_slice_per_pic_constraint_flag);
93 flag(gci_no_rectangular_slice_constraint_flag);
94 flag(gci_one_slice_per_subpic_constraint_flag);
95 flag(gci_no_subpic_info_constraint_flag);
96
97 /* CTU and block partitioning */
98 ub(2, gci_three_minus_max_log2_ctu_size_constraint_idc);
99 flag(gci_no_partition_constraints_override_constraint_flag);
100 flag(gci_no_mtt_constraint_flag);
101 flag(gci_no_qtbtt_dual_tree_intra_constraint_flag);
102
103 /* intra */
104 flag(gci_no_palette_constraint_flag);
105 flag(gci_no_ibc_constraint_flag);
106 flag(gci_no_isp_constraint_flag);
107 flag(gci_no_mrl_constraint_flag);
108 flag(gci_no_mip_constraint_flag);
109 flag(gci_no_cclm_constraint_flag);
110
111 /* inter */
112 flag(gci_no_ref_pic_resampling_constraint_flag);
113 flag(gci_no_res_change_in_clvs_constraint_flag);
114 flag(gci_no_weighted_prediction_constraint_flag);
115 flag(gci_no_ref_wraparound_constraint_flag);
116 flag(gci_no_temporal_mvp_constraint_flag);
117 flag(gci_no_sbtmvp_constraint_flag);
118 flag(gci_no_amvr_constraint_flag);
119 flag(gci_no_bdof_constraint_flag);
120 flag(gci_no_smvd_constraint_flag);
121 flag(gci_no_dmvr_constraint_flag);
122 flag(gci_no_mmvd_constraint_flag);
123 flag(gci_no_affine_motion_constraint_flag);
124 flag(gci_no_prof_constraint_flag);
125 flag(gci_no_bcw_constraint_flag);
126 flag(gci_no_ciip_constraint_flag);
127 flag(gci_no_gpm_constraint_flag);
128
129 /* transform, quantization, residual */
130 flag(gci_no_luma_transform_size_64_constraint_flag);
131 flag(gci_no_transform_skip_constraint_flag);
132 flag(gci_no_bdpcm_constraint_flag);
133 flag(gci_no_mts_constraint_flag);
134 flag(gci_no_lfnst_constraint_flag);
135 flag(gci_no_joint_cbcr_constraint_flag);
136 flag(gci_no_sbt_constraint_flag);
137 flag(gci_no_act_constraint_flag);
138 flag(gci_no_explicit_scaling_list_constraint_flag);
139 flag(gci_no_dep_quant_constraint_flag);
140 flag(gci_no_sign_data_hiding_constraint_flag);
141 flag(gci_no_cu_qp_delta_constraint_flag);
142 flag(gci_no_chroma_qp_offset_constraint_flag);
143
144 /* loop filter */
145 flag(gci_no_sao_constraint_flag);
146 flag(gci_no_alf_constraint_flag);
147 flag(gci_no_ccalf_constraint_flag);
148 flag(gci_no_lmcs_constraint_flag);
149 flag(gci_no_ladf_constraint_flag);
150 flag(gci_no_virtual_boundaries_constraint_flag);
151 ub(8, gci_num_additional_bits);
152 if (current->gci_num_additional_bits > 5) {
153 flag(gci_all_rap_pictures_constraint_flag);
154 flag(gci_no_extended_precision_processing_constraint_flag);
155 flag(gci_no_ts_residual_coding_rice_constraint_flag);
156 flag(gci_no_rrc_rice_extension_constraint_flag);
157 flag(gci_no_persistent_rice_adaptation_constraint_flag);
158 flag(gci_no_reverse_last_sig_coeff_constraint_flag);
159 num_additional_bits_used = 6;
160 } else {
161 infer(gci_all_rap_pictures_constraint_flag, 0);
162 infer(gci_no_extended_precision_processing_constraint_flag, 0);
163 infer(gci_no_ts_residual_coding_rice_constraint_flag, 0);
164 infer(gci_no_rrc_rice_extension_constraint_flag, 0);
165 infer(gci_no_persistent_rice_adaptation_constraint_flag, 0);
166 infer(gci_no_reverse_last_sig_coeff_constraint_flag, 0);
167 num_additional_bits_used = 0;
168 }
169
170 for (i = 0; i < current->gci_num_additional_bits - num_additional_bits_used; i++)
171 flags(gci_reserved_bit[i], 1, i);
172 }
173
2/2
✓ Branch 1 taken 6225 times.
✓ Branch 2 taken 1245 times.
14940 while (byte_alignment(rw) != 0)
174
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 6225 times.
12450 fixed(1, gci_alignment_zero_bit, 0);
175 2490 return 0;
176 }
177
178 2538 static int FUNC(profile_tier_level) (CodedBitstreamContext *ctx,
179 RWContext *rw,
180 H266RawProfileTierLevel *current,
181 int profile_tier_present_flag,
182 int max_num_sub_layers_minus1)
183 {
184 int err, i;
185
186
2/2
✓ Branch 0 taken 1245 times.
✓ Branch 1 taken 24 times.
2538 if (profile_tier_present_flag) {
187
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1245 times.
2490 ub(7, general_profile_idc);
188
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1245 times.
2490 flag(general_tier_flag);
189 }
190
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1269 times.
2538 ub(8, general_level_idc);
191
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1269 times.
2538 flag(ptl_frame_only_constraint_flag);
192
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1269 times.
2538 flag(ptl_multilayer_enabled_flag);
193
2/2
✓ Branch 0 taken 1245 times.
✓ Branch 1 taken 24 times.
2538 if (profile_tier_present_flag) {
194
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1245 times.
2490 CHECK(FUNC(general_constraints_info) (ctx, rw,
195 &current->
196 general_constraints_info));
197 }
198
2/2
✓ Branch 0 taken 1573 times.
✓ Branch 1 taken 1269 times.
5684 for (i = max_num_sub_layers_minus1 - 1; i >= 0; i--)
199
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1573 times.
3146 flags(ptl_sublayer_level_present_flag[i], 1, i);
200
2/2
✓ Branch 1 taken 1403 times.
✓ Branch 2 taken 1269 times.
5344 while (byte_alignment(rw) != 0)
201
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1403 times.
2806 flag(ptl_reserved_zero_bit);
202
2/2
✓ Branch 0 taken 1573 times.
✓ Branch 1 taken 1269 times.
5684 for (i = max_num_sub_layers_minus1 - 1; i >= 0; i--)
203
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1573 times.
3146 if (current->ptl_sublayer_level_present_flag[i])
204 ubs(8, sublayer_level_idc[i], 1, i);
205
2/2
✓ Branch 0 taken 1245 times.
✓ Branch 1 taken 24 times.
2538 if (profile_tier_present_flag) {
206
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1245 times.
2490 ub(8, ptl_num_sub_profiles);
207
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1245 times.
2490 for (i = 0; i < current->ptl_num_sub_profiles; i++)
208 ubs(32, general_sub_profile_idc[i], 1, i);
209 }
210 2538 return 0;
211 }
212
213 2398 static int FUNC(vui_parameters_default) (CodedBitstreamContext *ctx,
214 RWContext *rw, H266RawVUI *current)
215 {
216 //defined in D.8
217
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(vui_progressive_source_flag, 0);
218
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(vui_interlaced_source_flag, 0);
219
220
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(vui_non_packed_constraint_flag, 0);
221
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(vui_non_projected_constraint_flag, 0);
222
223
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(vui_aspect_ratio_constant_flag, 0);
224
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(vui_aspect_ratio_idc, 0);
225
226
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(vui_overscan_info_present_flag, 0);
227
228
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(vui_colour_primaries, 2);
229
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(vui_transfer_characteristics, 2);
230
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(vui_matrix_coeffs, 2);
231
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(vui_full_range_flag, 0);
232
233
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(vui_chroma_sample_loc_type_frame, 6);
234
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(vui_chroma_sample_loc_type_top_field, 6);
235
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(vui_chroma_sample_loc_type_bottom_field, 6);
236 2398 return 0;
237 }
238
239 34 static int FUNC(vui_parameters) (CodedBitstreamContext *ctx, RWContext *rw,
240 H266RawVUI *current,
241 uint8_t chroma_format_idc)
242 {
243 int err;
244
245
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 flag(vui_progressive_source_flag);
246
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 flag(vui_interlaced_source_flag);
247
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 flag(vui_non_packed_constraint_flag);
248
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 flag(vui_non_projected_constraint_flag);
249
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 flag(vui_aspect_ratio_info_present_flag);
250
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
34 if (current->vui_aspect_ratio_info_present_flag) {
251 flag(vui_aspect_ratio_constant_flag);
252 ub(8, vui_aspect_ratio_idc);
253 if (current->vui_aspect_ratio_idc == 255) {
254 ub(16, vui_sar_width);
255 ub(16, vui_sar_height);
256 }
257 } else {
258
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
34 infer(vui_aspect_ratio_constant_flag, 0);
259
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
34 infer(vui_aspect_ratio_idc, 0);
260 }
261
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 flag(vui_overscan_info_present_flag);
262
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
34 if (current->vui_overscan_info_present_flag)
263 flag(vui_overscan_appropriate_flag);
264
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 flag(vui_colour_description_present_flag);
265
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
34 if (current->vui_colour_description_present_flag) {
266 ub(8, vui_colour_primaries);
267 av_log(ctx->log_ctx, AV_LOG_DEBUG, "vui_colour_primaries == %d \n",
268 current->vui_colour_primaries);
269 ub(8, vui_transfer_characteristics);
270 av_log(ctx->log_ctx, AV_LOG_DEBUG,
271 "vui_transfer_characteristics == %d \n",
272 current->vui_transfer_characteristics);
273 ub(8, vui_matrix_coeffs);
274 av_log(ctx->log_ctx, AV_LOG_DEBUG, "vui_matrix_coeffs == %d \n",
275 current->vui_matrix_coeffs);
276 flag(vui_full_range_flag);
277 } else {
278
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
34 infer(vui_colour_primaries, 2);
279
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
34 infer(vui_transfer_characteristics, 2);
280
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
34 infer(vui_matrix_coeffs, 2);
281
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
34 infer(vui_full_range_flag, 0);
282 }
283
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 flag(vui_chroma_loc_info_present_flag);
284
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
34 if (chroma_format_idc != 1 && current->vui_chroma_loc_info_present_flag) {
285 av_log(ctx->log_ctx, AV_LOG_ERROR, "chroma_format_idc == %d,"
286 "vui_chroma_loc_info_present_flag can't not be true",
287 chroma_format_idc);
288 return AVERROR_INVALIDDATA;
289 }
290
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
34 if (current->vui_chroma_loc_info_present_flag) {
291 if (current->vui_progressive_source_flag &&
292 !current->vui_interlaced_source_flag) {
293 ue(vui_chroma_sample_loc_type_frame, 0, 6);
294 } else {
295 ue(vui_chroma_sample_loc_type_top_field, 0, 6);
296 ue(vui_chroma_sample_loc_type_bottom_field, 0, 6);
297 }
298 } else {
299
1/2
✓ Branch 0 taken 17 times.
✗ Branch 1 not taken.
34 if (chroma_format_idc == 1) {
300
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
34 infer(vui_chroma_sample_loc_type_frame, 6);
301
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
34 infer(vui_chroma_sample_loc_type_top_field,
302 current->vui_chroma_sample_loc_type_frame);
303
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
34 infer(vui_chroma_sample_loc_type_bottom_field,
304 current->vui_chroma_sample_loc_type_frame);
305 }
306 }
307 34 return 0;
308 }
309
310 static int FUNC(payload_extension) (CodedBitstreamContext *ctx, RWContext *rw,
311 H266RawExtensionData *current,
312 uint32_t payload_size, int cur_pos)
313 {
314 int err;
315 size_t byte_length, k;
316
317 #ifdef READ
318 GetBitContext tmp;
319 int bits_left, payload_zero_bits;
320
321 if (!cbs_h265_payload_extension_present(rw, payload_size, cur_pos))
322 return 0;
323
324 bits_left = 8 * payload_size - cur_pos;
325 tmp = *rw;
326 if (bits_left > 8)
327 skip_bits_long(&tmp, bits_left - 8);
328 payload_zero_bits = get_bits(&tmp, FFMIN(bits_left, 8));
329 if (!payload_zero_bits)
330 return AVERROR_INVALIDDATA;
331 payload_zero_bits = ff_ctz(payload_zero_bits);
332 current->bit_length = bits_left - payload_zero_bits - 1;
333 allocate(current->data, (current->bit_length + 7) / 8);
334 #endif
335
336 byte_length = (current->bit_length + 7) / 8;
337 for (k = 0; k < byte_length; k++) {
338 int length = FFMIN(current->bit_length - k * 8, 8);
339 xu(length, reserved_payload_extension_data, current->data[k],
340 0, MAX_UINT_BITS(length), 0);
341 }
342
343 return 0;
344 }
345
346 34 static int FUNC(vui_payload) (CodedBitstreamContext *ctx, RWContext *rw,
347 H266RawVUI *current, uint16_t vui_payload_size,
348 uint8_t chroma_format_idc)
349 {
350 int err;
351 int start_position, current_position;
352
353 34 start_position = bit_position(rw);
354
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 CHECK(FUNC(vui_parameters) (ctx, rw, current, chroma_format_idc));
355 34 current_position = bit_position(rw) - start_position;
356
357
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
34 if (current_position < 8 * vui_payload_size) {
358 CHECK(FUNC(payload_extension) (ctx, rw, &current->extension_data,
359 vui_payload_size, current_position));
360 fixed(1, vui_payload_bit_equal_to_one, 1);
361 while (byte_alignment(rw) != 0)
362 fixed(1, vui_payload_bit_equal_to_zero, 0);
363 }
364 34 return 0;
365 }
366
367 10 static int FUNC(extension_data) (CodedBitstreamContext *ctx, RWContext *rw,
368 H266RawExtensionData *current)
369 {
370 int err;
371 size_t k;
372 #ifdef READ
373 GetBitContext start;
374 uint8_t bit;
375 8 start = *rw;
376
2/2
✓ Branch 1 taken 16 times.
✓ Branch 2 taken 4 times.
40 for (k = 0; cbs_h2645_read_more_rbsp_data(rw); k++)
377 32 skip_bits(rw, 1);
378 8 current->bit_length = k;
379
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
8 if (k > 0) {
380 8 *rw = start;
381
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
8 allocate(current->data, (current->bit_length + 7) / 8);
382
2/2
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 4 times.
40 for (k = 0; k < current->bit_length; k++) {
383
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 16 times.
32 xu(1, extension_data, bit, 0, 1, 0);
384 32 current->data[k / 8] |= bit << (7 - k % 8);
385 }
386 }
387 #else
388
2/2
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 1 times.
10 for (k = 0; k < current->bit_length; k++)
389
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
8 xu(1, extension_data, current->data[k / 8] >> (7 - k % 8) & 1, 0, 1, 0);
390 #endif
391 10 return 0;
392 }
393
394 2480 static int FUNC(dpb_parameters) (CodedBitstreamContext *ctx, RWContext *rw,
395 H266DpbParameters *current,
396 uint8_t max_sublayers_minus1,
397 uint8_t sublayer_info_flag)
398 {
399 int err, i;
400
2/2
✓ Branch 0 taken 1223 times.
✓ Branch 1 taken 17 times.
2480 for (i = (sublayer_info_flag ? 0 : max_sublayers_minus1);
401
2/2
✓ Branch 0 taken 1308 times.
✓ Branch 1 taken 1240 times.
5096 i <= max_sublayers_minus1; i++) {
402
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1308 times.
2616 ues(dpb_max_dec_pic_buffering_minus1[i], 0, VVC_MAX_DPB_SIZE - 1, 1, i);
403
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1308 times.
2616 ues(dpb_max_num_reorder_pics[i],
404 0, current->dpb_max_dec_pic_buffering_minus1[i], 1, i);
405
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1308 times.
2616 ues(dpb_max_latency_increase_plus1[i], 0, UINT32_MAX - 1, 1, i);
406 }
407 2480 return 0;
408 }
409
410 126240 static int FUNC(ref_pic_list_struct) (CodedBitstreamContext *ctx,
411 RWContext *rw,
412 H266RefPicListStruct *current,
413 uint8_t list_idx, uint8_t rpls_idx,
414 const H266RawSPS *sps)
415 {
416 126240 CodedBitstreamH266Context *h266 = ctx->priv_data;
417 126240 int err, i, j, general_layer_idx = -1, num_direct_ref_layers = 0;
418 126240 const H266RawVPS *vps = h266->vps[sps->sps_video_parameter_set_id];
419
420
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 63120 times.
126240 if (!vps) {
421 av_log(ctx->log_ctx, AV_LOG_ERROR,
422 "VPS id %d not available.\n", sps->sps_video_parameter_set_id);
423 return AVERROR_INVALIDDATA;
424 }
425 //7.4.3.3 (29)
426
1/2
✓ Branch 0 taken 63705 times.
✗ Branch 1 not taken.
127410 for (i = 0; i <= vps->vps_max_layers_minus1; i++) {
427
2/2
✓ Branch 0 taken 63120 times.
✓ Branch 1 taken 585 times.
127410 if (sps->nal_unit_header.nuh_layer_id == vps->vps_layer_id[i]) {
428 126240 general_layer_idx = i;
429 126240 break;
430 }
431 }
432
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 63120 times.
126240 if (general_layer_idx < 0) {
433 av_log(ctx->log_ctx, AV_LOG_ERROR, "vps_layer_id %d not available.\n",
434 sps->nal_unit_header.nuh_layer_id);
435 return AVERROR_INVALIDDATA;
436 }
437 //7.4.3.3 (28)
438
2/2
✓ Branch 0 taken 64635 times.
✓ Branch 1 taken 63120 times.
255510 for (j = 0; j <= vps->vps_max_layers_minus1; j++) {
439
2/2
✓ Branch 0 taken 585 times.
✓ Branch 1 taken 64050 times.
129270 if (vps->vps_direct_ref_layer_flag[general_layer_idx][j])
440 1170 num_direct_ref_layers++;
441 }
442
443
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 63120 times.
126240 ue(num_ref_entries, 0, VVC_MAX_REF_ENTRIES);
444
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 63120 times.
126240 if (sps->sps_long_term_ref_pics_flag &&
445 rpls_idx < sps->sps_num_ref_pic_lists[list_idx] &&
446 current->num_ref_entries > 0)
447 flag(ltrp_in_header_flag);
448
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 63120 times.
126240 if (sps->sps_long_term_ref_pics_flag &&
449 rpls_idx == sps->sps_num_ref_pic_lists[list_idx])
450 infer(ltrp_in_header_flag, 1);
451
2/2
✓ Branch 0 taken 130928 times.
✓ Branch 1 taken 63120 times.
388096 for (i = 0, j = 0; i < current->num_ref_entries; i++) {
452
2/2
✓ Branch 0 taken 1865 times.
✓ Branch 1 taken 129063 times.
261856 if (sps->sps_inter_layer_prediction_enabled_flag)
453
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1865 times.
3730 flags(inter_layer_ref_pic_flag[i], 1, i);
454 else
455
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 34714 times.
258126 infer(inter_layer_ref_pic_flag[i], 0);
456
457
2/2
✓ Branch 0 taken 130668 times.
✓ Branch 1 taken 260 times.
261856 if (!current->inter_layer_ref_pic_flag[i]) {
458
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 130668 times.
261336 if (sps->sps_long_term_ref_pics_flag)
459 flags(st_ref_pic_flag[i], 1, i);
460 else
461
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 35035 times.
261336 infer(st_ref_pic_flag[i], 1);
462
1/2
✓ Branch 0 taken 130668 times.
✗ Branch 1 not taken.
261336 if (current->st_ref_pic_flag[i]) {
463 int abs_delta_poc_st;
464
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 130668 times.
261336 ues(abs_delta_poc_st[i], 0, MAX_UINT_BITS(15), 1, i);
465
2/2
✓ Branch 0 taken 129564 times.
✓ Branch 1 taken 1104 times.
261336 if ((sps->sps_weighted_pred_flag ||
466
3/4
✗ Branch 0 not taken.
✓ Branch 1 taken 129564 times.
✓ Branch 2 taken 624 times.
✓ Branch 3 taken 480 times.
261336 sps->sps_weighted_bipred_flag) && i != 0)
467 1248 abs_delta_poc_st = current->abs_delta_poc_st[i];
468 else
469 260088 abs_delta_poc_st = current->abs_delta_poc_st[i] + 1;
470
1/2
✓ Branch 0 taken 130668 times.
✗ Branch 1 not taken.
261336 if (abs_delta_poc_st > 0)
471
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 130668 times.
261336 flags(strp_entry_sign_flag[i], 1, i);
472 } else {
473 if (!current->ltrp_in_header_flag) {
474 uint8_t bits = sps->sps_log2_max_pic_order_cnt_lsb_minus4 + 4;
475 ubs(bits, rpls_poc_lsb_lt[j], 1, j);
476 j++;
477 }
478 }
479 } else {
480
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 260 times.
520 if (num_direct_ref_layers == 0) {
481 av_log(ctx->log_ctx, AV_LOG_ERROR,
482 "num_direct_ref_layers needs > 0.\n");
483 return AVERROR_INVALIDDATA;
484 }
485
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 260 times.
520 ues(ilrp_idx[i], 0, num_direct_ref_layers - 1, 1, i);
486 }
487 }
488 126240 return 0;
489 }
490
491 17732 static int FUNC(ref_pic_lists) (CodedBitstreamContext *ctx, RWContext *rw,
492 const H266RawSPS *sps, const H266RawPPS *pps,
493 H266RefPicLists *current) {
494 const H266RefPicListStruct * ref_list;
495 int err, i, j, num_ltrp_entries;
496
2/2
✓ Branch 0 taken 17732 times.
✓ Branch 1 taken 8866 times.
53196 for (i = 0; i < 2; i++) {
497
3/4
✓ Branch 0 taken 17732 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 8866 times.
✓ Branch 3 taken 8866 times.
35464 if (sps->sps_num_ref_pic_lists[i] > 0 &&
498
2/4
✓ Branch 0 taken 8866 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 8866 times.
17732 (i == 0 || (i == 1 && pps->pps_rpl1_idx_present_flag))) {
499
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 8866 times.
17732 flags(rpl_sps_flag[i], 1, i);
500 } else {
501
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 8866 times.
17732 if (sps->sps_num_ref_pic_lists[i] == 0) {
502 infer(rpl_sps_flag[i], 0);
503 } else {
504
2/4
✓ Branch 0 taken 8866 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 8866 times.
✗ Branch 3 not taken.
17732 if (!pps->pps_rpl1_idx_present_flag && i == 1)
505
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2182 times.
17732 infer(rpl_sps_flag[1], current->rpl_sps_flag[0]);
506 }
507 }
508
2/2
✓ Branch 0 taken 11628 times.
✓ Branch 1 taken 6104 times.
35464 if (current->rpl_sps_flag[i]) {
509
4/4
✓ Branch 0 taken 11618 times.
✓ Branch 1 taken 10 times.
✓ Branch 2 taken 5809 times.
✓ Branch 3 taken 5809 times.
23256 if (sps->sps_num_ref_pic_lists[i] > 1 &&
510
2/4
✓ Branch 0 taken 5809 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 5809 times.
23236 (i == 0 || (i == 1 && pps->pps_rpl1_idx_present_flag))) {
511 11618 uint8_t bits = av_ceil_log2(sps->sps_num_ref_pic_lists[i]);
512
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 5809 times.
11618 us(bits, rpl_idx[i], 0, sps->sps_num_ref_pic_lists[i] - 1, 1, i);
513
2/2
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 5809 times.
11638 } else if (sps->sps_num_ref_pic_lists[i] == 1) {
514
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
20 infer(rpl_idx[i], 0);
515
2/4
✓ Branch 0 taken 5809 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 5809 times.
✗ Branch 3 not taken.
11618 } else if (i == 1 && !pps->pps_rpl1_idx_present_flag) {
516
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1571 times.
11618 infer(rpl_idx[1], current->rpl_idx[0]);
517 } else {
518 //how to handle this? or never happpend?
519 av_log(ctx->log_ctx, AV_LOG_ERROR,
520 "can't infer the rpl_idx[i]\n");
521 return AVERROR_PATCHWELCOME;
522 }
523 23256 memcpy(&current->rpl_ref_list[i],
524 23256 &sps->sps_ref_pic_list_struct[i][current->rpl_idx[i]],
525 sizeof(current->rpl_ref_list[i]));
526 } else {
527
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 6104 times.
12208 CHECK(FUNC(ref_pic_list_struct) (ctx, rw, &current->rpl_ref_list[i],
528 i, sps->sps_num_ref_pic_lists[i],
529 sps));
530 }
531 35464 ref_list = &current->rpl_ref_list[i];
532
533 35464 num_ltrp_entries = 0;
534
2/2
✓ Branch 0 taken 34669 times.
✓ Branch 1 taken 17732 times.
104802 for (int k = 0; k < ref_list->num_ref_entries; k++) {
535
2/2
✓ Branch 0 taken 34409 times.
✓ Branch 1 taken 260 times.
69338 if (!ref_list->inter_layer_ref_pic_flag[k]) {
536
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 34409 times.
68818 if (!ref_list->st_ref_pic_flag[k]) {
537 num_ltrp_entries++;
538 }
539 }
540 }
541
542
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 17732 times.
35464 for (j = 0; j < num_ltrp_entries; j++) {
543 if (ref_list->ltrp_in_header_flag) {
544 ubs(sps->sps_log2_max_pic_order_cnt_lsb_minus4 + 4,
545 poc_lsb_lt[i][j], 2, i, j);
546 }
547 flags(delta_poc_msb_cycle_present_flag[i][j], 2, i, j);
548 if (current->delta_poc_msb_cycle_present_flag[i][j]) {
549 uint32_t max =
550 1 << (32 - sps->sps_log2_max_pic_order_cnt_lsb_minus4 - 4);
551 ues(delta_poc_msb_cycle_lt[i][j], 0, max, 2, i, j);
552 }
553 }
554 }
555 17732 return 0;
556 }
557
558 34 static int FUNC(general_timing_hrd_parameters)(CodedBitstreamContext *ctx,
559 RWContext *rw,
560 H266RawGeneralTimingHrdParameters *current)
561 {
562 int err;
563
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 ub(32, num_units_in_tick);
564
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 u(32, time_scale, 1, MAX_UINT_BITS(32));
565
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 flag(general_nal_hrd_params_present_flag);
566
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 flag(general_vcl_hrd_params_present_flag);
567
568
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
34 if (current->general_nal_hrd_params_present_flag ||
569 current->general_vcl_hrd_params_present_flag) {
570
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 flag(general_same_pic_timing_in_all_ols_flag);
571
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 flag(general_du_hrd_params_present_flag);
572
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
34 if (current->general_du_hrd_params_present_flag)
573 ub(8, tick_divisor_minus2);
574
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 ub(4, bit_rate_scale);
575
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 ub(4, cpb_size_scale);
576
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
34 if (current->general_du_hrd_params_present_flag)
577 ub(4, cpb_size_du_scale);
578
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 ue(hrd_cpb_cnt_minus1, 0, 31);
579 } else {
580 //infer general_same_pic_timing_in_all_ols_flag?
581 infer(general_du_hrd_params_present_flag, 0);
582 }
583 34 return 0;
584 }
585
586 340 static int FUNC(sublayer_hrd_parameters) (CodedBitstreamContext *ctx,
587 RWContext *rw,
588 H266RawSubLayerHRDParameters *current,
589 int sublayer_id,
590 const H266RawGeneralTimingHrdParameters *general)
591 {
592 int err, i;
593
2/2
✓ Branch 0 taken 170 times.
✓ Branch 1 taken 170 times.
680 for (i = 0; i <= general->hrd_cpb_cnt_minus1; i++) {
594
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 170 times.
340 ues(bit_rate_value_minus1[sublayer_id][i], 0, UINT32_MAX - 1, 2,
595 sublayer_id, i);
596
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 170 times.
340 ues(cpb_size_value_minus1[sublayer_id][i], 0, UINT32_MAX - 1, 2,
597 sublayer_id, i);
598
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 170 times.
340 if (general->general_du_hrd_params_present_flag) {
599 ues(cpb_size_du_value_minus1[sublayer_id][i],
600 0, UINT32_MAX - 1, 2, sublayer_id, i);
601 ues(bit_rate_du_value_minus1[sublayer_id][i],
602 0, UINT32_MAX - 1, 2, sublayer_id, i);
603 }
604
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 170 times.
340 flags(cbr_flag[sublayer_id][i], 2, sublayer_id, i);
605 }
606 340 return 0;
607 }
608
609 34 static int FUNC(ols_timing_hrd_parameters) (CodedBitstreamContext *ctx,
610 RWContext *rw, H266RawOlsTimingHrdParameters *current,
611 uint8_t first_sublayer, uint8_t max_sublayers_minus1,
612 const H266RawGeneralTimingHrdParameters *general)
613 {
614 int err, i;
615
2/2
✓ Branch 0 taken 85 times.
✓ Branch 1 taken 17 times.
204 for (i = first_sublayer; i <= max_sublayers_minus1; i++) {
616
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 85 times.
170 flags(fixed_pic_rate_general_flag[i], 1, i);
617
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 85 times.
170 if (!current->fixed_pic_rate_general_flag[i])
618 flags(fixed_pic_rate_within_cvs_flag[i], 1, i);
619 else
620
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 15 times.
170 infer(fixed_pic_rate_within_cvs_flag[i], 1);
621
1/2
✓ Branch 0 taken 85 times.
✗ Branch 1 not taken.
170 if (current->fixed_pic_rate_within_cvs_flag[i]) {
622
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 85 times.
170 ues(elemental_duration_in_tc_minus1[i], 0, 2047, 1, i);
623
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 15 times.
170 infer(low_delay_hrd_flag[i], 0);
624 } else if ((general->general_nal_hrd_params_present_flag ||
625 general->general_vcl_hrd_params_present_flag) &&
626 general->hrd_cpb_cnt_minus1 == 0) {
627 flags(low_delay_hrd_flag[i], 1, i);
628 } else {
629 infer(low_delay_hrd_flag[i], 0);
630 }
631
1/2
✓ Branch 0 taken 85 times.
✗ Branch 1 not taken.
170 if (general->general_nal_hrd_params_present_flag)
632
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 85 times.
170 CHECK(FUNC(sublayer_hrd_parameters) (ctx, rw,
633 &current->nal_sub_layer_hrd_parameters,
634 i, general));
635
1/2
✓ Branch 0 taken 85 times.
✗ Branch 1 not taken.
170 if (general->general_vcl_hrd_params_present_flag)
636
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 85 times.
170 CHECK(FUNC(sublayer_hrd_parameters) (ctx, rw,
637 &current->nal_sub_layer_hrd_parameters,
638 i, general));
639 }
640 34 return 0;
641 }
642
643 10 static int FUNC(opi)(CodedBitstreamContext *ctx, RWContext *rw,
644 H266RawOPI *current)
645 {
646 int err;
647
648 10 HEADER("Operating point information");
649
650
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
10 CHECK(FUNC(nal_unit_header)(ctx, rw,
651 &current->nal_unit_header, VVC_OPI_NUT));
652
653
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
10 flag(opi_ols_info_present_flag);
654
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
10 flag(opi_htid_info_present_flag);
655
656
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
10 if(current->opi_ols_info_present_flag)
657 ue(opi_ols_idx, 0, VVC_MAX_TOTAL_NUM_OLSS - 1);
658
659
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
10 if(current->opi_htid_info_present_flag)
660 ub(3, opi_htid_plus1);
661
662
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
10 flag(opi_extension_flag);
663
1/2
✓ Branch 0 taken 5 times.
✗ Branch 1 not taken.
10 if (current->opi_extension_flag)
664
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
10 CHECK(FUNC(extension_data) (ctx, rw, &current->extension_data));
665
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
10 CHECK(FUNC(rbsp_trailing_bits) (ctx, rw));
666
667 10 return 0;
668 }
669
670 10 static int FUNC(dci)(CodedBitstreamContext *ctx, RWContext *rw,
671 H266RawDCI *current)
672 {
673 int err, i;
674
675 10 HEADER("Decoding capability information");
676
677
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
10 CHECK(FUNC(nal_unit_header)(ctx, rw,
678 &current->nal_unit_header, VVC_DCI_NUT));
679
680
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
10 ub(4, dci_reserved_zero_4bits);
681
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
10 ub(4, dci_num_ptls_minus1);
682
2/2
✓ Branch 0 taken 5 times.
✓ Branch 1 taken 5 times.
20 for (i = 0; i <= current->dci_num_ptls_minus1; i++)
683
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
10 CHECK(FUNC(profile_tier_level)(ctx, rw,
684 current->dci_profile_tier_level + i, 1, 0));
685
686
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
10 flag(dci_extension_flag);
687
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
10 if (current->dci_extension_flag)
688 CHECK(FUNC(extension_data)(ctx, rw, &current->extension_data));
689
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
10 CHECK(FUNC(rbsp_trailing_bits)(ctx, rw));
690
691 10 return 0;
692 }
693
694 48 static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw,
695 H266RawVPS *current)
696 {
697 int err, i, j, k;
698 48 uint16_t total_num_olss = 0;
699 48 uint8_t ols_mode_idc = 0;
700 48 uint16_t num_multi_layer_olss = 0;
701 uint8_t layer_included_in_ols_flag[VVC_MAX_TOTAL_NUM_OLSS][VVC_MAX_LAYERS];
702 uint8_t num_ref_layers[VVC_MAX_LAYERS];
703 uint8_t reference_layer_idx[VVC_MAX_LAYERS][VVC_MAX_LAYERS];
704
705 48 HEADER("Video Parameter Set");
706
707
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 CHECK(FUNC(nal_unit_header) (ctx, rw,
708 &current->nal_unit_header, VVC_VPS_NUT));
709
710
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 u(4, vps_video_parameter_set_id, 1, VVC_MAX_VPS_COUNT - 1);
711
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 ub(6, vps_max_layers_minus1);
712
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 u(3, vps_max_sublayers_minus1, 0, 6);
713
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
48 if (current->vps_max_layers_minus1 > 0
714
2/2
✓ Branch 0 taken 12 times.
✓ Branch 1 taken 12 times.
48 && current->vps_max_sublayers_minus1 > 0)
715
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
24 flag(vps_default_ptl_dpb_hrd_max_tid_flag);
716 else
717
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
24 infer(vps_default_ptl_dpb_hrd_max_tid_flag, 1);
718
719
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
48 if (current->vps_max_layers_minus1 > 0)
720
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 flag(vps_all_independent_layers_flag);
721 else
722 infer(vps_all_independent_layers_flag, 1);
723
724
2/2
✓ Branch 0 taken 48 times.
✓ Branch 1 taken 24 times.
144 for (i = 0; i <= current->vps_max_layers_minus1; i++) {
725
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 48 times.
96 ubs(6, vps_layer_id[i], 1, i);
726
3/4
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 24 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 24 times.
96 if (i > 0 && current->vps_layer_id[i] <= current->vps_layer_id[i - 1]) {
727 av_log(ctx->log_ctx, AV_LOG_ERROR,
728 "vps_layer_id[%d](%d) should > vps_layer_id[%d](%d).\n",
729 i, current->vps_layer_id[i], i - 1,
730 current->vps_layer_id[i - 1]);
731 return AVERROR_INVALIDDATA;
732 }
733
3/4
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 24 times.
✓ Branch 2 taken 24 times.
✗ Branch 3 not taken.
96 if (i > 0 && !current->vps_all_independent_layers_flag) {
734
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 flags(vps_independent_layer_flag[i], 1, i);
735
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
48 if (!current->vps_independent_layer_flag[i]) {
736
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 flags(vps_max_tid_ref_present_flag[i], 1, i);
737
2/2
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 24 times.
96 for (j = 0; j < i; j++) {
738
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 flags(vps_direct_ref_layer_flag[i][j], 2, i, j);
739
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
48 if (current->vps_max_tid_ref_present_flag[i] &&
740 current->vps_direct_ref_layer_flag[i][j]) {
741 ubs(3, vps_max_tid_il_ref_pics_plus1[i][j], 2, i, j);
742 } else {
743
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
48 infer(vps_max_tid_il_ref_pics_plus1[i][j],
744 current->vps_max_sublayers_minus1 + 1);
745 }
746 }
747 } else {
748 for (j = 0; j < i; j++) {
749 infer(vps_direct_ref_layer_flag[i][j], 0);
750 }
751 }
752 } else {
753
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
48 infer(vps_independent_layer_flag[i], 1);
754
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
48 for (j = 0; j < i; j++) {
755 infer(vps_direct_ref_layer_flag[i][j], 0);
756 }
757 }
758 }
759
760
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
48 if (current->vps_max_layers_minus1 > 0) {
761
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
48 if (current->vps_all_independent_layers_flag)
762 flag(vps_each_layer_is_an_ols_flag);
763 else
764
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
48 infer(vps_each_layer_is_an_ols_flag, 0);
765
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
48 if (!current->vps_each_layer_is_an_ols_flag) {
766
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
48 if (!current->vps_all_independent_layers_flag)
767
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 ub(2, vps_ols_mode_idc);
768 else
769 infer(vps_ols_mode_idc, 2);
770
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
48 if (current->vps_ols_mode_idc == 2) {
771
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 ub(8, vps_num_output_layer_sets_minus2);
772
2/2
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 24 times.
96 for (i = 1; i <= current->vps_num_output_layer_sets_minus2 + 1;
773 48 i++)
774
2/2
✓ Branch 0 taken 48 times.
✓ Branch 1 taken 24 times.
144 for (j = 0; j <= current->vps_max_layers_minus1; j++)
775
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 48 times.
96 flags(vps_ols_output_layer_flag[i][j], 2, i, j);
776 }
777 48 ols_mode_idc = current->vps_ols_mode_idc;
778 } else {
779 ols_mode_idc = 4;
780 }
781
3/6
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 24 times.
48 if (ols_mode_idc == 4 || ols_mode_idc == 0 || ols_mode_idc == 1)
782 total_num_olss = current->vps_max_layers_minus1 + 1;
783
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
48 else if (ols_mode_idc == 2)
784 48 total_num_olss = current->vps_num_output_layer_sets_minus2 + 2;
785 else
786 av_log(ctx->log_ctx, AV_LOG_ERROR,
787 "ols_mode_idc == 3, patch welcome");
788
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 u(8, vps_num_ptls_minus1, 0, total_num_olss - 1);
789 } else {
790 infer(vps_each_layer_is_an_ols_flag, 1);
791 infer(vps_num_ptls_minus1, 0);
792 }
793 {
794 //calc NumMultiLayerOlss
795 int m;
796 uint8_t dependency_flag[VVC_MAX_LAYERS][VVC_MAX_LAYERS];
797 uint16_t num_output_layers_in_ols[VVC_MAX_TOTAL_NUM_OLSS];
798 uint8_t num_sub_layers_in_layer_in_ols[VVC_MAX_TOTAL_NUM_OLSS][VVC_MAX_TOTAL_NUM_OLSS];
799 uint8_t output_layer_idx[VVC_MAX_TOTAL_NUM_OLSS][VVC_MAX_LAYERS];
800
801 //7.4.3.3 vps_direct_ref_layer_flag section
802
2/2
✓ Branch 0 taken 48 times.
✓ Branch 1 taken 24 times.
144 for (i = 0; i <= current->vps_max_layers_minus1; i++) {
803
2/2
✓ Branch 0 taken 96 times.
✓ Branch 1 taken 48 times.
288 for (j = 0; j <= current->vps_max_layers_minus1; j++) {
804 192 dependency_flag[i][j] = current->vps_direct_ref_layer_flag[i][j];
805
2/2
✓ Branch 0 taken 48 times.
✓ Branch 1 taken 96 times.
288 for (k = 0; k < i; k++) {
806
1/2
✓ Branch 0 taken 48 times.
✗ Branch 1 not taken.
96 if (current->vps_direct_ref_layer_flag[i][k] &&
807
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 48 times.
96 dependency_flag[k][j])
808 dependency_flag[i][j] = 1;
809 }
810 }
811 }
812
2/2
✓ Branch 0 taken 48 times.
✓ Branch 1 taken 24 times.
144 for (i = 0; i <= current->vps_max_layers_minus1; i++) {
813 int r;
814
2/2
✓ Branch 0 taken 96 times.
✓ Branch 1 taken 48 times.
288 for (j = 0, r = 0; j <= current->vps_max_layers_minus1; j++) {
815
2/2
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 72 times.
192 if (dependency_flag[i][j])
816 48 reference_layer_idx[i][r++] = j;
817 }
818 96 num_ref_layers[i] = r;
819 }
820
821 //7.4.3.3 vps_ols_output_layer_flag section
822 48 num_output_layers_in_ols[0] = 1;
823 48 num_sub_layers_in_layer_in_ols[0][0] =
824 48 current->vps_ptl_max_tid[current->vps_ols_ptl_idx[0]] + 1;
825
2/2
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 24 times.
96 for (i = 1; i < total_num_olss; i++) {
826
2/4
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 24 times.
48 if (ols_mode_idc == 4 || ols_mode_idc == 0) {
827 num_output_layers_in_ols[i] = 1;
828 if (current->vps_each_layer_is_an_ols_flag) {
829 num_sub_layers_in_layer_in_ols[i][0] =
830 current->vps_ptl_max_tid[current->vps_ols_ptl_idx[i]] + 1;
831 } else {
832 num_sub_layers_in_layer_in_ols[i][i] =
833 current->vps_ptl_max_tid[current->vps_ols_ptl_idx[i]] + 1;
834 for (k = i - 1; k >= 0; k--) {
835 num_sub_layers_in_layer_in_ols[i][k] = 0;
836 for (m = k + 1; m <= i; m++) {
837 uint8_t max_sublayer_needed =
838 FFMIN(num_sub_layers_in_layer_in_ols[i][m],
839 current->vps_max_tid_il_ref_pics_plus1[m][k]);
840 if (current->vps_direct_ref_layer_flag[m][k] &&
841 num_sub_layers_in_layer_in_ols[i][k] < max_sublayer_needed)
842 num_sub_layers_in_layer_in_ols[i][k] = max_sublayer_needed;
843 }
844 }
845 }
846
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
48 } else if (current->vps_ols_mode_idc == 1) {
847 num_output_layers_in_ols[i] = i + 1;
848 for (j = 0; j < num_output_layers_in_ols[i]; j++) {
849 num_sub_layers_in_layer_in_ols[i][j] =
850 current->vps_ptl_max_tid[current->vps_ols_ptl_idx[i]] + 1;
851 }
852
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
48 } else if (current->vps_ols_mode_idc == 2) {
853 48 uint8_t highest_included_layer = 0;
854
2/2
✓ Branch 0 taken 48 times.
✓ Branch 1 taken 24 times.
144 for (j = 0; j <= current->vps_max_layers_minus1; j++) {
855 96 layer_included_in_ols_flag[i][j] = 0;
856 96 num_sub_layers_in_layer_in_ols[i][j] = 0;
857 }
858
2/2
✓ Branch 0 taken 48 times.
✓ Branch 1 taken 24 times.
144 for (k = 0, j = 0; k <= current->vps_max_layers_minus1; k++) {
859
1/2
✓ Branch 0 taken 48 times.
✗ Branch 1 not taken.
96 if (current->vps_ols_output_layer_flag[i][k]) {
860 96 layer_included_in_ols_flag[i][k] = 1;
861 96 highest_included_layer = k;
862 96 output_layer_idx[i][j] = k;
863 96 num_sub_layers_in_layer_in_ols[i][k] =
864 96 current->vps_ptl_max_tid[current->
865 96 vps_ols_ptl_idx[i]] + 1;
866 96 j++;
867 }
868 }
869 48 num_output_layers_in_ols[i] = j;
870
2/2
✓ Branch 0 taken 48 times.
✓ Branch 1 taken 24 times.
144 for (j = 0; j < num_output_layers_in_ols[i]; j++) {
871 96 int idx = output_layer_idx[i][j];
872
2/2
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 48 times.
144 for (k = 0; k < num_ref_layers[idx]; k++) {
873
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
48 if (!layer_included_in_ols_flag[i][reference_layer_idx[idx][k]])
874 layer_included_in_ols_flag[i][reference_layer_idx[idx][k]] = 1;
875 }
876 }
877
2/2
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 24 times.
96 for (k = highest_included_layer - 1; k >= 0; k--) {
878
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
48 if (layer_included_in_ols_flag[i][k] &&
879
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
48 !current->vps_ols_output_layer_flag[i][k]) {
880 for (m = k + 1; m <= highest_included_layer; m++) {
881 uint8_t max_sublayer_needed =
882 FFMIN(num_sub_layers_in_layer_in_ols[i][m],
883 current->vps_max_tid_il_ref_pics_plus1[m][k]);
884 if (current->vps_direct_ref_layer_flag[m][k] &&
885 layer_included_in_ols_flag[i][m] &&
886 num_sub_layers_in_layer_in_ols[i][k] <
887 max_sublayer_needed)
888 num_sub_layers_in_layer_in_ols[i][k] =
889 max_sublayer_needed;
890 }
891 }
892 }
893 }
894
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
48 if (!num_output_layers_in_ols[i])
895 return AVERROR_INVALIDDATA;
896 }
897
2/2
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 24 times.
96 for (i = 1; i < total_num_olss; i++) {
898 48 int num_layers_in_ols = 0;
899
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
48 if (current->vps_each_layer_is_an_ols_flag) {
900 num_layers_in_ols = 1;
901
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
48 } else if (current->vps_ols_mode_idc == 0 ||
902
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
48 current->vps_ols_mode_idc == 1) {
903 num_layers_in_ols = i + 1;
904
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
48 } else if (current->vps_ols_mode_idc == 2) {
905
2/2
✓ Branch 0 taken 48 times.
✓ Branch 1 taken 24 times.
144 for (k = 0, j = 0; k <= current->vps_max_layers_minus1; k++)
906
1/2
✓ Branch 0 taken 48 times.
✗ Branch 1 not taken.
96 if (layer_included_in_ols_flag[i][k])
907 96 j++;
908 48 num_layers_in_ols = j;
909 }
910
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
48 if (num_layers_in_ols > 1) {
911 48 num_multi_layer_olss++;
912 }
913 }
914
2/4
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 24 times.
48 if (!current->vps_each_layer_is_an_ols_flag && num_multi_layer_olss == 0)
915 return AVERROR_INVALIDDATA;
916 }
917
918
2/2
✓ Branch 0 taken 48 times.
✓ Branch 1 taken 24 times.
144 for (i = 0; i <= current->vps_num_ptls_minus1; i++) {
919
2/2
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 24 times.
96 if (i > 0)
920
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 flags(vps_pt_present_flag[i], 1, i);
921 else
922
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
48 infer(vps_pt_present_flag[i], 1);
923
924
2/2
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 24 times.
96 if (!current->vps_default_ptl_dpb_hrd_max_tid_flag)
925
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 us(3, vps_ptl_max_tid[i], 0, current->vps_max_sublayers_minus1, 1, i);
926 else
927
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
48 infer(vps_ptl_max_tid[i], current->vps_max_sublayers_minus1);
928 }
929
2/2
✓ Branch 1 taken 156 times.
✓ Branch 2 taken 24 times.
360 while (byte_alignment(rw) != 0)
930
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 156 times.
312 fixed(1, vps_ptl_alignment_zero_bit, 0);
931
2/2
✓ Branch 0 taken 48 times.
✓ Branch 1 taken 24 times.
144 for (i = 0; i <= current->vps_num_ptls_minus1; i++) {
932
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 48 times.
96 CHECK(FUNC(profile_tier_level) (ctx, rw,
933 current->vps_profile_tier_level + i,
934 current->vps_pt_present_flag[i],
935 current->vps_ptl_max_tid[i]));
936 }
937
2/2
✓ Branch 0 taken 48 times.
✓ Branch 1 taken 24 times.
144 for (i = 0; i < total_num_olss; i++) {
938
1/2
✓ Branch 0 taken 48 times.
✗ Branch 1 not taken.
96 if (current->vps_num_ptls_minus1 > 0 &&
939
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 48 times.
96 current->vps_num_ptls_minus1 + 1 != total_num_olss) {
940 us(8, vps_ols_ptl_idx[i], 0, current->vps_num_ptls_minus1, 1, i);
941
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 48 times.
96 } else if (current->vps_num_ptls_minus1 == 0) {
942 infer(vps_ols_ptl_idx[i], 0);
943 } else {
944
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
96 infer(vps_ols_ptl_idx[i], i);
945 }
946 }
947
948
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
48 if (!current->vps_each_layer_is_an_ols_flag) {
949 uint16_t vps_num_dpb_params;
950
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 ue(vps_num_dpb_params_minus1, 0, num_multi_layer_olss - 1);
951
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
48 if (current->vps_each_layer_is_an_ols_flag)
952 vps_num_dpb_params = 0;
953 else
954 48 vps_num_dpb_params = current->vps_num_dpb_params_minus1 + 1;
955
956
2/2
✓ Branch 0 taken 12 times.
✓ Branch 1 taken 12 times.
48 if (current->vps_max_sublayers_minus1 > 0)
957
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
24 flag(vps_sublayer_dpb_params_present_flag);
958 else
959
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
24 infer(vps_sublayer_dpb_params_present_flag, 0);
960
961
2/2
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 24 times.
96 for (i = 0; i < vps_num_dpb_params; i++) {
962
2/2
✓ Branch 0 taken 12 times.
✓ Branch 1 taken 12 times.
48 if (!current->vps_default_ptl_dpb_hrd_max_tid_flag)
963
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
24 us(3, vps_dpb_max_tid[i], 0, current->vps_max_sublayers_minus1,
964 1, i);
965 else
966
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
24 infer(vps_dpb_max_tid[i], current->vps_max_sublayers_minus1);
967
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 CHECK(FUNC(dpb_parameters) (ctx, rw, current->vps_dpb_params + i,
968 current->vps_dpb_max_tid[i],
969 current->
970 vps_sublayer_dpb_params_present_flag));
971 }
972
2/2
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 24 times.
96 for (i = 0; i < num_multi_layer_olss; i++) {
973
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 ues(vps_ols_dpb_pic_width[i], 0, UINT16_MAX, 1, i);
974
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 ues(vps_ols_dpb_pic_height[i], 0, UINT16_MAX, 1, i);
975
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 ubs(2, vps_ols_dpb_chroma_format[i], 1, i);
976
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 ues(vps_ols_dpb_bitdepth_minus8[i], 0, 8, 1, i);
977
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
48 if (vps_num_dpb_params > 1
978 && vps_num_dpb_params != num_multi_layer_olss)
979 ues(vps_ols_dpb_params_idx[i], 0, vps_num_dpb_params - 1, 1, i);
980
1/2
✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
48 else if (vps_num_dpb_params == 1)
981
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
48 infer(vps_ols_dpb_params_idx[i], 0);
982 else
983 infer(vps_ols_dpb_params_idx[i], i);
984 }
985
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 flag(vps_timing_hrd_params_present_flag);
986
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
48 if (current->vps_timing_hrd_params_present_flag) {
987 CHECK(FUNC(general_timing_hrd_parameters) (ctx, rw,
988 &current->
989 vps_general_timing_hrd_parameters));
990 if (current->vps_max_sublayers_minus1 > 0)
991 flag(vps_sublayer_cpb_params_present_flag);
992 else
993 infer(vps_sublayer_cpb_params_present_flag, 0);
994 ue(vps_num_ols_timing_hrd_params_minus1, 0,
995 num_multi_layer_olss - 1);
996 for (i = 0; i <= current->vps_num_ols_timing_hrd_params_minus1; i++) {
997 uint8_t first_sublayer;
998 if (!current->vps_default_ptl_dpb_hrd_max_tid_flag)
999 us(3, vps_hrd_max_tid[i], 0,
1000 current->vps_max_sublayers_minus1, 1, i);
1001 else
1002 infer(vps_hrd_max_tid[i],
1003 current->vps_max_sublayers_minus1);
1004 first_sublayer = current->vps_sublayer_cpb_params_present_flag ?
1005 0 : current->vps_hrd_max_tid[i];
1006 CHECK(FUNC(ols_timing_hrd_parameters)
1007 (ctx, rw, &current->vps_ols_timing_hrd_parameters,
1008 first_sublayer, current->vps_max_sublayers_minus1,
1009 &current->vps_general_timing_hrd_parameters));
1010
1011 }
1012 if (current->vps_num_ols_timing_hrd_params_minus1 > 0 &&
1013 current->vps_num_ols_timing_hrd_params_minus1 + 1 !=
1014 num_multi_layer_olss) {
1015 for (i = 0; i < num_multi_layer_olss; i++) {
1016 ues(vps_ols_timing_hrd_idx[i], 0,
1017 current->vps_num_ols_timing_hrd_params_minus1, 1, i);
1018 }
1019 } else if (current->vps_num_ols_timing_hrd_params_minus1 == 0) {
1020 for (i = 0; i < num_multi_layer_olss; i++)
1021 infer(vps_ols_timing_hrd_idx[i], 0);
1022 } else {
1023 for (i = 0; i < num_multi_layer_olss; i++)
1024 infer(vps_ols_timing_hrd_idx[i], i);
1025 }
1026 }
1027 }
1028
1029
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 flag(vps_extension_flag);
1030
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
48 if (current->vps_extension_flag)
1031 CHECK(FUNC(extension_data) (ctx, rw, &current->extension_data));
1032
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 24 times.
48 CHECK(FUNC(rbsp_trailing_bits) (ctx, rw));
1033
1034 48 return 0;
1035 }
1036
1037 static int FUNC(sps_range_extension)(CodedBitstreamContext *ctx, RWContext *rw,
1038 H266RawSPS *current)
1039 {
1040 int err;
1041
1042 flag(sps_extended_precision_flag);
1043 if (current->sps_transform_skip_enabled_flag)
1044 flag(sps_ts_residual_coding_rice_present_in_sh_flag);
1045 else
1046 infer(sps_ts_residual_coding_rice_present_in_sh_flag, 0);
1047 flag(sps_rrc_rice_extension_flag);
1048 flag(sps_persistent_rice_adaptation_enabled_flag);
1049 flag(sps_reverse_last_sig_coeff_enabled_flag);
1050
1051 return 0;
1052 }
1053
1054 2432 static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
1055 H266RawSPS *current)
1056 {
1057 2432 CodedBitstreamH266Context *h266 = ctx->priv_data;
1058 int err, i, j;
1059 unsigned int ctb_log2_size_y, min_cb_log2_size_y,
1060 min_qt_log2_size_intra_y, min_qt_log2_size_inter_y,
1061 ctb_size_y, max_num_merge_cand, tmp_width_val, tmp_height_val;
1062 uint8_t qp_bd_offset;
1063
1064 static const uint8_t h266_sub_width_c[] = {
1065 1, 2, 2, 1
1066 };
1067 static const uint8_t h266_sub_height_c[] = {
1068 1, 2, 1, 1
1069 };
1070
1071 2432 HEADER("Sequence Parameter Set");
1072
1073
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 CHECK(FUNC(nal_unit_header) (ctx, rw,
1074 &current->nal_unit_header, VVC_SPS_NUT));
1075
1076
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 ub(4, sps_seq_parameter_set_id);
1077
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 ub(4, sps_video_parameter_set_id);
1078
4/4
✓ Branch 0 taken 1182 times.
✓ Branch 1 taken 34 times.
✓ Branch 2 taken 165 times.
✓ Branch 3 taken 1017 times.
2432 if (current->sps_video_parameter_set_id == 0 && !h266->vps[0]) {
1079 330 H266RawVPS *vps = ff_refstruct_allocz(sizeof(*vps));
1080
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 165 times.
330 if (!vps)
1081 return AVERROR(ENOMEM);
1082 330 vps->vps_max_layers_minus1 = 0;
1083 330 vps->vps_independent_layer_flag[0] = 1;
1084 330 vps->vps_layer_id[0] = current->nal_unit_header.nuh_layer_id;
1085 330 h266->vps[0] = vps;
1086 }
1087
1088
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 u(3, sps_max_sublayers_minus1, 0, VVC_MAX_SUBLAYERS - 1);
1089
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 u(2, sps_chroma_format_idc, 0, 3);
1090
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 u(2, sps_log2_ctu_size_minus5, 0, 3);
1091 2432 ctb_log2_size_y = current->sps_log2_ctu_size_minus5 + 5;
1092 2432 ctb_size_y = 1 << ctb_log2_size_y;
1093
1094
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_ptl_dpb_hrd_params_present_flag);
1095
1/2
✓ Branch 0 taken 1216 times.
✗ Branch 1 not taken.
2432 if (current->sps_ptl_dpb_hrd_params_present_flag) {
1096
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 CHECK(FUNC(profile_tier_level) (ctx, rw, &current->profile_tier_level,
1097 1, current->sps_max_sublayers_minus1));
1098 }
1099
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_gdr_enabled_flag);
1100
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_ref_pic_resampling_enabled_flag);
1101
1/2
✓ Branch 0 taken 1216 times.
✗ Branch 1 not taken.
2432 if (current->sps_ref_pic_resampling_enabled_flag)
1102
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_res_change_in_clvs_allowed_flag);
1103 else
1104 infer(sps_res_change_in_clvs_allowed_flag, 0);
1105
1106
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 ue(sps_pic_width_max_in_luma_samples, 1, VVC_MAX_WIDTH);
1107
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 ue(sps_pic_height_max_in_luma_samples, 1, VVC_MAX_HEIGHT);
1108
1109
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_conformance_window_flag);
1110
2/2
✓ Branch 0 taken 17 times.
✓ Branch 1 taken 1199 times.
2432 if (current->sps_conformance_window_flag) {
1111 34 uint8_t sub_width_c = h266_sub_width_c[current->sps_chroma_format_idc];
1112 34 uint8_t sub_height_c = h266_sub_height_c[current->sps_chroma_format_idc];
1113 34 uint16_t width = current->sps_pic_width_max_in_luma_samples / sub_width_c;
1114 34 uint16_t height = current->sps_pic_height_max_in_luma_samples / sub_height_c;
1115
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 ue(sps_conf_win_left_offset, 0, width);
1116
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 ue(sps_conf_win_right_offset, 0, width - current->sps_conf_win_left_offset);
1117
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 ue(sps_conf_win_top_offset, 0, height);
1118
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 ue(sps_conf_win_bottom_offset, 0, height - current->sps_conf_win_top_offset);
1119 } else {
1120
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(sps_conf_win_left_offset, 0);
1121
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(sps_conf_win_right_offset, 0);
1122
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(sps_conf_win_top_offset, 0);
1123
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 332 times.
2398 infer(sps_conf_win_bottom_offset, 0);
1124 }
1125
1126 2432 tmp_width_val = AV_CEIL_RSHIFT(current->sps_pic_width_max_in_luma_samples,
1127 ctb_log2_size_y);
1128 2432 tmp_height_val = AV_CEIL_RSHIFT(current->sps_pic_height_max_in_luma_samples,
1129 ctb_log2_size_y);
1130
1131
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_subpic_info_present_flag);
1132
2/2
✓ Branch 0 taken 27 times.
✓ Branch 1 taken 1189 times.
2432 if (current->sps_subpic_info_present_flag) {
1133
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 27 times.
54 ue(sps_num_subpics_minus1, 1, VVC_MAX_SLICES - 1);
1134
1/2
✓ Branch 0 taken 27 times.
✗ Branch 1 not taken.
54 if (current->sps_num_subpics_minus1 > 0) {
1135
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 27 times.
54 flag(sps_independent_subpics_flag);
1136
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 27 times.
54 flag(sps_subpic_same_size_flag);
1137 }
1138
1139
1/2
✓ Branch 0 taken 27 times.
✗ Branch 1 not taken.
54 if (current->sps_num_subpics_minus1 > 0) {
1140 54 int wlen = av_ceil_log2(tmp_width_val);
1141 54 int hlen = av_ceil_log2(tmp_height_val);
1142
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
54 infer(sps_subpic_ctu_top_left_x[0], 0);
1143
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
54 infer(sps_subpic_ctu_top_left_y[0], 0);
1144
1/2
✓ Branch 0 taken 27 times.
✗ Branch 1 not taken.
54 if (current->sps_pic_width_max_in_luma_samples > ctb_size_y)
1145
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 27 times.
54 ubs(wlen, sps_subpic_width_minus1[0], 1, 0);
1146 else
1147 infer(sps_subpic_width_minus1[0], tmp_width_val - 1);
1148
1/2
✓ Branch 0 taken 27 times.
✗ Branch 1 not taken.
54 if (current->sps_pic_height_max_in_luma_samples > ctb_size_y)
1149
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 27 times.
54 ubs(hlen, sps_subpic_height_minus1[0], 1, 0);
1150 else
1151 infer(sps_subpic_height_minus1[0], tmp_height_val - 1);
1152
1/2
✓ Branch 0 taken 27 times.
✗ Branch 1 not taken.
54 if (!current->sps_independent_subpics_flag) {
1153
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 27 times.
54 flags(sps_subpic_treated_as_pic_flag[0], 1, 0);
1154
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 27 times.
54 flags(sps_loop_filter_across_subpic_enabled_flag[0], 1, 0);
1155 } else {
1156 infer(sps_subpic_treated_as_pic_flag[0], 1);
1157 infer(sps_loop_filter_across_subpic_enabled_flag[0], 1);
1158 }
1159
2/2
✓ Branch 0 taken 108 times.
✓ Branch 1 taken 27 times.
270 for (i = 1; i <= current->sps_num_subpics_minus1; i++) {
1160
1/2
✓ Branch 0 taken 108 times.
✗ Branch 1 not taken.
216 if (!current->sps_subpic_same_size_flag) {
1161
1/2
✓ Branch 0 taken 108 times.
✗ Branch 1 not taken.
216 if (current->sps_pic_width_max_in_luma_samples > ctb_size_y)
1162
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 108 times.
216 ubs(wlen, sps_subpic_ctu_top_left_x[i], 1, i);
1163 else
1164 infer(sps_subpic_ctu_top_left_x[i], 0);
1165
1/2
✓ Branch 0 taken 108 times.
✗ Branch 1 not taken.
216 if (current->sps_pic_height_max_in_luma_samples >
1166 ctb_size_y)
1167
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 108 times.
216 ubs(hlen, sps_subpic_ctu_top_left_y[i], 1, i);
1168 else
1169 infer(sps_subpic_ctu_top_left_y[i], 0);
1170
2/2
✓ Branch 0 taken 81 times.
✓ Branch 1 taken 27 times.
216 if (i < current->sps_num_subpics_minus1 &&
1171
1/2
✓ Branch 0 taken 81 times.
✗ Branch 1 not taken.
162 current->sps_pic_width_max_in_luma_samples >
1172 ctb_size_y) {
1173
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 81 times.
162 ubs(wlen, sps_subpic_width_minus1[i], 1, i);
1174 } else {
1175
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
54 infer(sps_subpic_width_minus1[i],
1176 tmp_width_val -
1177 current->sps_subpic_ctu_top_left_x[i] - 1);
1178 }
1179
2/2
✓ Branch 0 taken 81 times.
✓ Branch 1 taken 27 times.
216 if (i < current->sps_num_subpics_minus1 &&
1180
1/2
✓ Branch 0 taken 81 times.
✗ Branch 1 not taken.
162 current->sps_pic_height_max_in_luma_samples >
1181 ctb_size_y) {
1182
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 81 times.
162 ubs(hlen, sps_subpic_height_minus1[i], 1, i);
1183 } else {
1184
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
54 infer(sps_subpic_height_minus1[i],
1185 tmp_height_val -
1186 current->sps_subpic_ctu_top_left_y[i] - 1);
1187 }
1188 } else {
1189 int num_subpic_cols = tmp_width_val /
1190 (current->sps_subpic_width_minus1[0] + 1);
1191 if (tmp_width_val % (current->sps_subpic_width_minus1[0] + 1) ||
1192 tmp_height_val % (current->sps_subpic_width_minus1[0] + 1) ||
1193 current->sps_num_subpics_minus1 !=
1194 (num_subpic_cols * tmp_height_val /
1195 (current->sps_subpic_height_minus1[0] + 1) - 1))
1196 return AVERROR_INVALIDDATA;
1197 infer(sps_subpic_ctu_top_left_x[i],
1198 (i % num_subpic_cols) *
1199 (current->sps_subpic_width_minus1[0] + 1));
1200 infer(sps_subpic_ctu_top_left_y[i],
1201 (i / num_subpic_cols) *
1202 (current->sps_subpic_height_minus1[0] + 1));
1203 infer(sps_subpic_width_minus1[i],
1204 current->sps_subpic_width_minus1[0]);
1205 infer(sps_subpic_height_minus1[i],
1206 current->sps_subpic_height_minus1[0]);
1207 }
1208
1/2
✓ Branch 0 taken 108 times.
✗ Branch 1 not taken.
216 if (!current->sps_independent_subpics_flag) {
1209
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 108 times.
216 flags(sps_subpic_treated_as_pic_flag[i], 1, i);
1210
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 108 times.
216 flags(sps_loop_filter_across_subpic_enabled_flag[i], 1, i);
1211 } else {
1212 infer(sps_subpic_treated_as_pic_flag[i], 1);
1213 infer(sps_loop_filter_across_subpic_enabled_flag[i], 0);
1214 }
1215 }
1216
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 27 times.
54 ue(sps_subpic_id_len_minus1, 0, 15);
1217 54 if ((1 << (current->sps_subpic_id_len_minus1 + 1)) <
1218
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 27 times.
54 current->sps_num_subpics_minus1 + 1) {
1219 av_log(ctx->log_ctx, AV_LOG_ERROR,
1220 "sps_subpic_id_len_minus1(%d) is too small\n",
1221 current->sps_subpic_id_len_minus1);
1222 return AVERROR_INVALIDDATA;
1223 }
1224
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 27 times.
54 flag(sps_subpic_id_mapping_explicitly_signalled_flag);
1225
1/2
✓ Branch 0 taken 27 times.
✗ Branch 1 not taken.
54 if (current->sps_subpic_id_mapping_explicitly_signalled_flag) {
1226
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 27 times.
54 flag(sps_subpic_id_mapping_present_flag);
1227
2/2
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 17 times.
54 if (current->sps_subpic_id_mapping_present_flag) {
1228
2/2
✓ Branch 0 taken 50 times.
✓ Branch 1 taken 10 times.
120 for (i = 0; i <= current->sps_num_subpics_minus1; i++) {
1229
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 50 times.
100 ubs(current->sps_subpic_id_len_minus1 + 1,
1230 sps_subpic_id[i], 1, i);
1231 }
1232 }
1233 }
1234 } else {
1235 infer(sps_subpic_ctu_top_left_x[0], 0);
1236 infer(sps_subpic_ctu_top_left_y[0], 0);
1237 infer(sps_subpic_width_minus1[0], tmp_width_val - 1);
1238 infer(sps_subpic_height_minus1[0], tmp_height_val - 1);
1239 }
1240 } else {
1241
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 330 times.
2378 infer(sps_num_subpics_minus1, 0);
1242
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 330 times.
2378 infer(sps_independent_subpics_flag, 1);
1243
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 330 times.
2378 infer(sps_subpic_same_size_flag, 0);
1244
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 330 times.
2378 infer(sps_subpic_id_mapping_explicitly_signalled_flag, 0);
1245
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 330 times.
2378 infer(sps_subpic_ctu_top_left_x[0], 0);
1246
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 330 times.
2378 infer(sps_subpic_ctu_top_left_y[0], 0);
1247
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 330 times.
2378 infer(sps_subpic_width_minus1[0], tmp_width_val - 1);
1248
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 330 times.
2378 infer(sps_subpic_height_minus1[0], tmp_height_val - 1);
1249 }
1250
1251
1252
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 ue(sps_bitdepth_minus8, 0, 8);
1253 2432 qp_bd_offset = 6 * current->sps_bitdepth_minus8;
1254
1255
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_entropy_coding_sync_enabled_flag);
1256
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_entry_point_offsets_present_flag);
1257
1258
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 u(4, sps_log2_max_pic_order_cnt_lsb_minus4, 0, 12);
1259
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_poc_msb_cycle_flag);
1260
2/2
✓ Branch 0 taken 17 times.
✓ Branch 1 taken 1199 times.
2432 if (current->sps_poc_msb_cycle_flag)
1261
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 ue(sps_poc_msb_cycle_len_minus1,
1262 0, 32 - current->sps_log2_max_pic_order_cnt_lsb_minus4 - 5);
1263
1264
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 u(2, sps_num_extra_ph_bytes, 0, 2);
1265
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1216 times.
2432 for (i = 0; i < (current->sps_num_extra_ph_bytes * 8); i++) {
1266 flags(sps_extra_ph_bit_present_flag[i], 1, i);
1267 }
1268
1269
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 u(2, sps_num_extra_sh_bytes, 0, 2);
1270
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1216 times.
2432 for (i = 0; i < (current->sps_num_extra_sh_bytes * 8); i++) {
1271 flags(sps_extra_sh_bit_present_flag[i], 1, i);
1272 }
1273
1274
1/2
✓ Branch 0 taken 1216 times.
✗ Branch 1 not taken.
2432 if (current->sps_ptl_dpb_hrd_params_present_flag) {
1275
2/2
✓ Branch 0 taken 342 times.
✓ Branch 1 taken 874 times.
2432 if (current->sps_max_sublayers_minus1 > 0)
1276
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 342 times.
684 flag(sps_sublayer_dpb_params_flag);
1277 else
1278
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 275 times.
1748 infer(sps_sublayer_dpb_params_flag, 0);
1279
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 CHECK(FUNC(dpb_parameters) (ctx, rw, &current->sps_dpb_params,
1280 current->sps_max_sublayers_minus1,
1281 current->sps_sublayer_dpb_params_flag));
1282 }
1283
1284
3/4
✓ Branch 0 taken 17 times.
✓ Branch 1 taken 1199 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1216 times.
2432 ue(sps_log2_min_luma_coding_block_size_minus2,
1285 0, FFMIN(4, current->sps_log2_ctu_size_minus5 + 3));
1286 2432 min_cb_log2_size_y =
1287 2432 current->sps_log2_min_luma_coding_block_size_minus2 + 2;
1288
1289
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_partition_constraints_override_enabled_flag);
1290
1291
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 ue(sps_log2_diff_min_qt_min_cb_intra_slice_luma,
1292 0, FFMIN(6, ctb_log2_size_y) - min_cb_log2_size_y);
1293 2432 min_qt_log2_size_intra_y =
1294 2432 current->sps_log2_diff_min_qt_min_cb_intra_slice_luma +
1295 min_cb_log2_size_y;
1296
1297
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 ue(sps_max_mtt_hierarchy_depth_intra_slice_luma,
1298 0, 2 * (ctb_log2_size_y - min_cb_log2_size_y));
1299
1300
1/2
✓ Branch 0 taken 1216 times.
✗ Branch 1 not taken.
2432 if (current->sps_max_mtt_hierarchy_depth_intra_slice_luma != 0) {
1301
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 ue(sps_log2_diff_max_bt_min_qt_intra_slice_luma,
1302 0, ctb_log2_size_y - min_qt_log2_size_intra_y);
1303
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 ue(sps_log2_diff_max_tt_min_qt_intra_slice_luma,
1304 0, FFMIN(6, ctb_log2_size_y) - min_qt_log2_size_intra_y);
1305 } else {
1306 infer(sps_log2_diff_max_bt_min_qt_intra_slice_luma, 0);
1307 infer(sps_log2_diff_max_tt_min_qt_intra_slice_luma, 0);
1308 }
1309
1310
2/2
✓ Branch 0 taken 1199 times.
✓ Branch 1 taken 17 times.
2432 if (current->sps_chroma_format_idc != 0) {
1311
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1199 times.
2398 flag(sps_qtbtt_dual_tree_intra_flag);
1312 } else {
1313
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
34 infer(sps_qtbtt_dual_tree_intra_flag, 0);
1314 }
1315
1316
2/2
✓ Branch 0 taken 427 times.
✓ Branch 1 taken 789 times.
2432 if (current->sps_qtbtt_dual_tree_intra_flag) {
1317
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 427 times.
854 ue(sps_log2_diff_min_qt_min_cb_intra_slice_chroma,
1318 0, FFMIN(6, ctb_log2_size_y) - min_cb_log2_size_y);
1319
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 427 times.
854 ue(sps_max_mtt_hierarchy_depth_intra_slice_chroma,
1320 0, 2 * (ctb_log2_size_y - min_cb_log2_size_y));
1321
1/2
✓ Branch 0 taken 427 times.
✗ Branch 1 not taken.
854 if (current->sps_max_mtt_hierarchy_depth_intra_slice_chroma != 0) {
1322 854 unsigned int min_qt_log2_size_intra_c =
1323 854 current->sps_log2_diff_min_qt_min_cb_intra_slice_chroma +
1324 min_cb_log2_size_y;
1325
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 427 times.
854 ue(sps_log2_diff_max_bt_min_qt_intra_slice_chroma,
1326 0, FFMIN(6, ctb_log2_size_y) - min_qt_log2_size_intra_c);
1327
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 427 times.
854 ue(sps_log2_diff_max_tt_min_qt_intra_slice_chroma,
1328 0, FFMIN(6, ctb_log2_size_y) - min_qt_log2_size_intra_c);
1329 }
1330 } else {
1331
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 260 times.
1578 infer(sps_log2_diff_min_qt_min_cb_intra_slice_chroma, 0);
1332
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 260 times.
1578 infer(sps_max_mtt_hierarchy_depth_intra_slice_chroma, 0);
1333 }
1334
2/2
✓ Branch 0 taken 789 times.
✓ Branch 1 taken 427 times.
2432 if (current->sps_max_mtt_hierarchy_depth_intra_slice_chroma == 0) {
1335
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 260 times.
1578 infer(sps_log2_diff_max_bt_min_qt_intra_slice_chroma, 0);
1336
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 260 times.
1578 infer(sps_log2_diff_max_tt_min_qt_intra_slice_chroma, 0);
1337 }
1338
1339
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 ue(sps_log2_diff_min_qt_min_cb_inter_slice,
1340 0, FFMIN(6, ctb_log2_size_y) - min_cb_log2_size_y);
1341 2432 min_qt_log2_size_inter_y =
1342 2432 current->sps_log2_diff_min_qt_min_cb_inter_slice + min_cb_log2_size_y;
1343
1344
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 ue(sps_max_mtt_hierarchy_depth_inter_slice,
1345 0, 2 * (ctb_log2_size_y - min_cb_log2_size_y));
1346
1/2
✓ Branch 0 taken 1216 times.
✗ Branch 1 not taken.
2432 if (current->sps_max_mtt_hierarchy_depth_inter_slice != 0) {
1347
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 ue(sps_log2_diff_max_bt_min_qt_inter_slice,
1348 0, ctb_log2_size_y - min_qt_log2_size_inter_y);
1349
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 ue(sps_log2_diff_max_tt_min_qt_inter_slice,
1350 0, FFMIN(6, ctb_log2_size_y) - min_qt_log2_size_inter_y);
1351 } else {
1352 infer(sps_log2_diff_max_bt_min_qt_inter_slice, 0);
1353 infer(sps_log2_diff_max_tt_min_qt_inter_slice, 0);
1354 }
1355
1356
2/2
✓ Branch 0 taken 1199 times.
✓ Branch 1 taken 17 times.
2432 if (ctb_size_y > 32)
1357
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1199 times.
2398 flag(sps_max_luma_transform_size_64_flag);
1358 else
1359
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
34 infer(sps_max_luma_transform_size_64_flag, 0);
1360
1361
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_transform_skip_enabled_flag);
1362
2/2
✓ Branch 0 taken 427 times.
✓ Branch 1 taken 789 times.
2432 if (current->sps_transform_skip_enabled_flag) {
1363
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 427 times.
854 ue(sps_log2_transform_skip_max_size_minus2, 0, 3);
1364
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 427 times.
854 flag(sps_bdpcm_enabled_flag);
1365 }
1366
1367
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_mts_enabled_flag);
1368
2/2
✓ Branch 0 taken 427 times.
✓ Branch 1 taken 789 times.
2432 if (current->sps_mts_enabled_flag) {
1369
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 427 times.
854 flag(sps_explicit_mts_intra_enabled_flag);
1370
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 427 times.
854 flag(sps_explicit_mts_inter_enabled_flag);
1371 } else {
1372
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 260 times.
1578 infer(sps_explicit_mts_intra_enabled_flag, 0);
1373
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 260 times.
1578 infer(sps_explicit_mts_inter_enabled_flag, 0);
1374 }
1375
1376
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_lfnst_enabled_flag);
1377
1378
2/2
✓ Branch 0 taken 1199 times.
✓ Branch 1 taken 17 times.
2432 if (current->sps_chroma_format_idc != 0) {
1379 uint8_t num_qp_tables;
1380
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1199 times.
2398 flag(sps_joint_cbcr_enabled_flag);
1381
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1199 times.
2398 flag(sps_same_qp_table_for_chroma_flag);
1382
2/2
✓ Branch 0 taken 12 times.
✓ Branch 1 taken 1187 times.
2422 num_qp_tables = current->sps_same_qp_table_for_chroma_flag ?
1383
1/2
✓ Branch 0 taken 12 times.
✗ Branch 1 not taken.
24 1 : (current->sps_joint_cbcr_enabled_flag ? 3 : 2);
1384
2/2
✓ Branch 0 taken 1223 times.
✓ Branch 1 taken 1199 times.
4844 for (i = 0; i < num_qp_tables; i++) {
1385
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1223 times.
2446 ses(sps_qp_table_start_minus26[i], -26 - qp_bd_offset, 36, 1, i);
1386
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1223 times.
2446 ues(sps_num_points_in_qp_table_minus1[i],
1387 0, 36 - current->sps_qp_table_start_minus26[i], 1, i);
1388
2/2
✓ Branch 0 taken 2134 times.
✓ Branch 1 taken 1223 times.
6714 for (j = 0; j <= current->sps_num_points_in_qp_table_minus1[i]; j++) {
1389 4268 uint8_t max = MAX_UINT_BITS(8);
1390
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 2134 times.
4268 ues(sps_delta_qp_in_val_minus1[i][j], 0, max, 2, i, j);
1391
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 2134 times.
4268 ues(sps_delta_qp_diff_val[i][j], 0, max, 2, i, j);
1392 }
1393 }
1394 } else {
1395
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
34 infer(sps_joint_cbcr_enabled_flag, 0);
1396
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
34 infer(sps_same_qp_table_for_chroma_flag, 0);
1397 }
1398
1399
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_sao_enabled_flag);
1400
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_alf_enabled_flag);
1401
4/4
✓ Branch 0 taken 381 times.
✓ Branch 1 taken 835 times.
✓ Branch 2 taken 364 times.
✓ Branch 3 taken 17 times.
2432 if (current->sps_alf_enabled_flag && current->sps_chroma_format_idc)
1402
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 364 times.
728 flag(sps_ccalf_enabled_flag);
1403 else
1404
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 271 times.
1704 infer(sps_ccalf_enabled_flag, 0);
1405
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_lmcs_enabled_flag);
1406
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_weighted_pred_flag);
1407
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_weighted_bipred_flag);
1408
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_long_term_ref_pics_flag);
1409
2/2
✓ Branch 0 taken 34 times.
✓ Branch 1 taken 1182 times.
2432 if (current->sps_video_parameter_set_id > 0)
1410
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
68 flag(sps_inter_layer_prediction_enabled_flag);
1411 else
1412
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 329 times.
2364 infer(sps_inter_layer_prediction_enabled_flag, 0);
1413
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_idr_rpl_present_flag);
1414
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_rpl1_same_as_rpl0_flag);
1415
1416
4/4
✓ Branch 0 taken 136 times.
✓ Branch 1 taken 3444 times.
✓ Branch 2 taken 2364 times.
✓ Branch 3 taken 1216 times.
7160 for (i = 0; i < (current->sps_rpl1_same_as_rpl0_flag ? 1 : 2); i++) {
1417
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 2364 times.
4728 ues(sps_num_ref_pic_lists[i], 0, VVC_MAX_REF_PIC_LISTS, 1, i);
1418
2/2
✓ Branch 0 taken 57016 times.
✓ Branch 1 taken 2364 times.
118760 for (j = 0; j < current->sps_num_ref_pic_lists[i]; j++)
1419
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 57016 times.
114032 CHECK(FUNC(ref_pic_list_struct) (ctx, rw,
1420 &current->
1421 sps_ref_pic_list_struct[i][j], i,
1422 j, current));
1423 }
1424
1425
2/2
✓ Branch 0 taken 68 times.
✓ Branch 1 taken 1148 times.
2432 if (current->sps_rpl1_same_as_rpl0_flag) {
1426 136 current->sps_num_ref_pic_lists[1] = current->sps_num_ref_pic_lists[0];
1427
2/2
✓ Branch 0 taken 962 times.
✓ Branch 1 taken 68 times.
2060 for (j = 0; j < current->sps_num_ref_pic_lists[0]; j++)
1428 1924 memcpy(&current->sps_ref_pic_list_struct[1][j],
1429 1924 &current->sps_ref_pic_list_struct[0][j],
1430 sizeof(current->sps_ref_pic_list_struct[0][j]));
1431 }
1432
1433
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_ref_wraparound_enabled_flag);
1434
1435
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_temporal_mvp_enabled_flag);
1436
1/2
✓ Branch 0 taken 1216 times.
✗ Branch 1 not taken.
2432 if (current->sps_temporal_mvp_enabled_flag)
1437
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_sbtmvp_enabled_flag);
1438 else
1439 infer(sps_sbtmvp_enabled_flag, 0);
1440
1441
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_amvr_enabled_flag);
1442
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_bdof_enabled_flag);
1443
2/2
✓ Branch 0 taken 342 times.
✓ Branch 1 taken 874 times.
2432 if (current->sps_bdof_enabled_flag)
1444
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 342 times.
684 flag(sps_bdof_control_present_in_ph_flag);
1445 else
1446
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 275 times.
1748 infer(sps_bdof_control_present_in_ph_flag, 0);
1447
1448
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_smvd_enabled_flag);
1449
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_dmvr_enabled_flag);
1450
2/2
✓ Branch 0 taken 325 times.
✓ Branch 1 taken 891 times.
2432 if (current->sps_dmvr_enabled_flag)
1451
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 325 times.
650 flag(sps_dmvr_control_present_in_ph_flag);
1452 else
1453
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 278 times.
1782 infer(sps_dmvr_control_present_in_ph_flag, 0);
1454
1455
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_mmvd_enabled_flag);
1456
2/2
✓ Branch 0 taken 1199 times.
✓ Branch 1 taken 17 times.
2432 if (current->sps_mmvd_enabled_flag)
1457
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1199 times.
2398 flag(sps_mmvd_fullpel_only_enabled_flag);
1458 else
1459
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
34 infer(sps_mmvd_fullpel_only_enabled_flag, 0);
1460
1461
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 ue(sps_six_minus_max_num_merge_cand, 0, 5);
1462 2432 max_num_merge_cand = 6 - current->sps_six_minus_max_num_merge_cand;
1463
1464
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_sbt_enabled_flag);
1465
1466
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_affine_enabled_flag);
1467
2/2
✓ Branch 0 taken 427 times.
✓ Branch 1 taken 789 times.
2432 if (current->sps_affine_enabled_flag) {
1468
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 427 times.
854 ue(sps_five_minus_max_num_subblock_merge_cand,
1469 0, 5 - current->sps_sbtmvp_enabled_flag);
1470
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 427 times.
854 flag(sps_6param_affine_enabled_flag);
1471
1/2
✓ Branch 0 taken 427 times.
✗ Branch 1 not taken.
854 if (current->sps_amvr_enabled_flag)
1472
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 427 times.
854 flag(sps_affine_amvr_enabled_flag);
1473 else
1474 infer(sps_affine_amvr_enabled_flag, 0);
1475
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 427 times.
854 flag(sps_affine_prof_enabled_flag);
1476
1/2
✓ Branch 0 taken 427 times.
✗ Branch 1 not taken.
854 if (current->sps_affine_prof_enabled_flag)
1477
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 427 times.
854 flag(sps_prof_control_present_in_ph_flag);
1478 else
1479 infer(sps_prof_control_present_in_ph_flag, 0);
1480 } else {
1481
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 260 times.
1578 infer(sps_6param_affine_enabled_flag, 0);
1482
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 260 times.
1578 infer(sps_affine_amvr_enabled_flag, 0);
1483
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 260 times.
1578 infer(sps_affine_prof_enabled_flag, 0);
1484
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 260 times.
1578 infer(sps_prof_control_present_in_ph_flag, 0);
1485 }
1486
1487
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_bcw_enabled_flag);
1488
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_ciip_enabled_flag);
1489
1490
1/2
✓ Branch 0 taken 1216 times.
✗ Branch 1 not taken.
2432 if (max_num_merge_cand >= 2) {
1491
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_gpm_enabled_flag);
1492
3/4
✓ Branch 0 taken 393 times.
✓ Branch 1 taken 823 times.
✓ Branch 2 taken 393 times.
✗ Branch 3 not taken.
2432 if (current->sps_gpm_enabled_flag && max_num_merge_cand >= 3)
1493
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 393 times.
786 ue(sps_max_num_merge_cand_minus_max_num_gpm_cand,
1494 0, max_num_merge_cand - 2);
1495 } else {
1496 infer(sps_gpm_enabled_flag, 0);
1497 }
1498
1499
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 ue(sps_log2_parallel_merge_level_minus2, 0, ctb_log2_size_y - 2);
1500
1501
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_isp_enabled_flag);
1502
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_mrl_enabled_flag);
1503
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_mip_enabled_flag);
1504
1505
2/2
✓ Branch 0 taken 1199 times.
✓ Branch 1 taken 17 times.
2432 if (current->sps_chroma_format_idc != 0)
1506
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1199 times.
2398 flag(sps_cclm_enabled_flag);
1507 else
1508
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
34 infer(sps_cclm_enabled_flag, 0);
1509
2/2
✓ Branch 0 taken 1182 times.
✓ Branch 1 taken 34 times.
2432 if (current->sps_chroma_format_idc == 1) {
1510
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1182 times.
2364 flag(sps_chroma_horizontal_collocated_flag);
1511
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1182 times.
2364 flag(sps_chroma_vertical_collocated_flag);
1512 } else {
1513
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 6 times.
68 infer(sps_chroma_horizontal_collocated_flag, 1);
1514
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 6 times.
68 infer(sps_chroma_vertical_collocated_flag, 1);
1515 }
1516
1517
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_palette_enabled_flag);
1518
2/2
✓ Branch 0 taken 17 times.
✓ Branch 1 taken 1199 times.
2432 if (current->sps_chroma_format_idc == 3 &&
1519
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
34 !current->sps_max_luma_transform_size_64_flag)
1520 flag(sps_act_enabled_flag);
1521 else
1522
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 335 times.
2432 infer(sps_act_enabled_flag, 0);
1523
2/2
✓ Branch 0 taken 789 times.
✓ Branch 1 taken 427 times.
2432 if (current->sps_transform_skip_enabled_flag ||
1524
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 789 times.
1578 current->sps_palette_enabled_flag)
1525
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 427 times.
854 ue(sps_min_qp_prime_ts, 0, 8);
1526
1527
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_ibc_enabled_flag);
1528
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1216 times.
2432 if (current->sps_ibc_enabled_flag)
1529 ue(sps_six_minus_max_num_ibc_merge_cand, 0, 5);
1530
1531
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_ladf_enabled_flag);
1532
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1216 times.
2432 if (current->sps_ladf_enabled_flag) {
1533 ub(2, sps_num_ladf_intervals_minus2);
1534 se(sps_ladf_lowest_interval_qp_offset, -63, 63);
1535 for (i = 0; i < current->sps_num_ladf_intervals_minus2 + 1; i++) {
1536 ses(sps_ladf_qp_offset[i], -63, 63, 1, i);
1537 ues(sps_ladf_delta_threshold_minus1[i],
1538 0, (2 << (8 + current->sps_bitdepth_minus8)) - 3, 1, i);
1539 }
1540 }
1541
1542
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_explicit_scaling_list_enabled_flag);
1543
2/2
✓ Branch 0 taken 342 times.
✓ Branch 1 taken 874 times.
2432 if (current->sps_lfnst_enabled_flag &&
1544
2/2
✓ Branch 0 taken 34 times.
✓ Branch 1 taken 308 times.
684 current->sps_explicit_scaling_list_enabled_flag)
1545
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
68 flag(sps_scaling_matrix_for_lfnst_disabled_flag);
1546
1547
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1216 times.
2432 if (current->sps_act_enabled_flag &&
1548 current->sps_explicit_scaling_list_enabled_flag)
1549 flag(sps_scaling_matrix_for_alternative_colour_space_disabled_flag);
1550 else
1551
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 335 times.
2432 infer(sps_scaling_matrix_for_alternative_colour_space_disabled_flag, 0);
1552
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1216 times.
2432 if (current->sps_scaling_matrix_for_alternative_colour_space_disabled_flag)
1553 flag(sps_scaling_matrix_designated_colour_space_flag);
1554
1555
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_dep_quant_enabled_flag);
1556
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_sign_data_hiding_enabled_flag);
1557
1558
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_virtual_boundaries_enabled_flag);
1559
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1216 times.
2432 if (current->sps_virtual_boundaries_enabled_flag) {
1560 flag(sps_virtual_boundaries_present_flag);
1561 if (current->sps_virtual_boundaries_present_flag) {
1562 ue(sps_num_ver_virtual_boundaries,
1563 0, current->sps_pic_width_max_in_luma_samples <= 8 ? 0 : 3);
1564 for (i = 0; i < current->sps_num_ver_virtual_boundaries; i++)
1565 ues(sps_virtual_boundary_pos_x_minus1[i],
1566 0, (current->sps_pic_width_max_in_luma_samples + 7) / 8 - 2,
1567 1, i);
1568 ue(sps_num_hor_virtual_boundaries,
1569 0, current->sps_pic_height_max_in_luma_samples <= 8 ? 0 : 3);
1570 for (i = 0; i < current->sps_num_hor_virtual_boundaries; i++)
1571 ues(sps_virtual_boundary_pos_y_minus1[i],
1572 0, (current->sps_pic_height_max_in_luma_samples + 7) /
1573 8 - 2, 1, i);
1574 }
1575 } else {
1576
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 335 times.
2432 infer(sps_virtual_boundaries_present_flag, 0);
1577
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 335 times.
2432 infer(sps_num_ver_virtual_boundaries, 0);
1578
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 335 times.
2432 infer(sps_num_hor_virtual_boundaries, 0);
1579 }
1580
1581
1/2
✓ Branch 0 taken 1216 times.
✗ Branch 1 not taken.
2432 if (current->sps_ptl_dpb_hrd_params_present_flag) {
1582
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_timing_hrd_params_present_flag);
1583
2/2
✓ Branch 0 taken 17 times.
✓ Branch 1 taken 1199 times.
2432 if (current->sps_timing_hrd_params_present_flag) {
1584 uint8_t first_sublayer;
1585
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 CHECK(FUNC(general_timing_hrd_parameters) (ctx, rw,
1586 &current->sps_general_timing_hrd_parameters));
1587
1/2
✓ Branch 0 taken 17 times.
✗ Branch 1 not taken.
34 if (current->sps_max_sublayers_minus1 > 0)
1588
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 flag(sps_sublayer_cpb_params_present_flag);
1589 else
1590 infer(sps_sublayer_cpb_params_present_flag, 0);
1591
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 17 times.
34 first_sublayer = current->sps_sublayer_cpb_params_present_flag ?
1592 0 : current->sps_max_sublayers_minus1;
1593
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 CHECK(FUNC(ols_timing_hrd_parameters) (ctx, rw,
1594 &current->sps_ols_timing_hrd_parameters, first_sublayer,
1595 current->sps_max_sublayers_minus1,
1596 &current->sps_general_timing_hrd_parameters));
1597 }
1598 }
1599
1600
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_field_seq_flag);
1601
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_vui_parameters_present_flag);
1602
2/2
✓ Branch 0 taken 17 times.
✓ Branch 1 taken 1199 times.
2432 if (current->sps_vui_parameters_present_flag) {
1603
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 ue(sps_vui_payload_size_minus1, 0, 1023);
1604
2/2
✓ Branch 1 taken 51 times.
✓ Branch 2 taken 17 times.
136 while (byte_alignment(rw) != 0)
1605
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 51 times.
102 fixed(1, sps_vui_alignment_zero_bit, 0);
1606
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 CHECK(FUNC(vui_payload) (ctx, rw, &current->vui,
1607 current->sps_vui_payload_size_minus1 + 1,
1608 current->sps_chroma_format_idc));
1609 } else {
1610
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1199 times.
2398 CHECK(FUNC(vui_parameters_default) (ctx, rw, &current->vui));
1611 }
1612
1613
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 flag(sps_extension_flag);
1614
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1216 times.
2432 if (current->sps_extension_flag) {
1615 flag(sps_range_extension_flag);
1616 ub(7, sps_extension_7bits);
1617
1618 if (current->sps_range_extension_flag) {
1619 CHECK(FUNC(sps_range_extension)(ctx, rw, current));
1620 } else {
1621 infer(sps_extended_precision_flag, 0);
1622 infer(sps_ts_residual_coding_rice_present_in_sh_flag, 0);
1623 infer(sps_rrc_rice_extension_flag, 0);
1624 infer(sps_persistent_rice_adaptation_enabled_flag, 0);
1625 infer(sps_reverse_last_sig_coeff_enabled_flag, 0);
1626 }
1627 } else {
1628
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 335 times.
2432 infer(sps_range_extension_flag, 0);
1629
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 335 times.
2432 infer(sps_extension_7bits, 0);
1630
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 335 times.
2432 infer(sps_extended_precision_flag, 0);
1631
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 335 times.
2432 infer(sps_ts_residual_coding_rice_present_in_sh_flag, 0);
1632
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 335 times.
2432 infer(sps_rrc_rice_extension_flag, 0);
1633
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 335 times.
2432 infer(sps_persistent_rice_adaptation_enabled_flag, 0);
1634
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 335 times.
2432 infer(sps_reverse_last_sig_coeff_enabled_flag, 0);
1635 }
1636
1637
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1216 times.
2432 if (current->sps_extension_7bits)
1638 CHECK(FUNC(extension_data)(ctx, rw, &current->extension_data));
1639
1640
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1216 times.
2432 CHECK(FUNC(rbsp_trailing_bits) (ctx, rw));
1641
1642 2432 return 0;
1643 }
1644
1645 2984 static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw,
1646 H266RawPPS *current)
1647 {
1648 2984 CodedBitstreamH266Context *h266 = ctx->priv_data;
1649 const H266RawSPS *sps;
1650 int err, i;
1651 unsigned int min_cb_size_y, divisor, ctb_size_y,
1652 pic_width_in_ctbs_y, pic_height_in_ctbs_y;
1653 uint8_t sub_width_c, sub_height_c, qp_bd_offset;
1654
1655 static const uint8_t h266_sub_width_c[] = {
1656 1, 2, 2, 1
1657 };
1658 static const uint8_t h266_sub_height_c[] = {
1659 1, 2, 1, 1
1660 };
1661
1662 2984 HEADER("Picture Parameter Set");
1663
1664
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1492 times.
2984 CHECK(FUNC(nal_unit_header) (ctx, rw,
1665 &current->nal_unit_header, VVC_PPS_NUT));
1666
1667
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1492 times.
2984 ub(6, pps_pic_parameter_set_id);
1668
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1492 times.
2984 ub(4, pps_seq_parameter_set_id);
1669 2984 sps = h266->sps[current->pps_seq_parameter_set_id];
1670
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1492 times.
2984 if (!sps) {
1671 av_log(ctx->log_ctx, AV_LOG_ERROR, "SPS id %d not available.\n",
1672 current->pps_seq_parameter_set_id);
1673 return AVERROR_INVALIDDATA;
1674 }
1675
1676
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1492 times.
2984 flag(pps_mixed_nalu_types_in_pic_flag);
1677
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1492 times.
2984 ue(pps_pic_width_in_luma_samples,
1678 1, sps->sps_pic_width_max_in_luma_samples);
1679
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1492 times.
2984 ue(pps_pic_height_in_luma_samples,
1680 1, sps->sps_pic_height_max_in_luma_samples);
1681
1682 2984 min_cb_size_y = 1 << (sps->sps_log2_min_luma_coding_block_size_minus2 + 2);
1683 2984 divisor = FFMAX(min_cb_size_y, 8);
1684
1/2
✓ Branch 0 taken 1492 times.
✗ Branch 1 not taken.
2984 if (current->pps_pic_width_in_luma_samples % divisor ||
1685
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1492 times.
2984 current->pps_pic_height_in_luma_samples % divisor) {
1686 av_log(ctx->log_ctx, AV_LOG_ERROR,
1687 "Invalid dimensions: %ux%u not divisible "
1688 "by %u, MinCbSizeY = %u.\n",
1689 current->pps_pic_width_in_luma_samples,
1690 current->pps_pic_height_in_luma_samples, divisor, min_cb_size_y);
1691 return AVERROR_INVALIDDATA;
1692 }
1693
1/2
✓ Branch 0 taken 1492 times.
✗ Branch 1 not taken.
2984 if (!sps->sps_res_change_in_clvs_allowed_flag &&
1694 2984 (current->pps_pic_width_in_luma_samples !=
1695
1/2
✓ Branch 0 taken 1492 times.
✗ Branch 1 not taken.
2984 sps->sps_pic_width_max_in_luma_samples ||
1696 2984 current->pps_pic_height_in_luma_samples !=
1697
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1492 times.
2984 sps->sps_pic_height_max_in_luma_samples)) {
1698 av_log(ctx->log_ctx, AV_LOG_ERROR,
1699 "Resoltuion change is not allowed, "
1700 "in max resolution (%ux%u) mismatched with pps(%ux%u).\n",
1701 sps->sps_pic_width_max_in_luma_samples,
1702 sps->sps_pic_height_max_in_luma_samples,
1703 current->pps_pic_width_in_luma_samples,
1704 current->pps_pic_height_in_luma_samples);
1705 return AVERROR_INVALIDDATA;
1706 }
1707
1708 2984 ctb_size_y = 1 << (sps->sps_log2_ctu_size_minus5 + 5);
1709
2/2
✓ Branch 0 taken 12 times.
✓ Branch 1 taken 1480 times.
2984 if (sps->sps_ref_wraparound_enabled_flag) {
1710 24 if ((ctb_size_y / min_cb_size_y + 1) >
1711
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 12 times.
24 (current->pps_pic_width_in_luma_samples / min_cb_size_y - 1)) {
1712 av_log(ctx->log_ctx, AV_LOG_ERROR,
1713 "Invalid width(%u), ctb_size_y = %u, min_cb_size_y = %u.\n",
1714 current->pps_pic_width_in_luma_samples,
1715 ctb_size_y, min_cb_size_y);
1716 return AVERROR_INVALIDDATA;
1717 }
1718 }
1719
1720
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1492 times.
2984 flag(pps_conformance_window_flag);
1721 2984 if (current->pps_pic_width_in_luma_samples ==
1722
1/2
✓ Branch 0 taken 1492 times.
✗ Branch 1 not taken.
2984 sps->sps_pic_width_max_in_luma_samples &&
1723 2984 current->pps_pic_height_in_luma_samples ==
1724
1/2
✓ Branch 0 taken 1492 times.
✗ Branch 1 not taken.
2984 sps->sps_pic_height_max_in_luma_samples &&
1725
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1492 times.
2984 current->pps_conformance_window_flag) {
1726 av_log(ctx->log_ctx, AV_LOG_ERROR,
1727 "Conformance window flag should not true.\n");
1728 return AVERROR_INVALIDDATA;
1729 }
1730
1731 2984 sub_width_c = h266_sub_width_c[sps->sps_chroma_format_idc];
1732 2984 sub_height_c = h266_sub_height_c[sps->sps_chroma_format_idc];
1733
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1492 times.
2984 if (current->pps_conformance_window_flag) {
1734 ue(pps_conf_win_left_offset, 0, current->pps_pic_width_in_luma_samples);
1735 ue(pps_conf_win_right_offset,
1736 0, current->pps_pic_width_in_luma_samples);
1737 ue(pps_conf_win_top_offset, 0, current->pps_pic_height_in_luma_samples);
1738 ue(pps_conf_win_bottom_offset,
1739 0, current->pps_pic_height_in_luma_samples);
1740 if (sub_width_c *
1741 (current->pps_conf_win_left_offset +
1742 current->pps_conf_win_right_offset) >=
1743 current->pps_pic_width_in_luma_samples ||
1744 sub_height_c *
1745 (current->pps_conf_win_top_offset +
1746 current->pps_conf_win_bottom_offset) >=
1747 current->pps_pic_height_in_luma_samples) {
1748 av_log(ctx->log_ctx, AV_LOG_ERROR,
1749 "Invalid pps conformance window: (%u, %u, %u, %u), "
1750 "resolution is %ux%u, sub wxh is %ux%u.\n",
1751 current->pps_conf_win_left_offset,
1752 current->pps_conf_win_right_offset,
1753 current->pps_conf_win_top_offset,
1754 current->pps_conf_win_bottom_offset,
1755 current->pps_pic_width_in_luma_samples,
1756 current->pps_pic_height_in_luma_samples,
1757 sub_width_c, sub_height_c);
1758 return AVERROR_INVALIDDATA;
1759 }
1760 } else {
1761 2984 if (current->pps_pic_width_in_luma_samples ==
1762
1/2
✓ Branch 0 taken 1492 times.
✗ Branch 1 not taken.
2984 sps->sps_pic_width_max_in_luma_samples &&
1763 2984 current->pps_pic_height_in_luma_samples ==
1764
1/2
✓ Branch 0 taken 1492 times.
✗ Branch 1 not taken.
2984 sps->sps_pic_height_max_in_luma_samples) {
1765
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 391 times.
2984 infer(pps_conf_win_left_offset, sps->sps_conf_win_left_offset);
1766
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 391 times.
2984 infer(pps_conf_win_right_offset, sps->sps_conf_win_right_offset);
1767
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 391 times.
2984 infer(pps_conf_win_top_offset, sps->sps_conf_win_top_offset);
1768
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 391 times.
2984 infer(pps_conf_win_bottom_offset, sps->sps_conf_win_bottom_offset);
1769 } else {
1770 infer(pps_conf_win_left_offset, 0);
1771 infer(pps_conf_win_right_offset, 0);
1772 infer(pps_conf_win_top_offset, 0);
1773 infer(pps_conf_win_bottom_offset, 0);
1774 }
1775
1776 }
1777
1778
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1492 times.
2984 flag(pps_scaling_window_explicit_signalling_flag);
1779
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1492 times.
2984 if (!sps->sps_ref_pic_resampling_enabled_flag &&
1780 current->pps_scaling_window_explicit_signalling_flag) {
1781 av_log(ctx->log_ctx, AV_LOG_ERROR,
1782 "Invalid data: sps_ref_pic_resampling_enabled_flag is false, "
1783 "but pps_scaling_window_explicit_signalling_flag is true.\n");
1784 return AVERROR_INVALIDDATA;
1785 }
1786
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1492 times.
2984 if (current->pps_scaling_window_explicit_signalling_flag) {
1787 se(pps_scaling_win_left_offset,
1788 -current->pps_pic_width_in_luma_samples * 15 / sub_width_c,
1789 current->pps_pic_width_in_luma_samples / sub_width_c);
1790 se(pps_scaling_win_right_offset,
1791 -current->pps_pic_width_in_luma_samples * 15 / sub_width_c,
1792 current->pps_pic_width_in_luma_samples / sub_width_c);
1793 se(pps_scaling_win_top_offset,
1794 -current->pps_pic_height_in_luma_samples * 15 / sub_height_c,
1795 current->pps_pic_height_in_luma_samples / sub_height_c);
1796 se(pps_scaling_win_bottom_offset,
1797 -current->pps_pic_height_in_luma_samples * 15 / sub_height_c,
1798 current->pps_pic_height_in_luma_samples / sub_height_c);
1799 } else {
1800
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 391 times.
2984 infer(pps_scaling_win_left_offset, current->pps_conf_win_left_offset);
1801
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 391 times.
2984 infer(pps_scaling_win_right_offset, current->pps_conf_win_right_offset);
1802
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 391 times.
2984 infer(pps_scaling_win_top_offset, current->pps_conf_win_top_offset);
1803
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 391 times.
2984 infer(pps_scaling_win_bottom_offset, current->pps_conf_win_bottom_offset);
1804 }
1805
1806
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1492 times.
2984 flag(pps_output_flag_present_flag);
1807
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1492 times.
2984 flag(pps_no_pic_partition_flag);
1808
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1492 times.
2984 flag(pps_subpic_id_mapping_present_flag);
1809
1810
2/2
✓ Branch 0 taken 17 times.
✓ Branch 1 taken 1475 times.
2984 if (current->pps_subpic_id_mapping_present_flag) {
1811
1/2
✓ Branch 0 taken 17 times.
✗ Branch 1 not taken.
34 if (!current->pps_no_pic_partition_flag) {
1812
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 ue(pps_num_subpics_minus1,
1813 sps->sps_num_subpics_minus1, sps->sps_num_subpics_minus1);
1814 } else {
1815 infer(pps_num_subpics_minus1, 0);
1816 }
1817
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 17 times.
34 ue(pps_subpic_id_len_minus1, sps->sps_subpic_id_len_minus1,
1818 sps->sps_subpic_id_len_minus1);
1819
2/2
✓ Branch 0 taken 85 times.
✓ Branch 1 taken 17 times.
204 for (i = 0; i <= current->pps_num_subpics_minus1; i++) {
1820
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 85 times.
170 ubs(sps->sps_subpic_id_len_minus1 + 1, pps_subpic_id[i], 1, i);
1821 }
1822 }
1823
1824
2/2
✓ Branch 0 taken 1600 times.
✓ Branch 1 taken 1492 times.
6184 for (i = 0; i <= sps->sps_num_subpics_minus1; i++) {
1825
2/2
✓ Branch 0 taken 135 times.
✓ Branch 1 taken 1465 times.
3200 if (sps->sps_subpic_id_mapping_explicitly_signalled_flag)
1826
2/2
✓ Branch 0 taken 85 times.
✓ Branch 1 taken 50 times.
370 current->sub_pic_id_val[i] = current->pps_subpic_id_mapping_present_flag
1827 ? current->pps_subpic_id[i]
1828 100 : sps->sps_subpic_id[i];
1829 else
1830 2930 current->sub_pic_id_val[i] = i;
1831 }
1832
1833 2984 pic_width_in_ctbs_y = AV_CEIL_RSHIFT
1834 (current->pps_pic_width_in_luma_samples, (sps->sps_log2_ctu_size_minus5 + 5));
1835 2984 pic_height_in_ctbs_y = AV_CEIL_RSHIFT(
1836 current->pps_pic_height_in_luma_samples,(sps->sps_log2_ctu_size_minus5 + 5));
1837
2/2
✓ Branch 0 taken 59 times.
✓ Branch 1 taken 1433 times.
2984 if (!current->pps_no_pic_partition_flag) {
1838 118 unsigned int exp_tile_width = 0, exp_tile_height = 0;
1839 unsigned int unified_size, remaining_size;
1840
1841
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 59 times.
118 u(2, pps_log2_ctu_size_minus5,
1842 sps->sps_log2_ctu_size_minus5, sps->sps_log2_ctu_size_minus5);
1843
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 59 times.
118 ue(pps_num_exp_tile_columns_minus1,
1844 0, FFMIN(pic_width_in_ctbs_y - 1, VVC_MAX_TILE_COLUMNS - 1));
1845
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 59 times.