vah265enc: Correct the value of cu_qp_delta flag and depth

According to libva API description, cu_qp_delta in VAConfigAttribValEncHEVCFeatures
is supposed to be used as a flag not the value of depth. And if flag enabled,
diff_cu_qp_delta_depth should be decided by log2_diff_max_min_luma_coding_block_size.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5068>
This commit is contained in:
Mengkejiergeli Ba 2023-07-19 13:19:06 +08:00 committed by GStreamer Marge Bot
parent 809a984b91
commit ebea1219a9

View file

@ -4137,9 +4137,15 @@ _h265_setup_encoding_features (GstVaH265Enc * self)
self->features.transform_skip_enabled_flag = self->features.transform_skip_enabled_flag =
(features.bits.transform_skip != 0); (features.bits.transform_skip != 0);
self->features.cu_qp_delta_enabled_flag = if (self->rc.rc_ctrl_mode != VA_RC_CQP)
(self->rc.rc_ctrl_mode != VA_RC_CQP); self->features.cu_qp_delta_enabled_flag = !!features.bits.cu_qp_delta;
self->features.diff_cu_qp_delta_depth = features.bits.cu_qp_delta; else
self->features.cu_qp_delta_enabled_flag = 0;
if (self->features.cu_qp_delta_enabled_flag) {
self->features.diff_cu_qp_delta_depth =
self->features.log2_diff_max_min_luma_coding_block_size;
}
/* TODO: use weighted pred */ /* TODO: use weighted pred */
self->features.weighted_pred_flag = FALSE; self->features.weighted_pred_flag = FALSE;