From 5b27aff33b1c099f8033c356bb6925a1c1e9dc0c Mon Sep 17 00:00:00 2001 From: He Junyan Date: Tue, 16 Apr 2024 18:13:06 +0800 Subject: [PATCH] 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: --- subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c b/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c index d8e2667ca1..f6ddaf8204 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c @@ -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");