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;
59 h->common.afd.present = 0;
73 if (
sps->nal_hrd_parameters_present_flag ||
74 sps->vcl_hrd_parameters_present_flag) {
78 if (
sps->pic_struct_present_flag) {
79 unsigned int i, num_clock_ts;
89 for (
i = 0;
i < num_clock_ts;
i++) {
92 unsigned int full_timestamp_flag;
93 unsigned int counting_type, cnt_dropped_flag;
97 full_timestamp_flag =
get_bits(&gb, 1);
100 if (cnt_dropped_flag && counting_type > 1 && counting_type < 7)
103 if (full_timestamp_flag) {
120 if (
sps->time_offset_length > 0)
122 sps->time_offset_length);
127 h->ct_type,
h->pic_struct);
138 if (
size >
sizeof(
h->payload)) {
144 h->payload_size_bytes =
size;
155 av_log(logctx,
AV_LOG_ERROR,
"recovery_frame_cnt %u is out of range\n", recovery_frame_cnt);
159 h->recovery_frame_cnt = recovery_frame_cnt;
176 if (sps_id > 31 || !ps->
sps_list[sps_id]) {
178 "non-existing SPS %d referenced in buffering period\n", sps_id);
184 if (
sps->nal_hrd_parameters_present_flag) {
185 for (sched_sel_idx = 0; sched_sel_idx <
sps->cpb_cnt; sched_sel_idx++) {
186 h->initial_cpb_removal_delay[sched_sel_idx] =
192 if (
sps->vcl_hrd_parameters_present_flag) {
193 for (sched_sel_idx = 0; sched_sel_idx <
sps->cpb_cnt; sched_sel_idx++) {
194 h->initial_cpb_removal_delay[sched_sel_idx] =
207 h->green_metadata_type = bytestream2_get_byte(gb);
209 if (
h->green_metadata_type == 0) {
210 h->period_type = bytestream2_get_byte(gb);
212 if (
h->period_type == 2)
213 h->num_seconds = bytestream2_get_be16(gb);
214 else if (
h->period_type == 3)
215 h->num_pictures = bytestream2_get_be16(gb);
217 h->percent_non_zero_macroblocks = bytestream2_get_byte(gb);
218 h->percent_intra_coded_macroblocks = bytestream2_get_byte(gb);
219 h->percent_six_tap_filtering = bytestream2_get_byte(gb);
220 h->percent_alpha_point_deblocking_instance = bytestream2_get_byte(gb);
222 }
else if (
h->green_metadata_type == 1) {
223 h->xsd_metric_type = bytestream2_get_byte(gb);
224 h->xsd_metric_value = bytestream2_get_be16(gb);
250 type += bytestream2_peek_byteu(&gbyte);
251 }
while (bytestream2_get_byteu(&gbyte) == 255);
256 size += bytestream2_peek_byteu(&gbyte);
257 }
while (bytestream2_get_byteu(&gbyte) == 255);
285 &gb_payload, &gbyte_payload, logctx);
307 if (
h->arrangement_cancel_flag == 0) {
308 switch (
h->arrangement_type) {
310 if (
h->content_interpretation_type == 2)
311 return "checkerboard_rl";
313 return "checkerboard_lr";
315 if (
h->content_interpretation_type == 2)
316 return "col_interleaved_rl";
318 return "col_interleaved_lr";
320 if (
h->content_interpretation_type == 2)
321 return "row_interleaved_rl";
323 return "row_interleaved_lr";
325 if (
h->content_interpretation_type == 2)
330 if (
h->content_interpretation_type == 2)
335 if (
h->content_interpretation_type == 2)
343 }
else if (
h->arrangement_cancel_flag == 1) {