mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-21 15:56:42 +00:00
libs: encoder: set VA HRD param before RC param
This is a workaround for intel-media-driver bug https://github.com/intel/media-driver/issues/865 The driver will force the RC method to CBR for HEVCe when it parses the HRD param. Thus, any RC method param submitted "prior" to the HRD param will be lost. Therefore, VBR, ICQ and QVBR for HEVCe can't be effectively enabled if the RC method param "precedes" the HRD param. To work around this issue, set the HRD param before the RC method param so the driver will parse the RC method param "after" the HRD param. Afaict, other codecs in the driver (and other drivers) do not appear to be dependent on the order of HRD and RC param submission.
This commit is contained in:
parent
61516dd5e1
commit
861b4cc4b6
1 changed files with 9 additions and 9 deletions
|
@ -63,15 +63,6 @@ gst_vaapi_encoder_ensure_param_control_rate (GstVaapiEncoder * encoder,
|
||||||
if (GST_VAAPI_ENCODER_RATE_CONTROL (encoder) == GST_VAAPI_RATECONTROL_CQP)
|
if (GST_VAAPI_ENCODER_RATE_CONTROL (encoder) == GST_VAAPI_RATECONTROL_CQP)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* RateControl params */
|
|
||||||
misc = GST_VAAPI_ENC_MISC_PARAM_NEW (RateControl, encoder);
|
|
||||||
if (!misc)
|
|
||||||
return FALSE;
|
|
||||||
memcpy (misc->data, &GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder),
|
|
||||||
sizeof (VAEncMiscParameterRateControl));
|
|
||||||
gst_vaapi_enc_picture_add_misc_param (picture, misc);
|
|
||||||
gst_vaapi_codec_object_replace (&misc, NULL);
|
|
||||||
|
|
||||||
/* HRD params */
|
/* HRD params */
|
||||||
misc = GST_VAAPI_ENC_MISC_PARAM_NEW (HRD, encoder);
|
misc = GST_VAAPI_ENC_MISC_PARAM_NEW (HRD, encoder);
|
||||||
if (!misc)
|
if (!misc)
|
||||||
|
@ -81,6 +72,15 @@ gst_vaapi_encoder_ensure_param_control_rate (GstVaapiEncoder * encoder,
|
||||||
gst_vaapi_enc_picture_add_misc_param (picture, misc);
|
gst_vaapi_enc_picture_add_misc_param (picture, misc);
|
||||||
gst_vaapi_codec_object_replace (&misc, NULL);
|
gst_vaapi_codec_object_replace (&misc, NULL);
|
||||||
|
|
||||||
|
/* RateControl params */
|
||||||
|
misc = GST_VAAPI_ENC_MISC_PARAM_NEW (RateControl, encoder);
|
||||||
|
if (!misc)
|
||||||
|
return FALSE;
|
||||||
|
memcpy (misc->data, &GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder),
|
||||||
|
sizeof (VAEncMiscParameterRateControl));
|
||||||
|
gst_vaapi_enc_picture_add_misc_param (picture, misc);
|
||||||
|
gst_vaapi_codec_object_replace (&misc, NULL);
|
||||||
|
|
||||||
/* FrameRate params */
|
/* FrameRate params */
|
||||||
if (GST_VAAPI_ENCODER_VA_FRAME_RATE (encoder).framerate == 0)
|
if (GST_VAAPI_ENCODER_VA_FRAME_RATE (encoder).framerate == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue