27 fc(1, obu_forbidden_bit, 0, 0);
30 flag(obu_extension_flag);
31 flag(obu_has_size_field);
33 fc(1, obu_reserved_1bit, 0, 0);
35 if (current->obu_extension_flag) {
38 fc(3, extension_header_reserved_3bits, 0, 0);
50 fixed(1, trailing_one_bit, 1);
54 fixed(1, trailing_zero_bit, 0);
66 fixed(1, zero_bit, 0);
80 current->high_bitdepth) {
82 priv->
bit_depth = current->twelve_bit ? 12 : 10;
84 priv->
bit_depth = current->high_bitdepth ? 10 : 8;
88 infer(mono_chrome, 0);
91 priv->
num_planes = current->mono_chrome ? 1 : 3;
93 flag(color_description_present_flag);
94 if (current->color_description_present_flag) {
97 fb(8, matrix_coefficients);
104 if (current->mono_chrome) {
107 infer(subsampling_x, 1);
108 infer(subsampling_y, 1);
110 infer(separate_uv_delta_q, 0);
116 infer(subsampling_x, 0);
117 infer(subsampling_y, 0);
118 flag(separate_uv_delta_q);
124 infer(subsampling_x, 1);
125 infer(subsampling_y, 1);
127 infer(subsampling_x, 0);
128 infer(subsampling_y, 0);
131 fb(1, subsampling_x);
132 if (current->subsampling_x)
133 fb(1, subsampling_y);
135 infer(subsampling_y, 0);
137 infer(subsampling_x, 1);
138 infer(subsampling_y, 0);
141 if (current->subsampling_x && current->subsampling_y) {
146 flag(separate_uv_delta_q);
160 flag(equal_picture_interval);
161 if (current->equal_picture_interval)
172 fb(5, buffer_delay_length_minus_1);
173 fb(32, num_units_in_decoding_tick);
174 fb(5, buffer_removal_time_length_minus_1);
175 fb(5, frame_presentation_time_length_minus_1);
185 HEADER(
"Sequence Header");
190 flag(reduced_still_picture_header);
192 if (current->reduced_still_picture_header) {
193 infer(timing_info_present_flag, 0);
194 infer(decoder_model_info_present_flag, 0);
195 infer(initial_display_delay_present_flag, 0);
196 infer(operating_points_cnt_minus_1, 0);
197 infer(operating_point_idc[0], 0);
199 fb(5, seq_level_idx[0]);
201 infer(seq_tier[0], 0);
202 infer(decoder_model_present_for_this_op[0], 0);
203 infer(initial_display_delay_present_for_this_op[0], 0);
206 flag(timing_info_present_flag);
207 if (current->timing_info_present_flag) {
210 flag(decoder_model_info_present_flag);
211 if (current->decoder_model_info_present_flag) {
213 (
ctx, rw, ¤t->decoder_model_info));
216 infer(decoder_model_info_present_flag, 0);
219 flag(initial_display_delay_present_flag);
221 fb(5, operating_points_cnt_minus_1);
222 for (i = 0; i <= current->operating_points_cnt_minus_1; i++) {
223 fbs(12, operating_point_idc[i], 1, i);
224 fbs(5, seq_level_idx[i], 1, i);
226 if (current->seq_level_idx[i] > 7)
227 flags(seq_tier[i], 1, i);
229 infer(seq_tier[i], 0);
231 if (current->decoder_model_info_present_flag) {
232 flags(decoder_model_present_for_this_op[i], 1, i);
233 if (current->decoder_model_present_for_this_op[i]) {
234 int n = current->decoder_model_info.buffer_delay_length_minus_1 + 1;
235 fbs(n, decoder_buffer_delay[i], 1, i);
236 fbs(n, encoder_buffer_delay[i], 1, i);
237 flags(low_delay_mode_flag[i], 1, i);
240 infer(decoder_model_present_for_this_op[i], 0);
243 if (current->initial_display_delay_present_flag) {
244 flags(initial_display_delay_present_for_this_op[i], 1, i);
245 if (current->initial_display_delay_present_for_this_op[i])
246 fbs(4, initial_display_delay_minus_1[i], 1, i);
251 fb(4, frame_width_bits_minus_1);
252 fb(4, frame_height_bits_minus_1);
254 fb(current->frame_width_bits_minus_1 + 1, max_frame_width_minus_1);
255 fb(current->frame_height_bits_minus_1 + 1, max_frame_height_minus_1);
257 if (current->reduced_still_picture_header)
258 infer(frame_id_numbers_present_flag, 0);
260 flag(frame_id_numbers_present_flag);
261 if (current->frame_id_numbers_present_flag) {
262 fb(4, delta_frame_id_length_minus_2);
263 fb(3, additional_frame_id_length_minus_1);
266 flag(use_128x128_superblock);
267 flag(enable_filter_intra);
268 flag(enable_intra_edge_filter);
270 if (current->reduced_still_picture_header) {
271 infer(enable_intraintra_compound, 0);
272 infer(enable_masked_compound, 0);
273 infer(enable_warped_motion, 0);
274 infer(enable_dual_filter, 0);
275 infer(enable_order_hint, 0);
276 infer(enable_jnt_comp, 0);
277 infer(enable_ref_frame_mvs, 0);
279 infer(seq_force_screen_content_tools,
281 infer(seq_force_integer_mv,
284 flag(enable_intraintra_compound);
285 flag(enable_masked_compound);
286 flag(enable_warped_motion);
287 flag(enable_dual_filter);
289 flag(enable_order_hint);
290 if (current->enable_order_hint) {
291 flag(enable_jnt_comp);
292 flag(enable_ref_frame_mvs);
294 infer(enable_jnt_comp, 0);
295 infer(enable_ref_frame_mvs, 0);
298 flag(seq_choose_screen_content_tools);
299 if (current->seq_choose_screen_content_tools)
300 infer(seq_force_screen_content_tools,
303 fb(1, seq_force_screen_content_tools);
304 if (current->seq_force_screen_content_tools > 0) {
305 flag(seq_choose_integer_mv);
306 if (current->seq_choose_integer_mv)
307 infer(seq_force_integer_mv,
310 fb(1, seq_force_integer_mv);
315 if (current->enable_order_hint)
316 fb(3, order_hint_bits_minus_1);
319 flag(enable_superres);
321 flag(enable_restoration);
324 current->seq_profile));
326 flag(film_grain_params_present);
335 HEADER(
"Temporal Delimiter");
352 infer(use_superres, 0);
354 if (current->use_superres) {
375 if (current->frame_size_override_flag) {
379 priv->
frame_width = current->frame_width_minus_1 + 1;
397 flag(render_and_frame_size_different);
399 if (current->render_and_frame_size_different) {
400 fb(16, render_width_minus_1);
401 fb(16, render_height_minus_1);
420 flags(found_ref[i], 1, i);
421 if (current->found_ref[i]) {
423 &priv->
ref[current->ref_frame_idx[i]];
427 "Missing reference frame needed for frame size "
428 "(ref = %d, ref_frame_idx = %d).\n",
429 i, current->ref_frame_idx[i]);
442 if (i >= AV1_REFS_PER_FRAME) {
457 flag(is_filter_switchable);
458 if (current->is_filter_switchable)
472 int mi_cols, mi_rows, sb_cols, sb_rows, sb_shift, sb_size;
473 int max_tile_width_sb, max_tile_height_sb, max_tile_area_sb;
474 int min_log2_tile_cols, max_log2_tile_cols, max_log2_tile_rows;
475 int min_log2_tiles, min_log2_tile_rows;
482 : ((mi_cols + 15) >> 4);
484 : ((mi_rows + 15) >> 4);
487 sb_size = sb_shift + 2;
495 min_log2_tiles =
FFMAX(min_log2_tile_cols,
498 flag(uniform_tile_spacing_flag);
500 if (current->uniform_tile_spacing_flag) {
501 int tile_width_sb, tile_height_sb;
503 increment(tile_cols_log2, min_log2_tile_cols, max_log2_tile_cols);
505 tile_width_sb = (sb_cols + (1 << current->tile_cols_log2) - 1) >>
506 current->tile_cols_log2;
507 current->tile_cols = (sb_cols + tile_width_sb - 1) / tile_width_sb;
509 min_log2_tile_rows =
FFMAX(min_log2_tiles - current->tile_cols_log2, 0);
511 increment(tile_rows_log2, min_log2_tile_rows, max_log2_tile_rows);
513 tile_height_sb = (sb_rows + (1 << current->tile_rows_log2) - 1) >>
514 current->tile_rows_log2;
515 current->tile_rows = (sb_rows + tile_height_sb - 1) / tile_height_sb;
518 int widest_tile_sb, start_sb, size_sb, max_width, max_height;
524 max_width =
FFMIN(sb_cols - start_sb, max_tile_width_sb);
525 ns(max_width, width_in_sbs_minus_1[i], 1, i);
526 size_sb = current->width_in_sbs_minus_1[i] + 1;
527 widest_tile_sb =
FFMAX(size_sb, widest_tile_sb);
531 current->tile_cols = i;
533 if (min_log2_tiles > 0)
534 max_tile_area_sb = (sb_rows * sb_cols) >> (min_log2_tiles + 1);
536 max_tile_area_sb = sb_rows * sb_cols;
537 max_tile_height_sb =
FFMAX(max_tile_area_sb / widest_tile_sb, 1);
541 max_height =
FFMIN(sb_rows - start_sb, max_tile_height_sb);
542 ns(max_height, height_in_sbs_minus_1[i], 1, i);
543 size_sb = current->height_in_sbs_minus_1[i] + 1;
547 current->tile_rows = i;
550 if (current->tile_cols_log2 > 0 ||
551 current->tile_rows_log2 > 0) {
552 fb(current->tile_cols_log2 + current->tile_rows_log2,
553 context_update_tile_id);
554 fb(2, tile_size_bytes_minus1);
556 infer(context_update_tile_id, 0);
580 infer(diff_uv_delta, 0);
585 if (current->diff_uv_delta) {
589 infer(delta_q_v_dc, current->delta_q_u_dc);
590 infer(delta_q_v_ac, current->delta_q_u_ac);
593 infer(delta_q_u_dc, 0);
594 infer(delta_q_u_ac, 0);
595 infer(delta_q_v_dc, 0);
596 infer(delta_q_v_ac, 0);
600 if (current->using_qmatrix) {
606 infer(qm_v, current->qm_u);
619 flag(segmentation_enabled);
621 if (current->segmentation_enabled) {
623 infer(segmentation_update_map, 1);
624 infer(segmentation_temporal_update, 0);
625 infer(segmentation_update_data, 1);
627 flag(segmentation_update_map);
628 if (current->segmentation_update_map)
629 flag(segmentation_temporal_update);
631 infer(segmentation_temporal_update, 0);
632 flag(segmentation_update_data);
635 if (current->segmentation_update_data) {
638 flags(feature_enabled[i][j], 2, i, j);
640 if (current->feature_enabled[i][j] && bits[j] > 0) {
642 sus(1 + bits[j], feature_value[i][j], 2, i, j);
644 fbs(bits[j], feature_value[i][j], 2, i, j);
646 infer(feature_value[i][j], 0);
654 infer(feature_enabled[i][j], 0);
655 infer(feature_value[i][j], 0);
668 if (current->base_q_idx > 0)
669 flag(delta_q_present);
671 infer(delta_q_present, 0);
673 if (current->delta_q_present)
684 if (current->delta_q_present) {
685 if (!current->allow_intrabc)
686 flag(delta_lf_present);
688 infer(delta_lf_present, 0);
689 if (current->delta_lf_present) {
691 flag(delta_lf_multi);
693 infer(delta_lf_res, 0);
694 infer(delta_lf_multi, 0);
697 infer(delta_lf_present, 0);
698 infer(delta_lf_res, 0);
699 infer(delta_lf_multi, 0);
712 infer(loop_filter_level[0], 0);
713 infer(loop_filter_level[1], 0);
722 for (i = 0; i < 2; i++)
723 infer(loop_filter_mode_deltas[i], 0);
727 fb(6, loop_filter_level[0]);
728 fb(6, loop_filter_level[1]);
731 if (current->loop_filter_level[0] ||
732 current->loop_filter_level[1]) {
733 fb(6, loop_filter_level[2]);
734 fb(6, loop_filter_level[3]);
738 fb(3, loop_filter_sharpness);
740 flag(loop_filter_delta_enabled);
741 if (current->loop_filter_delta_enabled) {
742 flag(loop_filter_delta_update);
743 if (current->loop_filter_delta_update) {
745 flags(update_ref_delta[i], 1, i);
746 if (current->update_ref_delta[i])
747 sus(1 + 6, loop_filter_ref_deltas[i], 1, i);
749 for (i = 0; i < 2; i++) {
750 flags(update_mode_delta[i], 1, i);
751 if (current->update_mode_delta[i])
752 sus(1 + 6, loop_filter_mode_deltas[i], 1, i);
769 infer(cdef_damping_minus_3, 0);
771 infer(cdef_y_pri_strength[0], 0);
772 infer(cdef_y_sec_strength[0], 0);
773 infer(cdef_uv_pri_strength[0], 0);
774 infer(cdef_uv_sec_strength[0], 0);
779 fb(2, cdef_damping_minus_3);
782 for (i = 0; i < (1 << current->cdef_bits); i++) {
783 fbs(4, cdef_y_pri_strength[i], 1, i);
784 fbs(2, cdef_y_sec_strength[i], 1, i);
787 fbs(4, cdef_uv_pri_strength[i], 1, i);
788 fbs(2, cdef_uv_sec_strength[i], 1, i);
800 int uses_lr, uses_chroma_lr;
808 uses_lr = uses_chroma_lr = 0;
810 fbs(2, lr_type[i], 1, i);
812 if (current->lr_type[i] != 0) {
829 infer(lr_uv_shift, 0);
857 infer(reference_select, 0);
859 flag(reference_select);
869 int skip_mode_allowed;
875 skip_mode_allowed = 0;
877 int forward_idx, backward_idx;
878 int forward_hint, backward_hint;
879 int ref_hint, dist, i;
886 current->order_hint);
888 if (forward_idx < 0 ||
892 forward_hint = ref_hint;
894 }
else if (dist > 0) {
895 if (backward_idx < 0 ||
897 backward_hint) < 0) {
899 backward_hint = ref_hint;
904 if (forward_idx < 0) {
905 skip_mode_allowed = 0;
906 }
else if (backward_idx >= 0) {
907 skip_mode_allowed = 1;
910 int second_forward_idx;
911 int second_forward_hint;
913 second_forward_idx = -1;
918 if (second_forward_idx < 0 ||
920 second_forward_hint) > 0) {
921 second_forward_idx = i;
922 second_forward_hint = ref_hint;
927 if (second_forward_idx < 0) {
928 skip_mode_allowed = 0;
930 skip_mode_allowed = 1;
936 if (skip_mode_allowed)
937 flag(skip_mode_present);
939 infer(skip_mode_present, 0);
948 uint32_t abs_bits, prec_bits, num_syms;
964 num_syms = 2 * (1 << abs_bits) + 1;
984 flags(is_global[ref], 1, ref);
985 if (current->is_global[ref]) {
986 flags(is_rot_zoom[ref], 1, ref);
987 if (current->is_rot_zoom[ref]) {
990 flags(is_translation[ref], 1, ref);
1023 int num_pos_luma, num_pos_chroma;
1027 (!current->show_frame && !current->showable_frame))
1032 if (!current->apply_grain)
1040 infer(update_grain, 1);
1042 if (!current->update_grain) {
1043 fb(3, film_grain_params_ref_idx);
1047 fb(4, num_y_points);
1048 for (i = 0; i < current->num_y_points; i++) {
1049 fbs(8, point_y_value[i], 1, i);
1050 fbs(8, point_y_scaling[i], 1, i);
1054 infer(chroma_scaling_from_luma, 0);
1056 flag(chroma_scaling_from_luma);
1059 current->chroma_scaling_from_luma ||
1062 current->num_y_points == 0)) {
1063 infer(num_cb_points, 0);
1064 infer(num_cr_points, 0);
1066 fb(4, num_cb_points);
1067 for (i = 0; i < current->num_cb_points; i++) {
1068 fbs(8, point_cb_value[i], 1, i);
1069 fbs(8, point_cb_scaling[i], 1, i);
1071 fb(4, num_cr_points);
1072 for (i = 0; i < current->num_cr_points; i++) {
1073 fbs(8, point_cr_value[i], 1, i);
1074 fbs(8, point_cr_scaling[i], 1, i);
1078 fb(2, grain_scaling_minus_8);
1079 fb(2, ar_coeff_lag);
1080 num_pos_luma = 2 * current->ar_coeff_lag * (current->ar_coeff_lag + 1);
1081 if (current->num_y_points) {
1082 num_pos_chroma = num_pos_luma + 1;
1083 for (i = 0; i < num_pos_luma; i++)
1084 fbs(8, ar_coeffs_y_plus_128[i], 1, i);
1086 num_pos_chroma = num_pos_luma;
1088 if (current->chroma_scaling_from_luma || current->num_cb_points) {
1089 for (i = 0; i < num_pos_chroma; i++)
1090 fbs(8, ar_coeffs_cb_plus_128[i], 1, i);
1092 if (current->chroma_scaling_from_luma || current->num_cr_points) {
1093 for (i = 0; i < num_pos_chroma; i++)
1094 fbs(8, ar_coeffs_cr_plus_128[i], 1, i);
1096 fb(2, ar_coeff_shift_minus_6);
1097 fb(2, grain_scale_shift);
1098 if (current->num_cb_points) {
1100 fb(8, cb_luma_mult);
1103 if (current->num_cr_points) {
1105 fb(8, cr_luma_mult);
1110 flag(clip_to_restricted_range);
1120 int id_len, diff_len, all_frames, frame_is_intra, order_hint_bits;
1125 "unable to decode frame header.\n");
1135 infer(show_existing_frame, 0);
1138 infer(showable_frame, 0);
1142 flag(show_existing_frame);
1144 if (current->show_existing_frame) {
1147 fb(3, frame_to_show_map_idx);
1148 frame = &priv->
ref[current->frame_to_show_map_idx];
1153 frame_presentation_time);
1157 fb(id_len, display_frame_id);
1160 infer(refresh_frame_flags, all_frames);
1162 infer(refresh_frame_flags, 0);
1172 if (current->show_frame &&
1176 frame_presentation_time);
1178 if (current->show_frame)
1181 flag(showable_frame);
1184 (current->frame_type ==
AV1_FRAME_KEY && current->show_frame))
1185 infer(error_resilient_mode, 1);
1187 flag(error_resilient_mode);
1190 if (current->frame_type ==
AV1_FRAME_KEY && current->show_frame) {
1197 flag(disable_cdf_update);
1201 flag(allow_screen_content_tools);
1203 infer(allow_screen_content_tools,
1206 if (current->allow_screen_content_tools) {
1208 flag(force_integer_mv);
1212 infer(force_integer_mv, 0);
1216 fb(id_len, current_frame_id);
1220 if (current->current_frame_id > (1 << diff_len)) {
1221 if (priv->
ref[i].
frame_id > current->current_frame_id ||
1222 priv->
ref[i].
frame_id < (current->current_frame_id -
1226 if (priv->
ref[i].
frame_id > current->current_frame_id &&
1228 current->current_frame_id -
1234 infer(current_frame_id, 0);
1238 infer(frame_size_override_flag, 1);
1240 infer(frame_size_override_flag, 0);
1242 flag(frame_size_override_flag);
1246 if (order_hint_bits > 0)
1247 fb(order_hint_bits, order_hint);
1249 infer(order_hint, 0);
1251 if (frame_is_intra || current->error_resilient_mode)
1254 fb(3, primary_ref_frame);
1257 flag(buffer_removal_time_present_flag);
1258 if (current->buffer_removal_time_present_flag) {
1262 int in_temporal_layer = (op_pt_idc >> priv->
temporal_id ) & 1;
1263 int in_spatial_layer = (op_pt_idc >> (priv->
spatial_id + 8)) & 1;
1265 in_temporal_layer || in_spatial_layer) {
1267 buffer_removal_time[i], 1, i);
1275 (current->frame_type ==
AV1_FRAME_KEY && current->show_frame))
1276 infer(refresh_frame_flags, all_frames);
1278 fb(8, refresh_frame_flags);
1280 if (!frame_is_intra || current->refresh_frame_flags != all_frames) {
1283 fbs(order_hint_bits, ref_order_hint[i], 1, i);
1295 if (current->allow_screen_content_tools &&
1297 flag(allow_intrabc);
1299 infer(allow_intrabc, 0);
1303 infer(frame_refs_short_signaling, 0);
1305 flag(frame_refs_short_signaling);
1306 if (current->frame_refs_short_signaling) {
1307 fb(3, last_frame_idx);
1308 fb(3, golden_frame_idx);
1312 infer(ref_frame_idx[i], current->last_frame_idx);
1315 infer(ref_frame_idx[i], current->golden_frame_idx);
1317 infer(ref_frame_idx[i], -1);
1323 if (!current->frame_refs_short_signaling)
1324 fbs(3, ref_frame_idx[i], 1, i);
1327 delta_frame_id_minus1);
1331 if (current->frame_size_override_flag &&
1332 !current->error_resilient_mode) {
1339 if (current->force_integer_mv)
1340 infer(allow_high_precision_mv, 0);
1342 flag(allow_high_precision_mv);
1346 flag(is_motion_mode_switchable);
1348 if (current->error_resilient_mode ||
1350 infer(use_ref_frame_mvs, 0);
1352 flag(use_ref_frame_mvs);
1354 infer(allow_intrabc, 0);
1357 if (!frame_is_intra) {
1362 infer(disable_frame_end_update_cdf, 1);
1364 flag(disable_frame_end_update_cdf);
1374 if (current->use_ref_frame_mvs) {
1394 qindex = (current->base_q_idx +
1397 qindex = current->base_q_idx;
1399 qindex = av_clip_uintp2(qindex, 8);
1401 if (qindex || current->delta_q_y_dc ||
1402 current->delta_q_u_ac || current->delta_q_u_dc ||
1403 current->delta_q_v_ac || current->delta_q_v_dc) {
1422 if (frame_is_intra || current->error_resilient_mode ||
1424 infer(allow_warped_motion, 0);
1426 flag(allow_warped_motion);
1428 flag(reduced_tx_set);
1435 if (current->refresh_frame_flags & (1 << i)) {
1438 .frame_id = current->current_frame_id,
1444 .frame_type = current->frame_type,
1448 .order_hint = current->order_hint,
1454 "upscaled %d render %dx%d subsample %dx%d "
1455 "bitdepth %d tiles %dx%d.\n", current->order_hint,
1470 int start_pos, fh_bits, fh_bytes, err;
1476 "frame header OBU.\n");
1483 HEADER(
"Redundant Frame Header");
1492 xf(b, frame_header_copy[i],
1493 val, val, val, 1, i / 8);
1498 HEADER(
"Redundant Frame Header (used as Frame Header)");
1512 if (current->show_existing_frame) {
1521 fh_start = (
uint8_t*)rw->buffer + start_pos / 8;
1531 fh_start = rw->buf + start_pos / 8;
1533 fh_bytes = (fh_bits + 7) / 8;
1537 if (rw_buffer_ref) {
1560 int num_tiles, tile_bits;
1567 flag(tile_start_and_end_present_flag);
1569 infer(tile_start_and_end_present_flag, 0);
1571 if (num_tiles == 1 || !current->tile_start_and_end_present_flag) {
1573 infer(tg_end, num_tiles - 1);
1577 fb(tile_bits, tg_start);
1578 fb(tile_bits, tg_end);
1584 if (current->tg_end == num_tiles - 1)
1613 fb(8, output_frame_width_in_tiles_minus_1);
1614 fb(8, output_frame_height_in_tiles_minus_1);
1616 fb(16, tile_count_minus_1);
1639 for (i = 0; i < 3; i++) {
1640 fcs(16, primary_chromaticity_x[i], 0, 50000, 1, i);
1641 fcs(16, primary_chromaticity_y[i], 0, 50000, 1, i);
1644 fc(16, white_point_chromaticity_x, 0, 50000);
1645 fc(16, white_point_chromaticity_y, 0, 50000);
1648 fc(32, luminance_min, 0, current->luminance_max >> 6);
1667 fb(8, itu_t_t35_country_code);
1668 if (current->itu_t_t35_country_code == 0xff)
1669 fb(8, itu_t_t35_country_code_extension_byte);
1676 current->payload_size = 0;
1679 current->payload_size = i;
1685 if (!current->payload_ref)
1687 current->payload = current->payload_ref->data;
1690 for (i = 0; i < current->payload_size; i++)
1691 xf(8, itu_t_t35_payload_bytes[i], current->payload[i],
1702 fb(5, counting_type);
1703 flag(full_timestamp_flag);
1704 flag(discontinuity_flag);
1705 flag(cnt_dropped_flag);
1708 if (current->full_timestamp_flag) {
1709 fb(6, seconds_value);
1710 fb(6, minutes_value);
1714 if (current->seconds_flag) {
1715 fb(6, seconds_value);
1717 if (current->minutes_flag) {
1718 fb(6, minutes_value);
1720 if (current->hours_flag)
1726 fb(5, time_offset_length);
1727 if (current->time_offset_length > 0)
1728 fb(current->time_offset_length, time_offset_value);
1740 switch (current->metadata_type) {
static int FUNC() tile_group_obu(CodedBitstreamContext *ctx, RWContext *rw, AV1RawTileGroup *current)
static int FUNC() trailing_bits(CodedBitstreamContext *ctx, RWContext *rw, int nb_bits)
const char const char void * val
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it...
#define fixed(width, name, value)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static int FUNC() tile_info(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
static int FUNC() tile_list_obu(CodedBitstreamContext *ctx, RWContext *rw, AV1RawTileList *current)
static int FUNC() interpolation_filter(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream, AVFormatContext *fmt_ctx)
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB)
static int FUNC() uncompressed_header(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
static int FUNC() decoder_model_info(CodedBitstreamContext *ctx, RWContext *rw, AV1RawDecoderModelInfo *current)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static int FUNC() loop_filter_params(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
#define MAX_UINT_BITS(length)
static int FUNC() delta_lf_params(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
#define subexp(name, max, subs,...)
static int FUNC() superres_params(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
CHECK(-1) CHECK(-2)}}}}CHECK(1) CHECK(2)}}}}}if(diff0+diff1 > 0) temp-
static int get_bits_count(const GetBitContext *s)
static int FUNC() render_size(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
uint8_t frame_presentation_time_length_minus_1
static int FUNC() read_tx_mode(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
static int FUNC() lr_params(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
static int get_bits_left(GetBitContext *gb)
#define fc(width, name, range_min, range_max)
static int FUNC() metadata_itut_t35(CodedBitstreamContext *ctx, RWContext *rw, AV1RawMetadataITUTT35 *current)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
static int FUNC() frame_reference_mode(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
#define fcs(width, name, range_min, range_max, subs,...)
uint8_t separate_uv_delta_q
AVBufferRef * frame_header_ref
static int FUNC() obu_header(CodedBitstreamContext *ctx, RWContext *rw, AV1RawOBUHeader *current)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
static int FUNC() global_motion_params(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
static int FUNC() skip_mode_params(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
static int FUNC() metadata_scalability(CodedBitstreamContext *ctx, RWContext *rw, AV1RawMetadataScalability *current)
static int put_bits_count(PutBitContext *s)
static int cbs_av1_tile_log2(int blksize, int target)
static int FUNC() color_config(CodedBitstreamContext *ctx, RWContext *rw, AV1RawColorConfig *current, int seq_profile)
static const struct TransferCharacteristics transfer_characteristics[AVCOL_TRC_NB]
static int FUNC() metadata_hdr_cll(CodedBitstreamContext *ctx, RWContext *rw, AV1RawMetadataHDRCLL *current)
static int FUNC() byte_alignment(CodedBitstreamContext *ctx, RWContext *rw)
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
static const struct ColorPrimaries color_primaries[AVCOL_PRI_NB]
#define increment(name, min, max)
static int FUNC() frame_size_with_refs(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
static int FUNC() sequence_header_obu(CodedBitstreamContext *ctx, RWContext *rw, AV1RawSequenceHeader *current)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define fbs(width, name, subs,...)
static int FUNC() frame_size(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
AVBufferRef * av_buffer_alloc(int size)
Allocate an AVBuffer of the given size using av_malloc().
uint8_t * data
The data buffer.
static int FUNC() metadata_hdr_mdcv(CodedBitstreamContext *ctx, RWContext *rw, AV1RawMetadataHDRMDCV *current)
#define uvlc(name, range_min, range_max)
#define FF_PROFILE_AV1_PROFESSIONAL
Context structure for coded bitstream operations.
static int FUNC() global_motion_param(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current, int type, int ref, int idx)
AV1ReferenceFrameState ref[AV1_NUM_REF_FRAMES]
static int FUNC() temporal_delimiter_obu(CodedBitstreamContext *ctx, RWContext *rw)
static int FUNC() delta_q_params(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
#define FF_PROFILE_AV1_MAIN
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
AV1RawSequenceHeader * sequence_header
static int FUNC() metadata_timecode(CodedBitstreamContext *ctx, RWContext *rw, AV1RawMetadataTimecode *current)
static int FUNC() frame_header_obu(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current, int redundant, AVBufferRef *rw_buffer_ref)
static int FUNC() cdef_params(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
uint8_t equal_picture_interval
#define flags(name, subs,...)
static int FUNC() metadata_obu(CodedBitstreamContext *ctx, RWContext *rw, AV1RawMetadata *current)
static int FUNC() timing_info(CodedBitstreamContext *ctx, RWContext *rw, AV1RawTimingInfo *current)
#define ns(max_value, name, subs,...)
A reference to a data buffer.
IEC 61966-2-1 (sRGB or sYCC)
static int FUNC() frame_obu(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrame *current, AVBufferRef *rw_buffer_ref)
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static int ref[MAX_W *MAX_W]
uint8_t buffer_removal_time_length_minus_1
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
static int FUNC() segmentation_params(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
#define xf(width, name, var, range_min, range_max, subs,...)
void * priv_data
Format private data.
static int FUNC() film_grain_params(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
static int FUNC() quantization_params(CodedBitstreamContext *ctx, RWContext *rw, AV1RawFrameHeader *current)
#define sus(width, name, subs,...)
static int cbs_av1_get_relative_dist(const AV1RawSequenceHeader *seq, unsigned int a, unsigned int b)
#define infer(name, value)
#define FF_PROFILE_AV1_HIGH