avcodec/av1_vaapi: improve decode quality

- quantizer delta and matrix level specific.
- support loop filter delta.
- support use superres.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
This commit is contained in:
Fei Wang 2021-10-12 16:24:04 +08:00 committed by James Almer
parent dc94f2eaaf
commit 84c73102d9
1 changed files with 41 additions and 27 deletions

View File

@ -150,8 +150,8 @@ static int vaapi_av1_start_frame(AVCodecContext *avctx,
.profile = seq->seq_profile,
.order_hint_bits_minus_1 = seq->order_hint_bits_minus_1,
.bit_depth_idx = bit_depth_idx,
.matrix_coefficients = seq->color_config.matrix_coefficients,
.current_frame = pic->output_surface,
.current_display_picture = pic->output_surface,
.current_display_picture = vaapi_av1_surface_id(&s->cur_frame),
.frame_width_minus1 = frame_header->frame_width_minus_1,
.frame_height_minus1 = frame_header->frame_height_minus_1,
@ -160,12 +160,20 @@ static int vaapi_av1_start_frame(AVCodecContext *avctx,
.tile_cols = frame_header->tile_cols,
.tile_rows = frame_header->tile_rows,
.context_update_tile_id = frame_header->context_update_tile_id,
.superres_scale_denominator = frame_header->use_superres ?
frame_header->coded_denom + AV1_SUPERRES_DENOM_MIN :
AV1_SUPERRES_NUM,
.interp_filter = frame_header->interpolation_filter,
.filter_level[0] = frame_header->loop_filter_level[0],
.filter_level[1] = frame_header->loop_filter_level[1],
.filter_level_u = frame_header->loop_filter_level[2],
.filter_level_v = frame_header->loop_filter_level[3],
.base_qindex = frame_header->base_q_idx,
.y_dc_delta_q = frame_header->delta_q_y_dc,
.u_dc_delta_q = frame_header->delta_q_u_dc,
.u_ac_delta_q = frame_header->delta_q_u_ac,
.v_dc_delta_q = frame_header->delta_q_v_dc,
.v_ac_delta_q = frame_header->delta_q_v_ac,
.cdef_damping_minus_3 = frame_header->cdef_damping_minus_3,
.cdef_bits = frame_header->cdef_bits,
.seq_info_fields.fields = {
@ -240,6 +248,9 @@ static int vaapi_av1_start_frame(AVCodecContext *avctx,
.mode_control_fields.bits = {
.delta_q_present_flag = frame_header->delta_q_present,
.log2_delta_q_res = frame_header->delta_q_res,
.delta_lf_present_flag = frame_header->delta_lf_present,
.log2_delta_lf_res = frame_header->delta_lf_res,
.delta_lf_multi = frame_header->delta_lf_multi,
.tx_mode = frame_header->tx_mode,
.reference_select = frame_header->reference_select,
.reduced_tx_set_used = frame_header->reduced_tx_set,
@ -254,6 +265,9 @@ static int vaapi_av1_start_frame(AVCodecContext *avctx,
},
.qmatrix_fields.bits = {
.using_qmatrix = frame_header->using_qmatrix,
.qm_y = frame_header->qm_y,
.qm_u = frame_header->qm_u,
.qm_v = frame_header->qm_v,
}
};