42 #define AVERROR_PS_NOT_FOUND FFERRTAG(0xF8,'?','P','S')
45 1, 1, 1, 2, 2, 3, 3, 2, 3
50 h->recovery_point.recovery_frame_cnt = -1;
52 h->picture_timing.dpb_output_delay = 0;
53 h->picture_timing.cpb_removal_delay = -1;
55 h->picture_timing.present = 0;
56 h->buffering_period.present = 0;
57 h->common.frame_packing.present = 0;
58 h->common.film_grain_characteristics.present = 0;
59 h->common.display_orientation.present = 0;
60 h->common.afd.present = 0;
74 if (
sps->nal_hrd_parameters_present_flag ||
75 sps->vcl_hrd_parameters_present_flag) {
79 if (
sps->pic_struct_present_flag) {
80 unsigned int i, num_clock_ts;
90 for (
i = 0;
i < num_clock_ts;
i++) {
93 unsigned int full_timestamp_flag;
94 unsigned int counting_type, cnt_dropped_flag;
98 full_timestamp_flag =
get_bits(&gb, 1);
100 cnt_dropped_flag =
get_bits(&gb, 1);
101 if (cnt_dropped_flag && counting_type > 1 && counting_type < 7)
104 if (full_timestamp_flag) {
121 if (
sps->time_offset_length > 0)
123 sps->time_offset_length);
128 h->ct_type,
h->pic_struct);
139 if (
size >
sizeof(
h->payload)) {
145 h->payload_size_bytes =
size;
156 av_log(logctx,
AV_LOG_ERROR,
"recovery_frame_cnt %u is out of range\n", recovery_frame_cnt);
160 h->recovery_frame_cnt = recovery_frame_cnt;
177 if (sps_id > 31 || !ps->
sps_list[sps_id]) {
179 "non-existing SPS %d referenced in buffering period\n", sps_id);
185 if (
sps->nal_hrd_parameters_present_flag) {
186 for (sched_sel_idx = 0; sched_sel_idx <
sps->cpb_cnt; sched_sel_idx++) {
187 h->initial_cpb_removal_delay[sched_sel_idx] =
193 if (
sps->vcl_hrd_parameters_present_flag) {
194 for (sched_sel_idx = 0; sched_sel_idx <
sps->cpb_cnt; sched_sel_idx++) {
195 h->initial_cpb_removal_delay[sched_sel_idx] =
208 h->green_metadata_type = bytestream2_get_byte(gb);
210 if (
h->green_metadata_type == 0) {
211 h->period_type = bytestream2_get_byte(gb);
213 if (
h->period_type == 2)
214 h->num_seconds = bytestream2_get_be16(gb);
215 else if (
h->period_type == 3)
216 h->num_pictures = bytestream2_get_be16(gb);
218 h->percent_non_zero_macroblocks = bytestream2_get_byte(gb);
219 h->percent_intra_coded_macroblocks = bytestream2_get_byte(gb);
220 h->percent_six_tap_filtering = bytestream2_get_byte(gb);
221 h->percent_alpha_point_deblocking_instance = bytestream2_get_byte(gb);
223 }
else if (
h->green_metadata_type == 1) {
224 h->xsd_metric_type = bytestream2_get_byte(gb);
225 h->xsd_metric_value = bytestream2_get_be16(gb);
251 type += bytestream2_peek_byteu(&gbyte);
252 }
while (bytestream2_get_byteu(&gbyte) == 255);
257 size += bytestream2_peek_byteu(&gbyte);
258 }
while (bytestream2_get_byteu(&gbyte) == 255);
286 &gb_payload, &gbyte_payload, logctx);
308 if (
h->arrangement_cancel_flag == 0) {
309 switch (
h->arrangement_type) {
311 if (
h->content_interpretation_type == 2)
312 return "checkerboard_rl";
314 return "checkerboard_lr";
316 if (
h->content_interpretation_type == 2)
317 return "col_interleaved_rl";
319 return "col_interleaved_lr";
321 if (
h->content_interpretation_type == 2)
322 return "row_interleaved_rl";
324 return "row_interleaved_lr";
326 if (
h->content_interpretation_type == 2)
331 if (
h->content_interpretation_type == 2)
336 if (
h->content_interpretation_type == 2)
344 }
else if (
h->arrangement_cancel_flag == 1) {