23 xu(1, rbsp_stop_one_bit, one, 1, 1);
25 xu(1, rbsp_alignment_zero_bit,
zero, 0, 0);
32 int expected_nal_unit_type)
36 u(1, forbidden_zero_bit, 0, 0);
38 if (expected_nal_unit_type >= 0)
39 u(6, nal_unit_type, expected_nal_unit_type,
40 expected_nal_unit_type);
42 u(6, nal_unit_type, 0, 63);
44 u(6, nuh_layer_id, 0, 62);
45 u(3, nuh_temporal_id_plus1, 1, 7);
54 xu(1, alignment_bit_equal_to_one, one, 1, 1);
56 xu(1, alignment_bit_equal_to_zero,
zero, 0, 0);
72 current->bit_length = k;
75 allocate(current->data, (current->bit_length + 7) / 8);
76 for (k = 0; k < current->bit_length; k++) {
78 current->data[k / 8] |= bit << (7 - k % 8);
82 for (k = 0; k < current->bit_length; k++)
90 int profile_present_flag,
91 int max_num_sub_layers_minus1)
96 if (profile_present_flag) {
97 u(2, general_profile_space, 0, 0);
98 flag(general_tier_flag);
99 u(5, general_profile_idc, 0, 31);
101 for (j = 0; j < 32; j++)
102 flag(general_profile_compatibility_flag[j]);
104 flag(general_progressive_source_flag);
105 flag(general_interlaced_source_flag);
106 flag(general_non_packed_constraint_flag);
107 flag(general_frame_only_constraint_flag);
109 #define profile_compatible(x) (current->general_profile_idc == (x) || \ 110 current->general_profile_compatibility_flag[x]) 115 flag(general_max_12bit_constraint_flag);
116 flag(general_max_10bit_constraint_flag);
117 flag(general_max_8bit_constraint_flag);
118 flag(general_max_422chroma_constraint_flag);
119 flag(general_max_420chroma_constraint_flag);
120 flag(general_max_monochrome_constraint_flag);
121 flag(general_intra_constraint_flag);
122 flag(general_one_picture_only_constraint_flag);
123 flag(general_lower_bit_rate_constraint_flag);
127 flag(general_max_14bit_constraint_flag);
128 xu(24, general_reserved_zero_33bits, zero, 0, 0);
129 xu(9, general_reserved_zero_33bits, zero, 0, 0);
131 xu(24, general_reserved_zero_34bits, zero, 0, 0);
132 xu(10, general_reserved_zero_34bits, zero, 0, 0);
135 xu(24, general_reserved_zero_43bits, zero, 0, 0);
136 xu(19, general_reserved_zero_43bits, zero, 0, 0);
142 flag(general_inbld_flag);
144 xu(1, general_reserved_zero_bit, zero, 0, 0);
146 #undef profile_compatible 149 u(8, general_level_idc, 0, 255);
151 for (i = 0; i < max_num_sub_layers_minus1; i++) {
152 flag(sub_layer_profile_present_flag[i]);
153 flag(sub_layer_level_present_flag[i]);
156 if (max_num_sub_layers_minus1 > 0) {
157 for (i = max_num_sub_layers_minus1; i < 8; i++) {
159 xu(2, reserved_zero_2bits, zero, 0, 0);
163 for (i = 0; i < max_num_sub_layers_minus1; i++) {
164 if (current->sub_layer_profile_present_flag[i])
166 if (current->sub_layer_level_present_flag[i])
175 int nal,
int sub_layer_id)
181 current = &hrd->nal_sub_layer_hrd_parameters[sub_layer_id];
183 current = &hrd->vcl_sub_layer_hrd_parameters[sub_layer_id];
185 for (i = 0; i <= hrd->cpb_cnt_minus1[sub_layer_id]; i++) {
186 ue(bit_rate_value_minus1[i], 0, UINT32_MAX - 1);
187 ue(cpb_size_value_minus1[i], 0, UINT32_MAX - 1);
188 if (hrd->sub_pic_hrd_params_present_flag) {
189 ue(cpb_size_du_value_minus1[i], 0, UINT32_MAX - 1);
190 ue(bit_rate_du_value_minus1[i], 0, UINT32_MAX - 1);
200 int max_num_sub_layers_minus1)
204 if (common_inf_present_flag) {
205 flag(nal_hrd_parameters_present_flag);
206 flag(vcl_hrd_parameters_present_flag);
208 if (current->nal_hrd_parameters_present_flag ||
209 current->vcl_hrd_parameters_present_flag) {
210 flag(sub_pic_hrd_params_present_flag);
211 if (current->sub_pic_hrd_params_present_flag) {
212 u(8, tick_divisor_minus2, 0, 255);
213 u(5, du_cpb_removal_delay_increment_length_minus1, 0, 31);
214 flag(sub_pic_cpb_params_in_pic_timing_sei_flag);
215 u(5, dpb_output_delay_du_length_minus1, 0, 31);
218 u(4, bit_rate_scale, 0, 15);
219 u(4, cpb_size_scale, 0, 15);
220 if (current->sub_pic_hrd_params_present_flag)
221 u(4, cpb_size_du_scale, 0, 15);
223 u(5, initial_cpb_removal_delay_length_minus1, 0, 31);
224 u(5, au_cpb_removal_delay_length_minus1, 0, 31);
225 u(5, dpb_output_delay_length_minus1, 0, 31);
227 infer(sub_pic_hrd_params_present_flag, 0);
229 infer(initial_cpb_removal_delay_length_minus1, 23);
230 infer(au_cpb_removal_delay_length_minus1, 23);
231 infer(dpb_output_delay_length_minus1, 23);
235 for (i = 0; i <= max_num_sub_layers_minus1; i++) {
236 flag(fixed_pic_rate_general_flag[i]);
238 if (!current->fixed_pic_rate_general_flag[i])
239 flag(fixed_pic_rate_within_cvs_flag[i]);
241 infer(fixed_pic_rate_within_cvs_flag[i], 1);
243 if (current->fixed_pic_rate_within_cvs_flag[i]) {
244 ue(elemental_duration_in_tc_minus1[i], 0, 2047);
245 infer(low_delay_hrd_flag[i], 0);
247 flag(low_delay_hrd_flag[i]);
249 if (!current->low_delay_hrd_flag[i])
250 ue(cpb_cnt_minus1[i], 0, 31);
252 infer(cpb_cnt_minus1[i], 0);
254 if (current->nal_hrd_parameters_present_flag)
256 if (current->vcl_hrd_parameters_present_flag)
268 flag(aspect_ratio_info_present_flag);
269 if (current->aspect_ratio_info_present_flag) {
270 u(8, aspect_ratio_idc, 0, 255);
271 if (current->aspect_ratio_idc == 255) {
272 u(16, sar_width, 0, 65535);
273 u(16, sar_height, 0, 65535);
276 infer(aspect_ratio_idc, 0);
279 flag(overscan_info_present_flag);
280 if (current->overscan_info_present_flag)
281 flag(overscan_appropriate_flag);
283 flag(video_signal_type_present_flag);
284 if (current->video_signal_type_present_flag) {
285 u(3, video_format, 0, 7);
286 flag(video_full_range_flag);
287 flag(colour_description_present_flag);
288 if (current->colour_description_present_flag) {
289 u(8, colour_primaries, 0, 255);
291 u(8, matrix_coefficients, 0, 255);
293 infer(colour_primaries, 2);
295 infer(matrix_coefficients, 2);
298 infer(video_format, 5);
299 infer(video_full_range_flag, 0);
300 infer(colour_primaries, 2);
302 infer(matrix_coefficients, 2);
305 flag(chroma_loc_info_present_flag);
306 if (current->chroma_loc_info_present_flag) {
307 ue(chroma_sample_loc_type_top_field, 0, 5);
308 ue(chroma_sample_loc_type_bottom_field, 0, 5);
310 infer(chroma_sample_loc_type_top_field, 0);
311 infer(chroma_sample_loc_type_bottom_field, 0);
314 flag(neutral_chroma_indication_flag);
315 flag(field_seq_flag);
316 flag(frame_field_info_present_flag);
318 flag(default_display_window_flag);
319 if (current->default_display_window_flag) {
320 ue(def_disp_win_left_offset, 0, 16384);
321 ue(def_disp_win_right_offset, 0, 16384);
322 ue(def_disp_win_top_offset, 0, 16384);
323 ue(def_disp_win_bottom_offset, 0, 16384);
326 flag(vui_timing_info_present_flag);
327 if (current->vui_timing_info_present_flag) {
328 u(32, vui_num_units_in_tick, 1, UINT32_MAX);
329 u(32, vui_time_scale, 1, UINT32_MAX);
330 flag(vui_poc_proportional_to_timing_flag);
331 if (current->vui_poc_proportional_to_timing_flag)
332 ue(vui_num_ticks_poc_diff_one_minus1, 0, UINT32_MAX - 1);
334 flag(vui_hrd_parameters_present_flag);
335 if (current->vui_hrd_parameters_present_flag) {
337 1,
sps->sps_max_sub_layers_minus1));
341 flag(bitstream_restriction_flag);
342 if (current->bitstream_restriction_flag) {
343 flag(tiles_fixed_structure_flag);
344 flag(motion_vectors_over_pic_boundaries_flag);
345 flag(restricted_ref_pic_lists_flag);
346 ue(min_spatial_segmentation_idc, 0, 4095);
347 ue(max_bytes_per_pic_denom, 0, 16);
348 ue(max_bits_per_min_cu_denom, 0, 16);
349 ue(log2_max_mv_length_horizontal, 0, 16);
350 ue(log2_max_mv_length_vertical, 0, 16);
352 infer(tiles_fixed_structure_flag, 0);
353 infer(motion_vectors_over_pic_boundaries_flag, 1);
354 infer(min_spatial_segmentation_idc, 0);
355 infer(max_bytes_per_pic_denom, 2);
356 infer(max_bits_per_min_cu_denom, 1);
357 infer(log2_max_mv_length_horizontal, 15);
358 infer(log2_max_mv_length_vertical, 15);
369 HEADER(
"Video Parameter Set");
373 u(4, vps_video_parameter_set_id, 0, 15);
375 flag(vps_base_layer_internal_flag);
376 flag(vps_base_layer_available_flag);
379 flag(vps_temporal_id_nesting_flag);
381 if (current->vps_max_sub_layers_minus1 == 0 &&
382 current->vps_temporal_id_nesting_flag != 1) {
384 "vps_temporal_id_nesting_flag must be 1 if " 385 "vps_max_sub_layers_minus1 is 0.\n");
391 xu(16, vps_reserved_0xffff_16bits, ffff, 0xffff, 0xffff);
395 1, current->vps_max_sub_layers_minus1));
397 flag(vps_sub_layer_ordering_info_present_flag);
398 for (i = (current->vps_sub_layer_ordering_info_present_flag ?
399 0 : current->vps_max_sub_layers_minus1);
400 i <= current->vps_max_sub_layers_minus1; i++) {
402 ue(vps_max_num_reorder_pics[i], 0, current->vps_max_dec_pic_buffering_minus1[i]);
403 ue(vps_max_latency_increase_plus1[i], 0, UINT32_MAX - 1);
405 if (!current->vps_sub_layer_ordering_info_present_flag) {
406 for (i = 0; i < current->vps_max_sub_layers_minus1; i++) {
407 infer(vps_max_dec_pic_buffering_minus1[i],
408 current->vps_max_dec_pic_buffering_minus1[current->vps_max_sub_layers_minus1]);
409 infer(vps_max_num_reorder_pics[i],
410 current->vps_max_num_reorder_pics[current->vps_max_sub_layers_minus1]);
411 infer(vps_max_latency_increase_plus1[i],
412 current->vps_max_latency_increase_plus1[current->vps_max_sub_layers_minus1]);
418 for (i = 1; i <= current->vps_num_layer_sets_minus1; i++) {
419 for (j = 0; j <= current->vps_max_layer_id; j++)
420 flag(layer_id_included_flag[i][j]);
422 for (j = 0; j <= current->vps_max_layer_id; j++)
423 infer(layer_id_included_flag[0][j], j == 0);
425 flag(vps_timing_info_present_flag);
426 if (current->vps_timing_info_present_flag) {
427 u(32, vps_num_units_in_tick, 1, UINT32_MAX);
428 u(32, vps_time_scale, 1, UINT32_MAX);
429 flag(vps_poc_proportional_to_timing_flag);
430 if (current->vps_poc_proportional_to_timing_flag)
431 ue(vps_num_ticks_poc_diff_one_minus1, 0, UINT32_MAX - 1);
432 ue(vps_num_hrd_parameters, 0, current->vps_num_layer_sets_minus1 + 1);
433 for (i = 0; i < current->vps_num_hrd_parameters; i++) {
434 ue(hrd_layer_set_idx[i],
435 current->vps_base_layer_internal_flag ? 0 : 1,
436 current->vps_num_layer_sets_minus1);
438 flag(cprms_present_flag[i]);
440 infer(cprms_present_flag[0], 1);
443 current->cprms_present_flag[i],
444 current->vps_max_sub_layers_minus1));
448 flag(vps_extension_flag);
449 if (current->vps_extension_flag)
464 flag(inter_ref_pic_set_prediction_flag);
466 infer(inter_ref_pic_set_prediction_flag, 0);
468 if (current->inter_ref_pic_set_prediction_flag) {
469 unsigned int ref_rps_idx, num_delta_pocs;
471 int delta_rps, d_poc;
477 if (st_rps_idx ==
sps->num_short_term_ref_pic_sets)
478 ue(delta_idx_minus1, 0, st_rps_idx - 1);
480 infer(delta_idx_minus1, 0);
482 ref_rps_idx = st_rps_idx - (current->delta_idx_minus1 + 1);
483 ref = &
sps->st_ref_pic_set[ref_rps_idx];
484 num_delta_pocs = ref->num_negative_pics + ref->num_positive_pics;
486 flag(delta_rps_sign);
487 ue(abs_delta_rps_minus1, 0, INT16_MAX);
488 delta_rps = (1 - 2 * current->delta_rps_sign) *
489 (current->abs_delta_rps_minus1 + 1);
491 for (j = 0; j <= num_delta_pocs; j++) {
492 flag(used_by_curr_pic_flag[j]);
493 if (!current->used_by_curr_pic_flag[j])
494 flag(use_delta_flag[j]);
496 infer(use_delta_flag[j], 1);
516 for (i = 0; i < ref->num_negative_pics; i++) {
517 d_poc -= ref->delta_poc_s0_minus1[i] + 1;
518 ref_delta_poc_s0[i] = d_poc;
521 for (i = 0; i < ref->num_positive_pics; i++) {
522 d_poc += ref->delta_poc_s1_minus1[i] + 1;
523 ref_delta_poc_s1[i] = d_poc;
527 for (j = ref->num_positive_pics - 1; j >= 0; j--) {
528 d_poc = ref_delta_poc_s1[j] + delta_rps;
529 if (d_poc < 0 && current->use_delta_flag[ref->num_negative_pics + j]) {
530 delta_poc_s0[i] = d_poc;
531 used_by_curr_pic_s0[i++] =
532 current->used_by_curr_pic_flag[ref->num_negative_pics + j];
535 if (delta_rps < 0 && current->use_delta_flag[num_delta_pocs]) {
536 delta_poc_s0[i] = delta_rps;
537 used_by_curr_pic_s0[i++] =
538 current->used_by_curr_pic_flag[num_delta_pocs];
540 for (j = 0; j < ref->num_negative_pics; j++) {
541 d_poc = ref_delta_poc_s0[j] + delta_rps;
542 if (d_poc < 0 && current->use_delta_flag[j]) {
543 delta_poc_s0[i] = d_poc;
544 used_by_curr_pic_s0[i++] = current->used_by_curr_pic_flag[j];
548 infer(num_negative_pics, i);
549 for (i = 0; i < current->num_negative_pics; i++) {
550 infer(delta_poc_s0_minus1[i],
551 -(delta_poc_s0[i] - (i == 0 ? 0 : delta_poc_s0[i - 1])) - 1);
552 infer(used_by_curr_pic_s0_flag[i], used_by_curr_pic_s0[i]);
556 for (j = ref->num_negative_pics - 1; j >= 0; j--) {
557 d_poc = ref_delta_poc_s0[j] + delta_rps;
558 if (d_poc > 0 && current->use_delta_flag[j]) {
559 delta_poc_s1[i] = d_poc;
560 used_by_curr_pic_s1[i++] = current->used_by_curr_pic_flag[j];
563 if (delta_rps > 0 && current->use_delta_flag[num_delta_pocs]) {
564 delta_poc_s1[i] = delta_rps;
565 used_by_curr_pic_s1[i++] =
566 current->used_by_curr_pic_flag[num_delta_pocs];
568 for (j = 0; j < ref->num_positive_pics; j++) {
569 d_poc = ref_delta_poc_s1[j] + delta_rps;
570 if (d_poc > 0 && current->use_delta_flag[ref->num_negative_pics + j]) {
571 delta_poc_s1[i] = d_poc;
572 used_by_curr_pic_s1[i++] =
573 current->used_by_curr_pic_flag[ref->num_negative_pics + j];
577 infer(num_positive_pics, i);
578 for (i = 0; i < current->num_positive_pics; i++) {
579 infer(delta_poc_s1_minus1[i],
580 delta_poc_s1[i] - (i == 0 ? 0 : delta_poc_s1[i - 1]) - 1);
581 infer(used_by_curr_pic_s1_flag[i], used_by_curr_pic_s1[i]);
585 ue(num_negative_pics, 0, 15);
586 ue(num_positive_pics, 0, 15 - current->num_negative_pics);
588 for (i = 0; i < current->num_negative_pics; i++) {
589 ue(delta_poc_s0_minus1[i], 0, INT16_MAX);
590 flag(used_by_curr_pic_s0_flag[i]);
593 for (i = 0; i < current->num_positive_pics; i++) {
594 ue(delta_poc_s1_minus1[i], 0, INT16_MAX);
595 flag(used_by_curr_pic_s1_flag[i]);
605 int sizeId, matrixId;
608 for (sizeId = 0; sizeId < 4; sizeId++) {
609 for (matrixId = 0; matrixId < 6; matrixId += (sizeId == 3 ? 3 : 1)) {
610 flag(scaling_list_pred_mode_flag[sizeId][matrixId]);
611 if (!current->scaling_list_pred_mode_flag[sizeId][matrixId]) {
612 ue(scaling_list_pred_matrix_id_delta[sizeId][matrixId],
613 0, sizeId == 3 ? matrixId / 3 : matrixId);
615 n =
FFMIN(64, 1 << (4 + (sizeId << 1)));
617 se(scaling_list_dc_coef_minus8[sizeId - 2][matrixId], -7, +247);
618 for (i = 0; i <
n; i++) {
619 xse(scaling_list_delta_coeff,
620 current->scaling_list_delta_coeff[sizeId][matrixId][i],
635 flag(transform_skip_rotation_enabled_flag);
636 flag(transform_skip_context_enabled_flag);
637 flag(implicit_rdpcm_enabled_flag);
638 flag(explicit_rdpcm_enabled_flag);
639 flag(extended_precision_processing_flag);
640 flag(intra_smoothing_disabled_flag);
641 flag(high_precision_offsets_enabled_flag);
642 flag(persistent_rice_adaptation_enabled_flag);
643 flag(cabac_bypass_alignment_enabled_flag);
653 flag(sps_curr_pic_ref_enabled_flag);
655 flag(palette_mode_enabled_flag);
656 if (current->palette_mode_enabled_flag) {
657 ue(palette_max_size, 0, 64);
658 ue(delta_palette_max_predictor_size, 0, 128);
660 flag(sps_palette_predictor_initializer_present_flag);
661 if (current->sps_palette_predictor_initializer_present_flag) {
662 ue(sps_num_palette_predictor_initializer_minus1, 0, 128);
663 for (comp = 0; comp < (current->chroma_format_idc ? 3 : 1); comp++) {
664 int bit_depth = comp == 0 ? current->bit_depth_luma_minus8 + 8
665 : current->bit_depth_chroma_minus8 + 8;
666 for (i = 0; i <= current->sps_num_palette_predictor_initializer_minus1; i++)
667 u(bit_depth, sps_palette_predictor_initializers[comp][i],
673 u(2, motion_vector_resolution_control_idc, 0, 2);
674 flag(intra_boundary_filtering_disable_flag);
685 unsigned int min_cb_log2_size_y, ctb_log2_size_y,
686 min_cb_size_y, min_tb_log2_size_y;
688 HEADER(
"Sequence Parameter Set");
692 u(4, sps_video_parameter_set_id, 0, 15);
693 h265->
active_vps = vps = h265->
vps[current->sps_video_parameter_set_id];
696 flag(sps_temporal_id_nesting_flag);
700 "sps_max_sub_layers_minus1 (%d) must be less than or equal to " 701 "vps_max_sub_layers_minus1 (%d).\n",
703 current->sps_max_sub_layers_minus1);
707 !current->sps_temporal_id_nesting_flag) {
709 "sps_temporal_id_nesting_flag must be 1 if " 710 "vps_temporal_id_nesting_flag is 1.\n");
716 1, current->sps_max_sub_layers_minus1));
718 ue(sps_seq_parameter_set_id, 0, 15);
720 ue(chroma_format_idc, 0, 3);
721 if (current->chroma_format_idc == 3)
722 flag(separate_colour_plane_flag);
724 infer(separate_colour_plane_flag, 0);
729 flag(conformance_window_flag);
730 if (current->conformance_window_flag) {
731 ue(conf_win_left_offset, 0, current->pic_width_in_luma_samples);
732 ue(conf_win_right_offset, 0, current->pic_width_in_luma_samples);
733 ue(conf_win_top_offset, 0, current->pic_height_in_luma_samples);
734 ue(conf_win_bottom_offset, 0, current->pic_height_in_luma_samples);
736 infer(conf_win_left_offset, 0);
737 infer(conf_win_right_offset, 0);
738 infer(conf_win_top_offset, 0);
739 infer(conf_win_bottom_offset, 0);
742 ue(bit_depth_luma_minus8, 0, 8);
743 ue(bit_depth_chroma_minus8, 0, 8);
745 ue(log2_max_pic_order_cnt_lsb_minus4, 0, 12);
747 flag(sps_sub_layer_ordering_info_present_flag);
748 for (i = (current->sps_sub_layer_ordering_info_present_flag ?
749 0 : current->sps_max_sub_layers_minus1);
750 i <= current->sps_max_sub_layers_minus1; i++) {
752 ue(sps_max_num_reorder_pics[i], 0, current->sps_max_dec_pic_buffering_minus1[i]);
753 ue(sps_max_latency_increase_plus1[i], 0, UINT32_MAX - 1);
755 if (!current->sps_sub_layer_ordering_info_present_flag) {
756 for (i = 0; i < current->sps_max_sub_layers_minus1; i++) {
757 infer(sps_max_dec_pic_buffering_minus1[i],
758 current->sps_max_dec_pic_buffering_minus1[current->sps_max_sub_layers_minus1]);
759 infer(sps_max_num_reorder_pics[i],
760 current->sps_max_num_reorder_pics[current->sps_max_sub_layers_minus1]);
761 infer(sps_max_latency_increase_plus1[i],
762 current->sps_max_latency_increase_plus1[current->sps_max_sub_layers_minus1]);
766 ue(log2_min_luma_coding_block_size_minus3, 0, 3);
767 min_cb_log2_size_y = current->log2_min_luma_coding_block_size_minus3 + 3;
769 ue(log2_diff_max_min_luma_coding_block_size, 0, 3);
770 ctb_log2_size_y = min_cb_log2_size_y +
771 current->log2_diff_max_min_luma_coding_block_size;
773 min_cb_size_y = 1 << min_cb_log2_size_y;
774 if (current->pic_width_in_luma_samples % min_cb_size_y ||
775 current->pic_height_in_luma_samples % min_cb_size_y) {
777 "by MinCbSizeY = %u.\n", current->pic_width_in_luma_samples,
778 current->pic_height_in_luma_samples, min_cb_size_y);
782 ue(log2_min_luma_transform_block_size_minus2, 0, min_cb_log2_size_y - 3);
783 min_tb_log2_size_y = current->log2_min_luma_transform_block_size_minus2 + 2;
785 ue(log2_diff_max_min_luma_transform_block_size,
786 0,
FFMIN(ctb_log2_size_y, 5) - min_tb_log2_size_y);
788 ue(max_transform_hierarchy_depth_inter,
789 0, ctb_log2_size_y - min_tb_log2_size_y);
790 ue(max_transform_hierarchy_depth_intra,
791 0, ctb_log2_size_y - min_tb_log2_size_y);
793 flag(scaling_list_enabled_flag);
794 if (current->scaling_list_enabled_flag) {
795 flag(sps_scaling_list_data_present_flag);
796 if (current->sps_scaling_list_data_present_flag)
799 infer(sps_scaling_list_data_present_flag, 0);
802 flag(amp_enabled_flag);
803 flag(sample_adaptive_offset_enabled_flag);
805 flag(pcm_enabled_flag);
806 if (current->pcm_enabled_flag) {
807 u(4, pcm_sample_bit_depth_luma_minus1,
808 0, current->bit_depth_luma_minus8 + 8 - 1);
809 u(4, pcm_sample_bit_depth_chroma_minus1,
810 0, current->bit_depth_chroma_minus8 + 8 - 1);
812 ue(log2_min_pcm_luma_coding_block_size_minus3,
813 FFMIN(min_cb_log2_size_y, 5) - 3,
FFMIN(ctb_log2_size_y, 5) - 3);
814 ue(log2_diff_max_min_pcm_luma_coding_block_size,
815 0,
FFMIN(ctb_log2_size_y, 5) - (current->log2_min_pcm_luma_coding_block_size_minus3 + 3));
817 flag(pcm_loop_filter_disabled_flag);
821 for (i = 0; i < current->num_short_term_ref_pic_sets; i++)
824 flag(long_term_ref_pics_present_flag);
825 if (current->long_term_ref_pics_present_flag) {
827 for (i = 0; i < current->num_long_term_ref_pics_sps; i++) {
828 u(current->log2_max_pic_order_cnt_lsb_minus4 + 4,
829 lt_ref_pic_poc_lsb_sps[i],
830 0,
MAX_UINT_BITS(current->log2_max_pic_order_cnt_lsb_minus4 + 4));
831 flag(used_by_curr_pic_lt_sps_flag[i]);
835 flag(sps_temporal_mvp_enabled_flag);
836 flag(strong_intra_smoothing_enabled_flag);
838 flag(vui_parameters_present_flag);
839 if (current->vui_parameters_present_flag)
842 flag(sps_extension_present_flag);
843 if (current->sps_extension_present_flag) {
844 flag(sps_range_extension_flag);
845 flag(sps_multilayer_extension_flag);
846 flag(sps_3d_extension_flag);
847 flag(sps_scc_extension_flag);
851 if (current->sps_range_extension_flag)
853 if (current->sps_multilayer_extension_flag)
855 if (current->sps_3d_extension_flag)
857 if (current->sps_scc_extension_flag)
859 if (current->sps_extension_4bits)
874 if (current->transform_skip_enabled_flag)
875 ue(log2_max_transform_skip_block_size_minus2, 0, 3);
876 flag(cross_component_prediction_enabled_flag);
878 flag(chroma_qp_offset_list_enabled_flag);
879 if (current->chroma_qp_offset_list_enabled_flag) {
880 ue(diff_cu_chroma_qp_offset_depth,
882 ue(chroma_qp_offset_list_len_minus1, 0, 5);
883 for (i = 0; i <= current->chroma_qp_offset_list_len_minus1; i++) {
884 se(cb_qp_offset_list[i], -12, +12);
885 se(cr_qp_offset_list[i], -12, +12);
900 flag(pps_curr_pic_ref_enabled_flag);
902 flag(residual_adaptive_colour_transform_enabled_flag);
903 if (current->residual_adaptive_colour_transform_enabled_flag) {
904 flag(pps_slice_act_qp_offsets_present_flag);
905 se(pps_act_y_qp_offset_plus5, -7, +17);
906 se(pps_act_cb_qp_offset_plus5, -7, +17);
907 se(pps_act_cr_qp_offset_plus3, -9, +15);
909 infer(pps_slice_act_qp_offsets_present_flag, 0);
910 infer(pps_act_y_qp_offset_plus5, 0);
911 infer(pps_act_cb_qp_offset_plus5, 0);
912 infer(pps_act_cr_qp_offset_plus3, 0);
915 flag(pps_palette_predictor_initializer_present_flag);
916 if (current->pps_palette_predictor_initializer_present_flag) {
917 ue(pps_num_palette_predictor_initializer, 0, 128);
918 if (current->pps_num_palette_predictor_initializer > 0) {
919 flag(monochrome_palette_flag);
920 ue(luma_bit_depth_entry_minus8, 0, 8);
921 if (!current->monochrome_palette_flag)
922 ue(chroma_bit_depth_entry_minus8, 0, 8);
923 for (comp = 0; comp < (current->monochrome_palette_flag ? 1 : 3); comp++) {
924 int bit_depth = comp == 0 ? current->luma_bit_depth_entry_minus8 + 8
925 : current->chroma_bit_depth_entry_minus8 + 8;
926 for (i = 0; i < current->pps_num_palette_predictor_initializer; i++)
927 u(bit_depth, pps_palette_predictor_initializers[comp][i],
943 HEADER(
"Picture Parameter Set");
947 ue(pps_pic_parameter_set_id, 0, 63);
948 ue(pps_seq_parameter_set_id, 0, 15);
949 sps = h265->
sps[current->pps_seq_parameter_set_id];
952 current->pps_seq_parameter_set_id);
957 flag(dependent_slice_segments_enabled_flag);
958 flag(output_flag_present_flag);
959 u(3, num_extra_slice_header_bits, 0, 7);
960 flag(sign_data_hiding_enabled_flag);
961 flag(cabac_init_present_flag);
963 ue(num_ref_idx_l0_default_active_minus1, 0, 14);
964 ue(num_ref_idx_l1_default_active_minus1, 0, 14);
968 flag(constrained_intra_pred_flag);
969 flag(transform_skip_enabled_flag);
970 flag(cu_qp_delta_enabled_flag);
971 if (current->cu_qp_delta_enabled_flag)
972 ue(diff_cu_qp_delta_depth,
975 infer(diff_cu_qp_delta_depth, 0);
977 se(pps_cb_qp_offset, -12, +12);
978 se(pps_cr_qp_offset, -12, +12);
979 flag(pps_slice_chroma_qp_offsets_present_flag);
981 flag(weighted_pred_flag);
982 flag(weighted_bipred_flag);
984 flag(transquant_bypass_enabled_flag);
985 flag(tiles_enabled_flag);
986 flag(entropy_coding_sync_enabled_flag);
988 if (current->tiles_enabled_flag) {
991 flag(uniform_spacing_flag);
992 if (!current->uniform_spacing_flag) {
993 for (i = 0; i < current->num_tile_columns_minus1; i++)
995 for (i = 0; i < current->num_tile_rows_minus1; i++)
998 flag(loop_filter_across_tiles_enabled_flag);
1000 infer(num_tile_columns_minus1, 0);
1001 infer(num_tile_rows_minus1, 0);
1004 flag(pps_loop_filter_across_slices_enabled_flag);
1005 flag(deblocking_filter_control_present_flag);
1006 if (current->deblocking_filter_control_present_flag) {
1007 flag(deblocking_filter_override_enabled_flag);
1008 flag(pps_deblocking_filter_disabled_flag);
1009 if (!current->pps_deblocking_filter_disabled_flag) {
1010 se(pps_beta_offset_div2, -6, +6);
1011 se(pps_tc_offset_div2, -6, +6);
1013 infer(pps_beta_offset_div2, 0);
1014 infer(pps_tc_offset_div2, 0);
1017 infer(deblocking_filter_override_enabled_flag, 0);
1018 infer(pps_deblocking_filter_disabled_flag, 0);
1019 infer(pps_beta_offset_div2, 0);
1020 infer(pps_tc_offset_div2, 0);
1023 flag(pps_scaling_list_data_present_flag);
1024 if (current->pps_scaling_list_data_present_flag)
1027 flag(lists_modification_present_flag);
1029 ue(log2_parallel_merge_level_minus2,
1033 flag(slice_segment_header_extension_present_flag);
1035 flag(pps_extension_present_flag);
1036 if (current->pps_extension_present_flag) {
1037 flag(pps_range_extension_flag);
1038 flag(pps_multilayer_extension_flag);
1039 flag(pps_3d_extension_flag);
1040 flag(pps_scc_extension_flag);
1043 if (current->pps_range_extension_flag)
1045 if (current->pps_multilayer_extension_flag)
1047 if (current->pps_3d_extension_flag)
1049 if (current->pps_scc_extension_flag)
1051 if (current->pps_extension_4bits)
1064 HEADER(
"Access Unit Delimiter");
1068 u(3, pic_type, 0, 2);
1077 unsigned int num_pic_total_curr)
1079 unsigned int entry_size;
1082 entry_size =
av_log2(num_pic_total_curr - 1) + 1;
1084 flag(ref_pic_list_modification_flag_l0);
1085 if (current->ref_pic_list_modification_flag_l0) {
1086 for (i = 0; i <= current->num_ref_idx_l0_active_minus1; i++)
1087 u(entry_size, list_entry_l0[i], 0, num_pic_total_curr - 1);
1091 flag(ref_pic_list_modification_flag_l1);
1092 if (current->ref_pic_list_modification_flag_l1) {
1093 for (i = 0; i <= current->num_ref_idx_l1_active_minus1; i++)
1094 u(entry_size, list_entry_l1[i], 0, num_pic_total_curr - 1);
1110 ue(luma_log2_weight_denom, 0, 7);
1112 se(delta_chroma_log2_weight_denom, -7, 7);
1114 infer(delta_chroma_log2_weight_denom, 0);
1116 for (i = 0; i <= current->num_ref_idx_l0_active_minus1; i++) {
1118 flag(luma_weight_l0_flag[i]);
1120 infer(luma_weight_l0_flag[i], 0);
1123 for (i = 0; i <= current->num_ref_idx_l0_active_minus1; i++) {
1125 flag(chroma_weight_l0_flag[i]);
1127 infer(chroma_weight_l0_flag[i], 0);
1131 for (i = 0; i <= current->num_ref_idx_l0_active_minus1; i++) {
1132 if (current->luma_weight_l0_flag[i]) {
1133 se(delta_luma_weight_l0[i], -128, +127);
1134 se(luma_offset_l0[i],
1138 infer(delta_luma_weight_l0[i], 0);
1139 infer(luma_offset_l0[i], 0);
1141 if (current->chroma_weight_l0_flag[i]) {
1142 for (j = 0; j < 2; j++) {
1143 se(delta_chroma_weight_l0[i][j], -128, +127);
1144 se(chroma_offset_l0[i][j],
1149 for (j = 0; j < 2; j++) {
1150 infer(delta_chroma_weight_l0[i][j], 0);
1151 infer(chroma_offset_l0[i][j], 0);
1157 for (i = 0; i <= current->num_ref_idx_l1_active_minus1; i++) {
1159 flag(luma_weight_l1_flag[i]);
1161 infer(luma_weight_l1_flag[i], 0);
1164 for (i = 0; i <= current->num_ref_idx_l1_active_minus1; i++) {
1166 flag(chroma_weight_l1_flag[i]);
1168 infer(chroma_weight_l1_flag[i], 0);
1172 for (i = 0; i <= current->num_ref_idx_l1_active_minus1; i++) {
1173 if (current->luma_weight_l1_flag[i]) {
1174 se(delta_luma_weight_l1[i], -128, +127);
1175 se(luma_offset_l1[i],
1179 infer(delta_luma_weight_l1[i], 0);
1180 infer(luma_offset_l1[i], 0);
1182 if (current->chroma_weight_l1_flag[i]) {
1183 for (j = 0; j < 2; j++) {
1184 se(delta_chroma_weight_l1[i][j], -128, +127);
1185 se(chroma_offset_l1[i][j],
1190 for (j = 0; j < 2; j++) {
1191 infer(delta_chroma_weight_l1[i][j], 0);
1192 infer(chroma_offset_l1[i][j], 0);
1207 unsigned int min_cb_log2_size_y, ctb_log2_size_y, ctb_size_y;
1208 unsigned int pic_width_in_ctbs_y, pic_height_in_ctbs_y, pic_size_in_ctbs_y;
1209 unsigned int num_pic_total_curr = 0;
1212 HEADER(
"Slice Segment Header");
1216 flag(first_slice_segment_in_pic_flag);
1220 flag(no_output_of_prior_pics_flag);
1222 ue(slice_pic_parameter_set_id, 0, 63);
1224 pps = h265->
pps[current->slice_pic_parameter_set_id];
1227 current->slice_pic_parameter_set_id);
1242 ctb_size_y = 1 << ctb_log2_size_y;
1243 pic_width_in_ctbs_y =
1245 pic_height_in_ctbs_y =
1247 pic_size_in_ctbs_y = pic_width_in_ctbs_y * pic_height_in_ctbs_y;
1249 if (!current->first_slice_segment_in_pic_flag) {
1250 unsigned int address_size =
av_log2(pic_size_in_ctbs_y - 1) + 1;
1252 flag(dependent_slice_segment_flag);
1254 infer(dependent_slice_segment_flag, 0);
1255 u(address_size, slice_segment_address, 0, pic_size_in_ctbs_y - 1);
1257 infer(dependent_slice_segment_flag, 0);
1260 if (!current->dependent_slice_segment_flag) {
1262 flag(slice_reserved_flag[i]);
1264 ue(slice_type, 0, 2);
1267 flag(pic_output_flag);
1270 u(2, colour_plane_id, 0, 2);
1279 flag(short_term_ref_pic_set_sps_flag);
1280 if (!current->short_term_ref_pic_set_sps_flag) {
1283 rps = ¤t->short_term_ref_pic_set;
1286 u(idx_size, short_term_ref_pic_set_idx,
1290 infer(short_term_ref_pic_set_idx, 0);
1294 num_pic_total_curr = 0;
1297 ++num_pic_total_curr;
1300 ++num_pic_total_curr;
1303 unsigned int idx_size;
1309 infer(num_long_term_sps, 0);
1314 for (i = 0; i < current->num_long_term_sps +
1315 current->num_long_term_pics; i++) {
1316 if (i < current->num_long_term_sps) {
1318 u(idx_size, lt_idx_sps[i],
1321 ++num_pic_total_curr;
1325 flag(used_by_curr_pic_lt_flag[i]);
1326 if (current->used_by_curr_pic_lt_flag[i])
1327 ++num_pic_total_curr;
1329 flag(delta_poc_msb_present_flag[i]);
1330 if (current->delta_poc_msb_present_flag[i])
1331 ue(delta_poc_msb_cycle_lt[i], 0, UINT32_MAX - 1);
1333 infer(delta_poc_msb_cycle_lt[i], 0);
1338 flag(slice_temporal_mvp_enabled_flag);
1340 infer(slice_temporal_mvp_enabled_flag, 0);
1343 ++num_pic_total_curr;
1347 flag(slice_sao_luma_flag);
1349 flag(slice_sao_chroma_flag);
1351 infer(slice_sao_chroma_flag, 0);
1353 infer(slice_sao_luma_flag, 0);
1354 infer(slice_sao_chroma_flag, 0);
1359 flag(num_ref_idx_active_override_flag);
1360 if (current->num_ref_idx_active_override_flag) {
1361 ue(num_ref_idx_l0_active_minus1, 0, 14);
1363 ue(num_ref_idx_l1_active_minus1, 0, 14);
1373 num_pic_total_curr));
1376 flag(mvd_l1_zero_flag);
1378 flag(cabac_init_flag);
1380 infer(cabac_init_flag, 0);
1381 if (current->slice_temporal_mvp_enabled_flag) {
1383 flag(collocated_from_l0_flag);
1385 infer(collocated_from_l0_flag, 1);
1386 if (current->collocated_from_l0_flag) {
1387 if (current->num_ref_idx_l0_active_minus1 > 0)
1388 ue(collocated_ref_idx, 0, current->num_ref_idx_l0_active_minus1);
1390 infer(collocated_ref_idx, 0);
1392 if (current->num_ref_idx_l1_active_minus1 > 0)
1393 ue(collocated_ref_idx, 0, current->num_ref_idx_l1_active_minus1);
1395 infer(collocated_ref_idx, 0);
1403 ue(five_minus_max_num_merge_cand, 0, 4);
1405 flag(use_integer_mv_flag);
1414 se(slice_cb_qp_offset, -12, +12);
1415 se(slice_cr_qp_offset, -12, +12);
1417 infer(slice_cb_qp_offset, 0);
1418 infer(slice_cr_qp_offset, 0);
1421 se(slice_act_y_qp_offset,
1424 se(slice_act_cb_qp_offset,
1427 se(slice_act_cr_qp_offset,
1431 infer(slice_act_y_qp_offset, 0);
1432 infer(slice_act_cb_qp_offset, 0);
1433 infer(slice_act_cr_qp_offset, 0);
1436 flag(cu_chroma_qp_offset_enabled_flag);
1438 infer(cu_chroma_qp_offset_enabled_flag, 0);
1441 flag(deblocking_filter_override_flag);
1443 infer(deblocking_filter_override_flag, 0);
1444 if (current->deblocking_filter_override_flag) {
1445 flag(slice_deblocking_filter_disabled_flag);
1446 if (!current->slice_deblocking_filter_disabled_flag) {
1447 se(slice_beta_offset_div2, -6, +6);
1448 se(slice_tc_offset_div2, -6, +6);
1454 infer(slice_deblocking_filter_disabled_flag,
1460 (current->slice_sao_luma_flag || current->slice_sao_chroma_flag ||
1461 !current->slice_deblocking_filter_disabled_flag))
1462 flag(slice_loop_filter_across_slices_enabled_flag);
1464 infer(slice_loop_filter_across_slices_enabled_flag,
1469 unsigned int num_entry_point_offsets_limit;
1471 num_entry_point_offsets_limit = pic_height_in_ctbs_y - 1;
1473 num_entry_point_offsets_limit =
1476 num_entry_point_offsets_limit =
1478 ue(num_entry_point_offsets, 0, num_entry_point_offsets_limit);
1482 "%"PRIu16
".\n", current->num_entry_point_offsets);
1486 if (current->num_entry_point_offsets > 0) {
1487 ue(offset_len_minus1, 0, 31);
1488 for (i = 0; i < current->num_entry_point_offsets; i++)
1489 u(current->offset_len_minus1 + 1, entry_point_offset_minus1[i],
1495 ue(slice_segment_header_extension_length, 0, 256);
1496 for (i = 0; i < current->slice_segment_header_extension_length; i++)
1497 u(8, slice_segment_header_extension_data_byte[i], 0x00, 0xff);
#define allocate(name, size)
H265RawPPS * pps[HEVC_MAX_PPS_COUNT]
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int FUNC() byte_alignment(CodedBitstreamContext *ctx, RWContext *rw)
#define se(name, range_min, range_max)
uint8_t deblocking_filter_override_enabled_flag
uint8_t num_ref_idx_l0_default_active_minus1
static int FUNC() sub_layer_hrd_parameters(CodedBitstreamContext *ctx, RWContext *rw, H265RawHRDParameters *hrd, int nal, int sub_layer_id)
uint8_t chroma_qp_offset_list_enabled_flag
uint8_t bit_depth_luma_minus8
static int FUNC() sps_scc_extension(CodedBitstreamContext *ctx, RWContext *rw, H265RawSPS *current)
static int FUNC() pred_weight_table(CodedBitstreamContext *ctx, RWContext *rw, H265RawSliceHeader *current)
int8_t pps_act_y_qp_offset_plus5
static int FUNC() hrd_parameters(CodedBitstreamContext *ctx, RWContext *rw, H265RawHRDParameters *current, int common_inf_present_flag, int max_num_sub_layers_minus1)
uint8_t tiles_enabled_flag
H265RawSTRefPicSet st_ref_pic_set[HEVC_MAX_SHORT_TERM_REF_PIC_SETS]
static int FUNC() slice_segment_header(CodedBitstreamContext *ctx, RWContext *rw, H265RawSliceHeader *current)
uint8_t pps_slice_chroma_qp_offsets_present_flag
static int FUNC() pps_scc_extension(CodedBitstreamContext *ctx, RWContext *rw, H265RawPPS *current)
uint8_t sample_adaptive_offset_enabled_flag
uint8_t bit_depth_chroma_minus8
uint8_t used_by_curr_pic_s0_flag[HEVC_MAX_REFS]
static int FUNC() extension_data(CodedBitstreamContext *ctx, RWContext *rw, H265RawPSExtensionData *current)
uint16_t pic_height_in_luma_samples
static int FUNC() pps_range_extension(CodedBitstreamContext *ctx, RWContext *rw, H265RawPPS *current)
static int FUNC() ref_pic_lists_modification(CodedBitstreamContext *ctx, RWContext *rw, H265RawSliceHeader *current, unsigned int num_pic_total_curr)
#define MAX_UINT_BITS(length)
#define u(width, name, range_min, range_max)
uint8_t log2_max_pic_order_cnt_lsb_minus4
H265RawSPS * sps[HEVC_MAX_SPS_COUNT]
static int FUNC() vui_parameters(CodedBitstreamContext *ctx, RWContext *rw, H265RawVUI *current, const H265RawSPS *sps)
uint8_t vps_max_sub_layers_minus1
#define infer(name, value)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
uint8_t pps_slice_act_qp_offsets_present_flag
static int FUNC() st_ref_pic_set(CodedBitstreamContext *ctx, RWContext *rw, H265RawSTRefPicSet *current, int st_rps_idx, const H265RawSPS *sps)
#define ue(name, range_min, range_max)
uint8_t num_negative_pics
uint8_t motion_vector_resolution_control_idc
static const struct TransferCharacteristics transfer_characteristics[AVCOL_TRC_NB]
#define profile_compatible(x)
uint8_t num_long_term_ref_pics_sps
static void bit_depth(AudioStatsContext *s, uint64_t mask, uint64_t imask, AVRational *depth)
int8_t pps_beta_offset_div2
uint8_t pps_deblocking_filter_disabled_flag
static int FUNC() pps(CodedBitstreamContext *ctx, RWContext *rw, H265RawPPS *current)
uint16_t pic_width_in_luma_samples
uint8_t lists_modification_present_flag
uint8_t log2_min_luma_coding_block_size_minus3
uint8_t pps_seq_parameter_set_id
uint8_t cabac_init_present_flag
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
static int FUNC() aud(CodedBitstreamContext *ctx, RWContext *rw, H265RawAUD *current)
uint8_t used_by_curr_pic_s1_flag[HEVC_MAX_REFS]
uint8_t num_extra_slice_header_bits
const H265RawSPS * active_sps
static int FUNC() scaling_list_data(CodedBitstreamContext *ctx, RWContext *rw, H265RawScalingList *current)
uint8_t entropy_coding_sync_enabled_flag
uint8_t output_flag_present_flag
uint8_t weighted_bipred_flag
uint8_t dependent_slice_segments_enabled_flag
uint8_t sps_temporal_mvp_enabled_flag
uint8_t pps_loop_filter_across_slices_enabled_flag
uint8_t weighted_pred_flag
static void skip_bits(GetBitContext *s, int n)
Context structure for coded bitstream operations.
CHECK(-1) CHECK(-2) }} }} CHECK(1) CHECK(2) }} }} } if(diff0+diff1 > 0) temp -
const H265RawVPS * active_vps
static int FUNC() profile_tier_level(CodedBitstreamContext *ctx, RWContext *rw, H265RawProfileTierLevel *current, int profile_present_flag, int max_num_sub_layers_minus1)
uint8_t chroma_format_idc
static int cbs_h2645_read_more_rbsp_data(GetBitContext *gbc)
const H265RawPPS * active_pps
static int FUNC() vps(CodedBitstreamContext *ctx, RWContext *rw, H265RawVPS *current)
uint8_t num_positive_pics
static int FUNC() nal_unit_header(CodedBitstreamContext *ctx, RWContext *rw, H265RawNALUnitHeader *current, int expected_nal_unit_type)
static int ref[MAX_W *MAX_W]
uint8_t num_tile_rows_minus1
int8_t pps_act_cb_qp_offset_plus5
uint8_t num_tile_columns_minus1
uint8_t log2_diff_max_min_luma_coding_block_size
#define xse(name, var, range_min, range_max)
uint8_t used_by_curr_pic_lt_sps_flag[HEVC_MAX_LONG_TERM_REF_PICS]
void * priv_data
Format private data.
uint8_t num_short_term_ref_pic_sets
static int FUNC() sps(CodedBitstreamContext *ctx, RWContext *rw, H265RawSPS *current)
uint8_t vps_temporal_id_nesting_flag
int8_t pps_tc_offset_div2
static int FUNC() sps_range_extension(CodedBitstreamContext *ctx, RWContext *rw, H265RawSPS *current)
uint8_t pps_curr_pic_ref_enabled_flag
uint8_t slice_segment_header_extension_present_flag
H265RawVPS * vps[HEVC_MAX_VPS_COUNT]
uint8_t separate_colour_plane_flag
static int FUNC() rbsp_trailing_bits(CodedBitstreamContext *ctx, RWContext *rw)
uint8_t long_term_ref_pics_present_flag
#define xu(width, name, var, range_min, range_max)
int8_t pps_act_cr_qp_offset_plus3
uint8_t num_ref_idx_l1_default_active_minus1