From 9f644295dca3ad077beb217f4e105ab11cf338c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20K=C3=B6nig?= Date: Wed, 16 Dec 2015 21:11:17 +0100 Subject: [PATCH] st/va: use vl_video_buffer_adjust_size MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Use the new helper function instead of open coding it. Signed-off-by: Christian König Reviewed-by: Emil Velikov --- src/gallium/state_trackers/va/image.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/gallium/state_trackers/va/image.c b/src/gallium/state_trackers/va/image.c index 044ce3a1858..2c42a985823 100644 --- a/src/gallium/state_trackers/va/image.c +++ b/src/gallium/state_trackers/va/image.c @@ -34,6 +34,7 @@ #include "util/u_video.h" #include "vl/vl_winsys.h" +#include "vl/vl_video_buffer.h" #include "va_private.h" @@ -61,15 +62,9 @@ vlVaVideoSurfaceSize(vlVaSurface *p_surf, int component, *width = p_surf->templat.width; *height = p_surf->templat.height; - if (component > 0) { - if (p_surf->templat.chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420) { - *width /= 2; - *height /= 2; - } else if (p_surf->templat.chroma_format == PIPE_VIDEO_CHROMA_FORMAT_422) - *width /= 2; - } - if (p_surf->templat.interlaced) - *height /= 2; + vl_video_buffer_adjust_size(width, height, component, + p_surf->templat.chroma_format, + p_surf->templat.interlaced); } VAStatus -- 2.30.2