summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2017-06-05 16:34:12 +0200
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2017-06-07 11:24:38 +0200
commitdaff4e9fbd7637832ba1c0d1aebca3f4b0e254e2 (patch)
tree06bf03ceaf63d0fb5a4b4e227146ac42b7052bab
parentbaac8dc8a398c1d88a1c0e6d885fed2052a78c04 (diff)
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
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder_vp8.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_vp8.c b/gst-libs/gst/vaapi/gstvaapiencoder_vp8.c
index eeb2b6b7..5c895dbd 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder_vp8.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder_vp8.c
@@ -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));
}