[MPlayer-cvslog] r31742 - in trunk/libvo: gl_common.h vo_gl.c

reimar subversion at mplayerhq.hu
Thu Jul 15 20:50:57 CEST 2010


Author: reimar
Date: Thu Jul 15 20:50:57 2010
New Revision: 31742

Log:
Helper macros to build the yuv conversion type number.

Modified:
   trunk/libvo/gl_common.h
   trunk/libvo/vo_gl.c

Modified: trunk/libvo/gl_common.h
==============================================================================
--- trunk/libvo/gl_common.h	Thu Jul 15 20:46:49 2010	(r31741)
+++ trunk/libvo/gl_common.h	Thu Jul 15 20:50:57 2010	(r31742)
@@ -345,6 +345,9 @@ int loadGPUProgram(GLenum target, char *
 #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 {

Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c	Thu Jul 15 20:46:49 2010	(r31741)
+++ trunk/libvo/vo_gl.c	Thu Jul 15 20:50:57 2010	(r31742)
@@ -515,7 +515,9 @@ static int initGl(uint32_t d_width, uint
   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);
 


More information about the MPlayer-cvslog mailing list