st/vdpau: use vl_video_buffer_adjust_size
authorChristian König <christian.koenig@amd.com>
Tue, 15 Dec 2015 10:53:48 +0000 (11:53 +0100)
committerChristian König <christian.koenig@amd.com>
Tue, 12 Jan 2016 12:28:21 +0000 (13:28 +0100)
Use the new helper function instead of open coding it.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
src/gallium/state_trackers/vdpau/surface.c

index 55d0d76d16d3f2ab7087ddf974d0534874dc1018..ffcedc12de67011822917ed796f8cd4a37b5a049 100644 (file)
@@ -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);
 }
 
 /**