36 memset(
sps, 0,
sizeof(*
sps));
37 memset(
pps, 0,
sizeof(*
pps));
41 if (
desc->nb_components == 1 ||
desc->log2_chroma_w != 1 ||
desc->log2_chroma_h != 1) {
43 "%s is not supported.\n",
desc->name);
48 sps->nal_unit_header.nal_ref_idc = 3;
55 sps->constraint_set1_flag = 1;
58 sps->constraint_set3_flag = base_ctx->
gop_size == 1;
62 sps->constraint_set4_flag = 1;
63 sps->constraint_set5_flag = base_ctx->
b_per_p == 0;
90 if (
level->constraint_set3_flag)
91 sps->constraint_set3_flag = 1;
95 "to any level: using level 6.2.\n");
100 sps->seq_parameter_set_id = 0;
101 sps->chroma_format_idc = 1;
105 sps->log2_max_frame_num_minus4 = 4;
107 if (
sps->pic_order_cnt_type == 0) {
108 sps->log2_max_pic_order_cnt_lsb_minus4 = 4;
113 sps->pic_width_in_mbs_minus1 =
opts->mb_width - 1;
114 sps->pic_height_in_map_units_minus1 =
opts->mb_height - 1;
116 sps->frame_mbs_only_flag = 1;
117 sps->direct_8x8_inference_flag = 1;
119 if (avctx->
width != 16 *
opts->mb_width ||
121 sps->frame_cropping_flag = 1;
123 sps->frame_crop_left_offset = 0;
124 sps->frame_crop_right_offset =
125 (16 *
opts->mb_width - avctx->
width) / 2;
126 sps->frame_crop_top_offset = 0;
127 sps->frame_crop_bottom_offset =
130 sps->frame_cropping_flag = 0;
133 sps->vui_parameters_present_flag = 1;
143 sps->vui.aspect_ratio_idc =
i;
148 sps->vui.aspect_ratio_idc = 255;
149 sps->vui.sar_width = num;
150 sps->vui.sar_height = den;
152 sps->vui.aspect_ratio_info_present_flag = 1;
156 sps->vui.video_format = 5;
157 sps->vui.video_full_range_flag =
165 sps->vui.colour_description_present_flag = 1;
167 sps->vui.colour_description_present_flag)
168 sps->vui.video_signal_type_present_flag = 1;
171 sps->vui.chroma_loc_info_present_flag = 1;
172 sps->vui.chroma_sample_loc_type_top_field =
173 sps->vui.chroma_sample_loc_type_bottom_field =
177 sps->vui.timing_info_present_flag = 1;
181 sps->vui.fixed_frame_rate_flag = 1;
185 sps->vui.fixed_frame_rate_flag = 0;
192 sps->vui.nal_hrd_parameters_present_flag = 1;
221 (uint64_t)
opts->initial_buffer_fullness /
222 opts->hrd_buffer_size;
225 sps->vui.nal_hrd_parameters_present_flag = 0;
226 sps->vui.low_delay_hrd_flag = 1 -
sps->vui.fixed_frame_rate_flag;
229 sps->vui.bitstream_restriction_flag = 1;
230 sps->vui.motion_vectors_over_pic_boundaries_flag = 1;
231 sps->vui.log2_max_mv_length_horizontal = 15;
232 sps->vui.log2_max_mv_length_vertical = 15;
236 pps->nal_unit_header.nal_ref_idc = 3;
239 pps->pic_parameter_set_id = 0;
240 pps->seq_parameter_set_id = 0;
242 pps->entropy_coding_mode_flag =
246 if (!
opts->cabac &&
pps->entropy_coding_mode_flag)
247 pps->entropy_coding_mode_flag = 0;
249 pps->num_ref_idx_l0_default_active_minus1 = 0;
250 pps->num_ref_idx_l1_default_active_minus1 = 0;
252 pps->pic_init_qp_minus26 =
opts->fixed_qp_idr - 26;
257 pps->more_rbsp_data = 0;
259 pps->more_rbsp_data = 1;
261 pps->transform_8x8_mode_flag = 1;