From 846c276e26a071c4f1fccb7b0949d4de30a27fb6 Mon Sep 17 00:00:00 2001 From: Víctor Manuel Jáquez Leal Date: Mon, 5 Jun 2017 20:30:07 +0200 Subject: libs: encoder: vp8,h264,h265,mpeg2: set misc param once Instead of recalculating the miscellaneous buffer parameters for every buffer, it is only done once, when the encoder is configured. And for every buffer, the same structures are just copied. https://bugzilla.gnome.org/show_bug.cgi?id=783449 --- gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c') diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c b/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c index e80443a7..2c284ee4 100644 --- a/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c +++ b/gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.c @@ -452,8 +452,7 @@ ensure_picture (GstVaapiEncoderMpeg2 * encoder, GstVaapiEncPicture * picture, } static gboolean -ensure_control_rate_params (GstVaapiEncoderMpeg2 * encoder, - GstVaapiEncPicture * picture) +ensure_control_rate_params (GstVaapiEncoderMpeg2 * encoder) { GstVaapiEncoder *const base_encoder = GST_VAAPI_ENCODER_CAST (encoder); @@ -476,7 +475,7 @@ ensure_control_rate_params (GstVaapiEncoderMpeg2 * encoder, }; /* *INDENT-ON* */ - return gst_vaapi_encoder_ensure_param_control_rate (base_encoder, picture); + return TRUE; } static gboolean @@ -485,7 +484,7 @@ set_misc_parameters (GstVaapiEncoderMpeg2 * encoder, { GstVaapiEncoder *const base_encoder = GST_VAAPI_ENCODER_CAST (encoder); - if (!ensure_control_rate_params (encoder, picture)) + if (!gst_vaapi_encoder_ensure_param_control_rate (base_encoder, picture)) return FALSE; if (!gst_vaapi_encoder_ensure_param_quality_level (base_encoder, picture)) return FALSE; @@ -713,6 +712,7 @@ gst_vaapi_encoder_mpeg2_reconfigure (GstVaapiEncoder * base_encoder) if (!ensure_bitrate (encoder)) goto error; + ensure_control_rate_params (encoder); return set_context_info (base_encoder); /* ERRORS */ -- cgit v1.2.3