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.display_orientation.present = 0;
72 if (
sps->nal_hrd_parameters_present_flag ||
73 sps->vcl_hrd_parameters_present_flag) {
77 if (
sps->pic_struct_present_flag) {
78 unsigned int i, num_clock_ts;
88 for (
i = 0;
i < num_clock_ts;
i++) {
91 unsigned int full_timestamp_flag;
92 unsigned int counting_type, cnt_dropped_flag;
96 full_timestamp_flag =
get_bits(&gb, 1);
99 if (cnt_dropped_flag && counting_type > 1 && counting_type < 7)
102 if (full_timestamp_flag) {
119 if (
sps->time_offset_length > 0)
121 sps->time_offset_length);
126 h->ct_type,
h->pic_struct);
137 if (
size >
sizeof(
h->payload)) {
143 h->payload_size_bytes =
size;
154 av_log(logctx,
AV_LOG_ERROR,
"recovery_frame_cnt %u is out of range\n", recovery_frame_cnt);
158 h->recovery_frame_cnt = recovery_frame_cnt;
175 if (sps_id > 31 || !ps->
sps_list[sps_id]) {
177 "non-existing SPS %d referenced in buffering period\n", sps_id);
183 if (
sps->nal_hrd_parameters_present_flag) {
184 for (sched_sel_idx = 0; sched_sel_idx <
sps->cpb_cnt; sched_sel_idx++) {
185 h->initial_cpb_removal_delay[sched_sel_idx] =
191 if (
sps->vcl_hrd_parameters_present_flag) {
192 for (sched_sel_idx = 0; sched_sel_idx <
sps->cpb_cnt; sched_sel_idx++) {
193 h->initial_cpb_removal_delay[sched_sel_idx] =
206 h->green_metadata_type = bytestream2_get_byte(gb);
208 if (
h->green_metadata_type == 0) {
209 h->period_type = bytestream2_get_byte(gb);
211 if (
h->period_type == 2)
212 h->num_seconds = bytestream2_get_be16(gb);
213 else if (
h->period_type == 3)
214 h->num_pictures = bytestream2_get_be16(gb);
216 h->percent_non_zero_macroblocks = bytestream2_get_byte(gb);
217 h->percent_intra_coded_macroblocks = bytestream2_get_byte(gb);
218 h->percent_six_tap_filtering = bytestream2_get_byte(gb);
219 h->percent_alpha_point_deblocking_instance = bytestream2_get_byte(gb);
221 }
else if (
h->green_metadata_type == 1) {
222 h->xsd_metric_type = bytestream2_get_byte(gb);
223 h->xsd_metric_value = bytestream2_get_be16(gb);
249 type += bytestream2_peek_byteu(&gbyte);
250 }
while (bytestream2_get_byteu(&gbyte) == 255);
255 size += bytestream2_peek_byteu(&gbyte);
256 }
while (bytestream2_get_byteu(&gbyte) == 255);
284 &gb_payload, &gbyte_payload, logctx);
306 if (
h->arrangement_cancel_flag == 0) {
307 switch (
h->arrangement_type) {
309 if (
h->content_interpretation_type == 2)
310 return "checkerboard_rl";
312 return "checkerboard_lr";
314 if (
h->content_interpretation_type == 2)
315 return "col_interleaved_rl";
317 return "col_interleaved_lr";
319 if (
h->content_interpretation_type == 2)
320 return "row_interleaved_rl";
322 return "row_interleaved_lr";
324 if (
h->content_interpretation_type == 2)
329 if (
h->content_interpretation_type == 2)
334 if (
h->content_interpretation_type == 2)
342 }
else if (
h->arrangement_cancel_flag == 1) {