encoder: h264: fix ip_period value in sequence parameter.

The VAEncSequenceParameterBuffer.ip_period value reprents the distance
between the I-frame and the next P-frame. So, this also accounts for
any additional B-frame in the middle of it.

This fixes rate control heuristics for certain VA drivers.

https://bugzilla.gnome.org/show_bug.cgi?id=722735
This commit is contained in:
Gwenole Beauchesne 2014-01-21 17:35:24 +01:00
parent 586f872085
commit d9cf58e88a

View file

@ -1080,7 +1080,7 @@ fill_sequence (GstVaapiEncoderH264 * encoder, GstVaapiEncSequence * sequence)
seq_param->seq_parameter_set_id = 0;
seq_param->level_idc = encoder->level_idc;
seq_param->intra_period = GST_VAAPI_ENCODER_KEYFRAME_PERIOD (encoder);
seq_param->ip_period = 0; // ?
seq_param->ip_period = 1 + encoder->num_bframes;
if (base_encoder->bitrate > 0)
seq_param->bits_per_second = base_encoder->bitrate * 1000;
else