mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-07 06:52:41 +00:00
libs: encoder: h264,h265: guard VA version for max_qp property
This patch fixes a regression from commit 5b1fe9c6
.
max_qp, in rate control configuration, appeared in libva release
2.1 (API 1.1), thus it is required to guard the VA API version.
Fixes: #150
This commit is contained in:
parent
c048594370
commit
029bb3e504
3 changed files with 10 additions and 0 deletions
|
@ -2519,10 +2519,13 @@ 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).window_size = encoder->cpb_length;
|
||||||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).initial_qp = encoder->init_qp;
|
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).initial_qp = encoder->init_qp;
|
||||||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).min_qp = encoder->min_qp;
|
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).min_qp = encoder->min_qp;
|
||||||
|
|
||||||
|
#if VA_CHECK_VERSION(1,1,0)
|
||||||
/* @FIXME: should not set this value, should be ignored if set to zero *
|
/* @FIXME: should not set this value, should be ignored if set to zero *
|
||||||
* https://github.com/intel/media-driver/issues/587 */
|
* https://github.com/intel/media-driver/issues/587 */
|
||||||
if (encoder->min_qp > 0)
|
if (encoder->min_qp > 0)
|
||||||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).max_qp = 51;
|
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).max_qp = 51;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if VA_CHECK_VERSION(1,0,0)
|
#if VA_CHECK_VERSION(1,0,0)
|
||||||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).rc_flags.bits.mb_rate_control =
|
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).rc_flags.bits.mb_rate_control =
|
||||||
|
|
|
@ -2449,10 +2449,14 @@ ensure_misc_params (GstVaapiEncoderH264Fei * encoder,
|
||||||
rate_control->window_size = encoder->cpb_length;
|
rate_control->window_size = encoder->cpb_length;
|
||||||
rate_control->initial_qp = encoder->init_qp;
|
rate_control->initial_qp = encoder->init_qp;
|
||||||
rate_control->min_qp = encoder->min_qp;
|
rate_control->min_qp = encoder->min_qp;
|
||||||
|
|
||||||
|
#if VA_CHECK_VERSION(1,1,0)
|
||||||
/* @FIXME: should not set this value, should be ignored if set to zero *
|
/* @FIXME: should not set this value, should be ignored if set to zero *
|
||||||
* https://github.com/intel/media-driver/issues/587 */
|
* https://github.com/intel/media-driver/issues/587 */
|
||||||
if (rate_control->min_qp > 0)
|
if (rate_control->min_qp > 0)
|
||||||
rate_control->max_qp = 51;
|
rate_control->max_qp = 51;
|
||||||
|
#endif
|
||||||
|
|
||||||
rate_control->basic_unit_size = 0;
|
rate_control->basic_unit_size = 0;
|
||||||
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);
|
||||||
|
|
|
@ -1865,10 +1865,13 @@ 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).window_size = encoder->cpb_length;
|
||||||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).initial_qp = encoder->init_qp;
|
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).initial_qp = encoder->init_qp;
|
||||||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).min_qp = encoder->min_qp;
|
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).min_qp = encoder->min_qp;
|
||||||
|
|
||||||
|
#if VA_CHECK_VERSION(1,1,0)
|
||||||
/* @FIXME: should not set this value, should be ignored if set to zero *
|
/* @FIXME: should not set this value, should be ignored if set to zero *
|
||||||
* https://github.com/intel/media-driver/issues/587 */
|
* https://github.com/intel/media-driver/issues/587 */
|
||||||
if (encoder->min_qp > 0)
|
if (encoder->min_qp > 0)
|
||||||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).max_qp = 51;
|
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).max_qp = 51;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if VA_CHECK_VERSION(1,0,0)
|
#if VA_CHECK_VERSION(1,0,0)
|
||||||
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).rc_flags.bits.mb_rate_control =
|
GST_VAAPI_ENCODER_VA_RATE_CONTROL (encoder).rc_flags.bits.mb_rate_control =
|
||||||
|
|
Loading…
Reference in a new issue