changeset 31676:a0a48c62bb8c

Helper macros to build the yuv conversion type number.
author reimar
date Thu, 15 Jul 2010 18:50:57 +0000
parents a40db79e6672
children cc01d9cee8f0
files libvo/gl_common.h libvo/vo_gl.c
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/gl_common.h	Thu Jul 15 18:46:49 2010 +0000
+++ b/libvo/gl_common.h	Thu Jul 15 18:50:57 2010 +0000
@@ -345,6 +345,9 @@
 #define YUV_LUM_SCALER(t) (((t) >> YUV_LUM_SCALER_SHIFT) & YUV_SCALER_MASK)
 //! extract chrominance scaler out of type
 #define YUV_CHROM_SCALER(t) (((t) >> YUV_CHROM_SCALER_SHIFT) & YUV_SCALER_MASK)
+#define SET_YUV_CONVERSION(c)   ((c) & YUV_CONVERSION_MASK)
+#define SET_YUV_LUM_SCALER(s)   (((s) & YUV_SCALER_MASK) << YUV_LUM_SCALER_SHIFT)
+#define SET_YUV_CHROM_SCALER(s) (((s) & YUV_SCALER_MASK) << YUV_CHROM_SCALER_SHIFT)
 /** \} */
 
 typedef struct {
--- a/libvo/vo_gl.c	Thu Jul 15 18:46:49 2010 +0000
+++ b/libvo/vo_gl.c	Thu Jul 15 18:50:57 2010 +0000
@@ -515,7 +515,9 @@
   int scale_type = mipmap_gen ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR;
   autodetectGlExtensions();
   gl_target = use_rectangle == 1 ? GL_TEXTURE_RECTANGLE : GL_TEXTURE_2D;
-  yuvconvtype = use_yuv | lscale << YUV_LUM_SCALER_SHIFT | cscale << YUV_CHROM_SCALER_SHIFT;
+  yuvconvtype = SET_YUV_CONVERSION(use_yuv) |
+                SET_YUV_LUM_SCALER(lscale) |
+                SET_YUV_CHROM_SCALER(cscale);
 
   texSize(image_width, image_height, &texture_width, &texture_height);