mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
libs: encoder: vp8: fix frame rate calculation
According to the VA documentation: The framerate is specified as a number of frames per second, as a fraction. The denominator of the fraction is given in the top half (the high two bytes) of the framerate field, and the numerator is given in the bottom half (the low two bytes). For example, if framerate is set to (100 << 16 | 750), this is 750 / 100, hence 7.5fps. If the denominator is zero (the high two bytes are both zero) then it takes the value one instead, so the framerate is just the integer in the low 2 bytes. This patch fixes the the framerate calculation in vp8 encoder according to this. https://bugzilla.gnome.org/show_bug.cgi?id=783449
This commit is contained in:
parent
baac8dc8a3
commit
daff4e9fbd
1 changed files with 2 additions and 2 deletions
|
@ -312,8 +312,8 @@ ensure_control_rate_params (GstVaapiEncoderVP8 * encoder,
|
|||
return FALSE;
|
||||
{
|
||||
VAEncMiscParameterFrameRate fr = {
|
||||
.framerate =
|
||||
GST_VAAPI_ENCODER_FPS_N (encoder) / GST_VAAPI_ENCODER_FPS_D (encoder),
|
||||
.framerate = (guint) GST_VAAPI_ENCODER_FPS_D (encoder) << 16 |
|
||||
GST_VAAPI_ENCODER_FPS_N (encoder),
|
||||
};
|
||||
memcpy (misc->data, &fr, sizeof (fr));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue