st/va: Support fractional framerate in misc parameter
authorMark Thompson <sw@jkqxz.net>
Fri, 27 Jan 2017 22:03:10 +0000 (22:03 +0000)
committerChristian König <christian.koenig@amd.com>
Mon, 6 Mar 2017 13:04:59 +0000 (14:04 +0100)
Signed-off-by: Mark Thompson <sw@jkqxz.net>
Acked-by: Christian König <christian.koenig@amd.com>
src/gallium/state_trackers/va/picture.c

index 53bb9eb9e32ff3ef96cffa8119a3d2a28bde6226..ef8b57a47f57a24b6f2567677b2518e9a9be5633 100644 (file)
@@ -348,7 +348,13 @@ static VAStatus
 handleVAEncMiscParameterTypeFrameRate(vlVaContext *context, VAEncMiscParameterBuffer *misc)
 {
    VAEncMiscParameterFrameRate *fr = (VAEncMiscParameterFrameRate *)misc->data;
-   context->desc.h264enc.rate_ctrl.frame_rate_num = fr->framerate;
+   if (fr->framerate & 0xffff0000) {
+      context->desc.h264enc.rate_ctrl.frame_rate_num = fr->framerate       & 0xffff;
+      context->desc.h264enc.rate_ctrl.frame_rate_den = fr->framerate >> 16 & 0xffff;
+   } else {
+      context->desc.h264enc.rate_ctrl.frame_rate_num = fr->framerate;
+      context->desc.h264enc.rate_ctrl.frame_rate_den = 1;
+   }
    return VA_STATUS_SUCCESS;
 }