[Mesa-dev] [PATCH] st/va: Support fractional framerate in misc parameter
Andy Furniss
adf.lists at gmail.com
Mon Jan 30 11:57:36 UTC 2017
Mark Thompson wrote:
> Signed-off-by: Mark Thompson <sw at jkqxz.net>
> ---
> See <https://cgit.freedesktop.org/libva/tree/va/va.h#n1277> - this is a recent addition, but is backwards-compatible.
>
> Depends on Andy's patch <https://lists.freedesktop.org/archives/mesa-dev/2017-January/142242.html> for actual support for fractional framerate.
Seems good testing so far, in the sense that it doesn't regress anything.
Added CCs.
>
> src/gallium/state_trackers/va/picture.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c
> index a024437bff..8073ad8906 100644
> --- a/src/gallium/state_trackers/va/picture.c
> +++ b/src/gallium/state_trackers/va/picture.c
> @@ -357,7 +357,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;
> }
>
>
More information about the mesa-dev
mailing list