Commit bd2bbade authored by Víctor Manuel Jáquez Leal's avatar Víctor Manuel Jáquez Leal
Browse files

va: av1dec: Avoid structure overwrite.

VADecPictureParameterBufferAV1.mode_control_fields.bits were filled
twice, overwriting to zeros the first assignation. This patch unifies
both assignations.

Also it makes explicit an enum casting between libva and gstreamer; it
removes the assignation to zero a deprecated parameter; and use an
appropriate assertion.

Part-of: <!2223>
parent a78c9075
Pipeline #315628 waiting for manual action with stages
in 27 seconds
...@@ -555,7 +555,9 @@ _setup_global_motion_info (VADecPictureParameterBufferAV1 * pic_param, ...@@ -555,7 +555,9 @@ _setup_global_motion_info (VADecPictureParameterBufferAV1 * pic_param,
guint i, j; guint i, j;
for (i = 0; i < 7; i++) { for (i = 0; i < 7; i++) {
pic_param->wm[i].wmtype = /* assuming VAAV1TransformationType and GstAV1WarpModelType are
* equivalent */
pic_param->wm[i].wmtype = (VAAV1TransformationType)
frame_header->global_motion_params.gm_type[GST_AV1_REF_LAST_FRAME + i]; frame_header->global_motion_params.gm_type[GST_AV1_REF_LAST_FRAME + i];
for (j = 0; j < 6; j++) for (j = 0; j < 6; j++)
...@@ -606,7 +608,6 @@ gst_va_av1_dec_start_picture (GstAV1Decoder * decoder, GstAV1Picture * picture, ...@@ -606,7 +608,6 @@ gst_va_av1_dec_start_picture (GstAV1Decoder * decoder, GstAV1Picture * picture,
.color_range = seq_header->color_config.color_range, .color_range = seq_header->color_config.color_range,
.subsampling_x = seq_header->color_config.subsampling_x, .subsampling_x = seq_header->color_config.subsampling_x,
.subsampling_y = seq_header->color_config.subsampling_y, .subsampling_y = seq_header->color_config.subsampling_y,
.chroma_sample_position = 0,
.film_grain_params_present = seq_header->film_grain_params_present, .film_grain_params_present = seq_header->film_grain_params_present,
}, },
.anchor_frames_num = 0, .anchor_frames_num = 0,
...@@ -687,15 +688,6 @@ gst_va_av1_dec_start_picture (GstAV1Decoder * decoder, GstAV1Picture * picture, ...@@ -687,15 +688,6 @@ gst_va_av1_dec_start_picture (GstAV1Decoder * decoder, GstAV1Picture * picture,
frame_header->loop_filter_params.delta_lf_present, frame_header->loop_filter_params.delta_lf_present,
.log2_delta_lf_res = frame_header->loop_filter_params.delta_lf_res, .log2_delta_lf_res = frame_header->loop_filter_params.delta_lf_res,
.delta_lf_multi = frame_header->loop_filter_params.delta_lf_multi, .delta_lf_multi = frame_header->loop_filter_params.delta_lf_multi,
},
/* quantization */
.base_qindex = frame_header->quantization_params.base_q_idx,
.y_dc_delta_q = frame_header->quantization_params.delta_q_y_dc,
.u_dc_delta_q = frame_header->quantization_params.delta_q_u_dc,
.u_ac_delta_q = frame_header->quantization_params.delta_q_u_ac,
.v_dc_delta_q = frame_header->quantization_params.delta_q_v_dc,
.v_ac_delta_q = frame_header->quantization_params.delta_q_v_ac,
.mode_control_fields.bits = {
.delta_q_present_flag = .delta_q_present_flag =
frame_header->quantization_params.delta_q_present, frame_header->quantization_params.delta_q_present,
.log2_delta_q_res = frame_header->quantization_params.delta_q_res, .log2_delta_q_res = frame_header->quantization_params.delta_q_res,
...@@ -704,6 +696,13 @@ gst_va_av1_dec_start_picture (GstAV1Decoder * decoder, GstAV1Picture * picture, ...@@ -704,6 +696,13 @@ gst_va_av1_dec_start_picture (GstAV1Decoder * decoder, GstAV1Picture * picture,
.reduced_tx_set_used = frame_header->reduced_tx_set, .reduced_tx_set_used = frame_header->reduced_tx_set,
.skip_mode_present = frame_header->skip_mode_present, .skip_mode_present = frame_header->skip_mode_present,
}, },
/* quantization */
.base_qindex = frame_header->quantization_params.base_q_idx,
.y_dc_delta_q = frame_header->quantization_params.delta_q_y_dc,
.u_dc_delta_q = frame_header->quantization_params.delta_q_u_dc,
.u_ac_delta_q = frame_header->quantization_params.delta_q_u_ac,
.v_dc_delta_q = frame_header->quantization_params.delta_q_v_dc,
.v_ac_delta_q = frame_header->quantization_params.delta_q_v_ac,
/* loop restoration */ /* loop restoration */
.loop_restoration_fields.bits = { .loop_restoration_fields.bits = {
.yframe_restoration_type = .yframe_restoration_type =
...@@ -725,7 +724,7 @@ gst_va_av1_dec_start_picture (GstAV1Decoder * decoder, GstAV1Picture * picture, ...@@ -725,7 +724,7 @@ gst_va_av1_dec_start_picture (GstAV1Decoder * decoder, GstAV1Picture * picture,
} else if (seq_header->bit_depth == 12) { } else if (seq_header->bit_depth == 12) {
pic_param.bit_depth_idx = 2; pic_param.bit_depth_idx = 2;
} else { } else {
g_assert (0); g_assert_not_reached ();
} }
if (frame_header->film_grain_params.apply_grain) { if (frame_header->film_grain_params.apply_grain) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment