[Mesa-dev] [PATCH 3/9] st/vdpau: use vl_video_buffer_adjust_size

Christian König deathsimple at vodafone.de
Wed Dec 16 12:14:35 PST 2015


From: Christian König <christian.koenig at amd.com>

Use the new helper function instead of open coding it.

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 src/gallium/state_trackers/vdpau/surface.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/gallium/state_trackers/vdpau/surface.c b/src/gallium/state_trackers/vdpau/surface.c
index 55d0d76..ffcedc1 100644
--- a/src/gallium/state_trackers/vdpau/surface.c
+++ b/src/gallium/state_trackers/vdpau/surface.c
@@ -183,16 +183,9 @@ vlVdpVideoSurfaceSize(vlVdpSurface *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);
 }
 
 /**
-- 
2.5.0



More information about the mesa-dev mailing list