29 #define MAX_SPATIAL_SEGMENTATION 4096 // max. value of u(12) field
126 unsigned int max_sub_layers_minus1)
141 for (i = 0; i < max_sub_layers_minus1; i++) {
142 sub_layer_profile_present_flag[i] =
get_bits1(gb);
143 sub_layer_level_present_flag[i] =
get_bits1(gb);
146 if (max_sub_layers_minus1 > 0)
147 for (i = max_sub_layers_minus1; i < 8; i++)
150 for (i = 0; i < max_sub_layers_minus1; i++) {
151 if (sub_layer_profile_present_flag[i]) {
168 if (sub_layer_level_present_flag[i])
174 unsigned int cpb_cnt_minus1,
175 uint8_t sub_pic_hrd_params_present_flag)
179 for (i = 0; i <= cpb_cnt_minus1; i++) {
183 if (sub_pic_hrd_params_present_flag) {
193 unsigned int max_sub_layers_minus1)
196 uint8_t sub_pic_hrd_params_present_flag = 0;
197 uint8_t nal_hrd_parameters_present_flag = 0;
198 uint8_t vcl_hrd_parameters_present_flag = 0;
200 if (cprms_present_flag) {
201 nal_hrd_parameters_present_flag =
get_bits1(gb);
202 vcl_hrd_parameters_present_flag =
get_bits1(gb);
204 if (nal_hrd_parameters_present_flag ||
205 vcl_hrd_parameters_present_flag) {
206 sub_pic_hrd_params_present_flag =
get_bits1(gb);
208 if (sub_pic_hrd_params_present_flag)
223 if (sub_pic_hrd_params_present_flag)
235 for (i = 0; i <= max_sub_layers_minus1; i++) {
236 unsigned int cpb_cnt_minus1 = 0;
237 uint8_t low_delay_hrd_flag = 0;
238 uint8_t fixed_pic_rate_within_cvs_flag = 0;
241 if (!fixed_pic_rate_general_flag)
242 fixed_pic_rate_within_cvs_flag =
get_bits1(gb);
244 if (fixed_pic_rate_within_cvs_flag)
249 if (!low_delay_hrd_flag)
252 if (nal_hrd_parameters_present_flag)
254 sub_pic_hrd_params_present_flag);
256 if (vcl_hrd_parameters_present_flag)
258 sub_pic_hrd_params_present_flag);
273 unsigned int max_sub_layers_minus1)
275 unsigned int min_spatial_segmentation_idc;
340 min_spatial_segmentation_idc);
359 unsigned int vps_max_sub_layers_minus1;
368 vps_max_sub_layers_minus1 =
get_bits(gb, 3);
379 vps_max_sub_layers_minus1 + 1);
395 int i, j, k, num_coeffs;
397 for (i = 0; i < 4; i++)
398 for (j = 0; j < (i == 3 ? 2 : 6); j++)
402 num_coeffs =
FFMIN(64, 1 << (4 + (i << 1)));
407 for (k = 0; k < num_coeffs; k++)
413 unsigned int num_rps,
420 if (rps_idx >= num_rps)
426 num_delta_pocs[rps_idx] = 0;
447 for (i = 0; i < num_delta_pocs[rps_idx - 1]; i++) {
450 if (!used_by_curr_pic_flag)
453 if (used_by_curr_pic_flag || use_delta_flag)
454 num_delta_pocs[rps_idx]++;
460 num_delta_pocs[rps_idx] = num_negative_pics + num_positive_pics;
462 for (i = 0; i < num_negative_pics; i++) {
467 for (i = 0; i < num_positive_pics; i++) {
479 unsigned int i, sps_max_sub_layers_minus1, log2_max_pic_order_cnt_lsb_minus4;
484 sps_max_sub_layers_minus1 =
get_bits (gb, 3);
495 sps_max_sub_layers_minus1 + 1);
523 i =
get_bits1(gb) ? 0 : sps_max_sub_layers_minus1;
524 for (; i <= sps_max_sub_layers_minus1; i++)
553 for (i = 0; i < num_short_term_ref_pic_sets; i++) {
554 int ret =
parse_rps(gb, i, num_short_term_ref_pic_sets, num_delta_pocs);
561 int len =
FFMIN(log2_max_pic_order_cnt_lsb_minus4 + 4, 16);
580 uint8_t tiles_enabled_flag, entropy_coding_sync_enabled_flag;
618 entropy_coding_sync_enabled_flag =
get_bits1(gb);
620 if (entropy_coding_sync_enabled_flag && tiles_enabled_flag)
622 else if (entropy_coding_sync_enabled_flag)
624 else if (tiles_enabled_flag)
645 while (i < 2 && i < src_len)
646 dst[len++] = src[i++];
648 while (i + 2 < src_len)
649 if (!src[i] && !src[i + 1] && src[i + 2] == 3) {
650 dst[len++] = src[i++];
651 dst[len++] = src[i++];
654 dst[len++] = src[i++];
657 dst[len++] = src[i++];
679 uint8_t nal_type,
int ps_array_completeness,
687 for (index = 0; index < hvcc->
numOfArrays; index++)
714 array->
nalUnit [numNalus] = nal_buf;
732 int ps_array_completeness,
765 ps_array_completeness, hvcc);
824 uint16_t j, vps_count = 0, sps_count = 0, pps_count = 0;
852 av_dlog(NULL,
"configurationVersion: %"PRIu8
"\n",
854 av_dlog(NULL,
"general_profile_space: %"PRIu8
"\n",
856 av_dlog(NULL,
"general_tier_flag: %"PRIu8
"\n",
858 av_dlog(NULL,
"general_profile_idc: %"PRIu8
"\n",
860 av_dlog(NULL,
"general_profile_compatibility_flags: 0x%08"PRIx32
"\n",
862 av_dlog(NULL,
"general_constraint_indicator_flags: 0x%012"PRIx64
"\n",
864 av_dlog(NULL,
"general_level_idc: %"PRIu8
"\n",
866 av_dlog(NULL,
"min_spatial_segmentation_idc: %"PRIu16
"\n",
868 av_dlog(NULL,
"parallelismType: %"PRIu8
"\n",
870 av_dlog(NULL,
"chromaFormat: %"PRIu8
"\n",
872 av_dlog(NULL,
"bitDepthLumaMinus8: %"PRIu8
"\n",
874 av_dlog(NULL,
"bitDepthChromaMinus8: %"PRIu8
"\n",
876 av_dlog(NULL,
"avgFrameRate: %"PRIu16
"\n",
878 av_dlog(NULL,
"constantFrameRate: %"PRIu8
"\n",
880 av_dlog(NULL,
"numTemporalLayers: %"PRIu8
"\n",
882 av_dlog(NULL,
"temporalIdNested: %"PRIu8
"\n",
884 av_dlog(NULL,
"lengthSizeMinusOne: %"PRIu8
"\n",
886 av_dlog(NULL,
"numOfArrays: %"PRIu8
"\n",
889 av_dlog(NULL,
"array_completeness[%"PRIu8
"]: %"PRIu8
"\n",
891 av_dlog(NULL,
"NAL_unit_type[%"PRIu8
"]: %"PRIu8
"\n",
893 av_dlog(NULL,
"numNalus[%"PRIu8
"]: %"PRIu16
"\n",
897 "nalUnitLength[%"PRIu8
"][%"PRIu16
"]: %"PRIu16
"\n",
1018 int size,
int filter_ps,
int *ps_count)
1020 int num_ps = 0,
ret = 0;
1036 while (end - buf > 4) {
1066 int *
size,
int filter_ps,
int *ps_count)
1082 int size,
int ps_array_completeness)
1094 }
else if (*data == 1) {
1111 while (end - buf > 4) {