mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-07 06:52:41 +00:00
libs: encoder: h264,h265: Set max_qp if min_qp is non-zero.
media-driver currently fails to set a correct value of max_qp when min_qp is different to zero, in CBR and VBR mode, generating full quality frames, thus unexpected huge output. This patch sets max_qp to an arbitrary value to avoid this output temporary. Fixes: #144
This commit is contained in:
parent
d4bc0cb6da
commit
5b1fe9c68a
3 changed files with 12 additions and 0 deletions
|
@ -2519,6 +2519,10 @@ ensure_control_rate_params (GstVaapiEncoderH264 * encoder)
|
|||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).window_size = encoder->cpb_length;
|
||||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).initial_qp = encoder->init_qp;
|
||||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).min_qp = encoder->min_qp;
|
||||
/* @FIXME: should not set this value, should be ignored if set to zero *
|
||||
* https://github.com/intel/media-driver/issues/587 */
|
||||
if (encoder->min_qp > 0)
|
||||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).max_qp = 51;
|
||||
|
||||
#if VA_CHECK_VERSION(1,0,0)
|
||||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).rc_flags.bits.mb_rate_control =
|
||||
|
|
|
@ -2449,6 +2449,10 @@ ensure_misc_params (GstVaapiEncoderH264Fei * encoder,
|
|||
rate_control->window_size = encoder->cpb_length;
|
||||
rate_control->initial_qp = encoder->init_qp;
|
||||
rate_control->min_qp = encoder->min_qp;
|
||||
/* @FIXME: should not set this value, should be ignored if set to zero *
|
||||
* https://github.com/intel/media-driver/issues/587 */
|
||||
if (rate_control->min_qp > 0)
|
||||
rate_control->max_qp = 51;
|
||||
rate_control->basic_unit_size = 0;
|
||||
gst_vaapi_enc_picture_add_misc_param (picture, misc);
|
||||
gst_vaapi_codec_object_replace (&misc, NULL);
|
||||
|
|
|
@ -1858,6 +1858,10 @@ ensure_control_rate_params (GstVaapiEncoderH265 * encoder)
|
|||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).window_size = encoder->cpb_length;
|
||||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).initial_qp = encoder->init_qp;
|
||||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).min_qp = encoder->min_qp;
|
||||
/* @FIXME: should not set this value, should be ignored if set to zero *
|
||||
* https://github.com/intel/media-driver/issues/587 */
|
||||
if (encoder->min_qp > 0)
|
||||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).max_qp = 51;
|
||||
|
||||
#if VA_CHECK_VERSION(1,0,0)
|
||||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).rc_flags.bits.mb_rate_control =
|
||||
|
|
Loading…
Reference in a new issue