libs: encoder: vp8: fix bitrate calculation

Base encoder's unit of bitrate is in Kbps. We should honor it so
we use the value of bitrate in VA, in which is expressed in bps.

https://bugzilla.gnome.org/show_bug.cgi?id=749950
This commit is contained in:
Hyunjun Ko 2017-02-09 12:39:19 +09:00 committed by Víctor Manuel Jáquez Leal
parent 025d5ce33e
commit ffc5b43da7

View file

@ -129,8 +129,9 @@ ensure_bitrate (GstVaapiEncoderVP8 * encoder)
gst_util_uint64_scale (GST_VAAPI_ENCODER_WIDTH (encoder) *
GST_VAAPI_ENCODER_HEIGHT (encoder),
GST_VAAPI_ENCODER_FPS_N (encoder),
GST_VAAPI_ENCODER_FPS_D (encoder)) / 4 * 1000;
GST_VAAPI_ENCODER_FPS_D (encoder)) / (4 * 1000);
}
break;
default:
base_encoder->bitrate = 0;
break;
@ -219,7 +220,7 @@ fill_sequence (GstVaapiEncoderVP8 * encoder, GstVaapiEncSequence * sequence)
seq_param->frame_height = GST_VAAPI_ENCODER_HEIGHT (encoder);
if (GST_VAAPI_ENCODER_RATE_CONTROL (encoder) & GST_VAAPI_RATECONTROL_CBR)
seq_param->bits_per_second = base_encoder->bitrate;
seq_param->bits_per_second = base_encoder->bitrate * 1000;
seq_param->intra_period = base_encoder->keyframe_period;