va: baseenc: Set the trellis parameter anyway

The driver may enable trellis by default. So we should also set the
trellis info to driver even when the trellis option is turned off.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6663>
This commit is contained in:
He Junyan 2024-04-16 18:13:06 +08:00 committed by GStreamer Marge Bot
parent fd25409a70
commit 5b27aff33b

View file

@ -1170,17 +1170,14 @@ gst_va_base_enc_add_trellis_parameter (GstVaBaseEnc * base,
} trellis = {
.type = VAEncMiscParameterTypeQuantization,
.tr.quantization_flags.bits = {
.disable_trellis = 0,
.enable_trellis_I = 1,
.enable_trellis_B = 1,
.enable_trellis_P = 1,
.disable_trellis = !use_trellis,
.enable_trellis_I = use_trellis,
.enable_trellis_B = use_trellis,
.enable_trellis_P = use_trellis,
},
};
/* *INDENT-ON* */
if (!use_trellis)
return TRUE;
if (!gst_va_encoder_add_param (base->encoder, picture,
VAEncMiscParameterBufferType, &trellis, sizeof (trellis))) {
GST_ERROR_OBJECT (base, "Failed to create the trellis parameter");