encoder : h264: Disable b-frame encode in low-power mode

This is a workaround since vaapi-intel-driver doesn't have
support for B-frame encode when utilizing low-power-enc
hardware block.

Fixme :We should query the VAConfigAttribEncMaxRefFrames
instead of blindly disabling b-frame support and set b/p frame count,
buffer pool size etc based on the query result.

https://bugzilla.gnome.org/show_bug.cgi?id=766050
This commit is contained in:
Sreerenj Balachandran 2016-05-13 11:45:20 +03:00
parent 43af7c362c
commit c91de2398a

View file

@ -2451,6 +2451,20 @@ reset_properties (GstVaapiEncoderH264 * encoder)
if (encoder->num_bframes > (base_encoder->keyframe_period + 1) / 2)
encoder->num_bframes = (base_encoder->keyframe_period + 1) / 2;
/* Workaround : vaapi-intel-driver doesn't have support for
* B-frame encode when utilizing low-power encode hardware block.
* So Disabling b-frame encoding in low-pwer encode.
*
* Fixme :We should query the VAConfigAttribEncMaxRefFrames
* instead of blindly disabling b-frame support and set b/p frame count,
* buffer pool size etc based on that.*/
if ((encoder->num_bframes > 0)
&& (encoder->entrypoint == GST_VAAPI_ENTRYPOINT_SLICE_ENCODE_LP)) {
GST_WARNING
("Disabling b-frame since the driver doesn't supporting it in low-power encode");
encoder->num_bframes = 0;
}
if (encoder->num_bframes)
encoder->cts_offset = GST_SECOND * GST_VAAPI_ENCODER_FPS_D (encoder) /
GST_VAAPI_ENCODER_FPS_N (encoder);