[MPlayer-cvslog] r33504 - in trunk/libvo: vo_gl.c vo_gl2.c

reimar subversion at mplayerhq.hu
Wed May 25 20:23:12 CEST 2011


Author: reimar
Date: Wed May 25 20:23:11 2011
New Revision: 33504

Log:
Fix clear/border color of chroma texture for 9- and 10-bit formats.
Avoids pink borders for those formats.

Modified:
   trunk/libvo/vo_gl.c
   trunk/libvo/vo_gl2.c

Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c	Wed May 25 15:46:32 2011	(r33503)
+++ trunk/libvo/vo_gl.c	Wed May 25 20:23:11 2011	(r33504)
@@ -550,9 +550,11 @@ static int initGl(uint32_t d_width, uint
 
   if (is_yuv) {
     int i;
-    int xs, ys;
+    int xs, ys, depth;
+    int chroma_clear_val = 128;
     scale_type = get_scale_type(1);
-    mp_get_chroma_shift(image_format, &xs, &ys, NULL);
+    mp_get_chroma_shift(image_format, &xs, &ys, &depth);
+    chroma_clear_val >>= -depth & 7;
     mpglGenTextures(21, default_texs);
     default_texs[21] = 0;
     for (i = 0; i < 7; i++) {
@@ -563,12 +565,14 @@ static int initGl(uint32_t d_width, uint
     }
     mpglActiveTexture(GL_TEXTURE1);
     glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, scale_type,
-                     texture_width >> xs, texture_height >> ys, 128);
+                     texture_width >> xs, texture_height >> ys,
+                     chroma_clear_val);
     if (mipmap_gen)
       mpglTexParameteri(gl_target, GL_GENERATE_MIPMAP, GL_TRUE);
     mpglActiveTexture(GL_TEXTURE2);
     glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, scale_type,
-                     texture_width >> xs, texture_height >> ys, 128);
+                     texture_width >> xs, texture_height >> ys,
+                     chroma_clear_val);
     if (mipmap_gen)
       mpglTexParameteri(gl_target, GL_GENERATE_MIPMAP, GL_TRUE);
     mpglActiveTexture(GL_TEXTURE0);

Modified: trunk/libvo/vo_gl2.c
==============================================================================
--- trunk/libvo/vo_gl2.c	Wed May 25 15:46:32 2011	(r33503)
+++ trunk/libvo/vo_gl2.c	Wed May 25 20:23:11 2011	(r33504)
@@ -274,14 +274,18 @@ static int initTextures(void)
 
       glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
       if (is_yuv) {
-        int xs, ys;
-        mp_get_chroma_shift(image_format, &xs, &ys, NULL);
+        int xs, ys, depth;
+        int chroma_clear_val = 128;
+        mp_get_chroma_shift(image_format, &xs, &ys, &depth);
+        chroma_clear_val >>= -depth & 7;
         mpglActiveTexture(GL_TEXTURE1);
         glCreateClearTex(GL_TEXTURE_2D, gl_internal_format, gl_bitmap_format,  gl_bitmap_type, GL_LINEAR,
-                         texture_width >> xs, texture_height >> ys, 128);
+                         texture_width >> xs, texture_height >> ys,
+                         chroma_clear_val);
         mpglActiveTexture(GL_TEXTURE2);
         glCreateClearTex(GL_TEXTURE_2D, gl_internal_format, gl_bitmap_format,  gl_bitmap_type, GL_LINEAR,
-                         texture_width >> xs, texture_height >> ys, 128);
+                         texture_width >> xs, texture_height >> ys,
+                         chroma_clear_val);
         mpglActiveTexture(GL_TEXTURE0);
       }
 


More information about the MPlayer-cvslog mailing list