[MPlayer-cvslog] r22713 - in trunk/libswscale: swscale.c yuv2rgb.c yuv2rgb_init.c

michael subversion at mplayerhq.hu
Sun Mar 18 13:31:53 CET 2007


Author: michael
Date: Sun Mar 18 13:31:53 2007
New Revision: 22713

Modified:
   trunk/libswscale/swscale.c
   trunk/libswscale/yuv2rgb.c
   trunk/libswscale/yuv2rgb_init.c

Log:
fix full range (jpeg yuv) chroma


Modified: trunk/libswscale/swscale.c
==============================================================================
--- trunk/libswscale/swscale.c	(original)
+++ trunk/libswscale/swscale.c	Sun Mar 18 13:31:53 2007
@@ -1876,7 +1876,12 @@ int sws_setColorspaceDetails(SwsContext 
 	if(!srcRange){
 		cy= (cy*255) / 219;
 		oy= 16<<16;
-	}
+	}else{
+                crv= (crv*224) / 255;
+                cbu= (cbu*224) / 255;
+                cgu= (cgu*224) / 255;
+                cgv= (cgv*224) / 255;
+        }
 
 	cy = (cy *contrast             )>>16;
 	crv= (crv*contrast * saturation)>>32;

Modified: trunk/libswscale/yuv2rgb.c
==============================================================================
--- trunk/libswscale/yuv2rgb.c	(original)
+++ trunk/libswscale/yuv2rgb.c	Sun Mar 18 13:31:53 2007
@@ -670,6 +670,11 @@ int yuv2rgb_c_init_tables (SwsContext *c
     if(!fullRange){
 	cy= (cy*255) / 219;
 	oy= 16<<16;
+    }else{
+        crv= (crv*224) / 255;
+        cbu= (cbu*224) / 255;
+        cgu= (cgu*224) / 255;
+        cgv= (cgv*224) / 255;
     }
 	
     cy = (cy *contrast             )>>16;

Modified: trunk/libswscale/yuv2rgb_init.c
==============================================================================
--- trunk/libswscale/yuv2rgb_init.c	(original)
+++ trunk/libswscale/yuv2rgb_init.c	Sun Mar 18 13:31:53 2007
@@ -263,6 +263,11 @@ int yuv2rgb_c_init_tables(SwsContext *c,
     if (fullRange) {
         cy = 1 << 16;
         oy = 0;
+        crv= (crv*224) / 255;
+        cbu= (cbu*224) / 255;
+        cgu= (cgu*224) / 255;
+        cgv= (cgv*224) / 255;
+        //FIXME maybe its cleaner if the tables where based on full range (*244/255)
     } else {
         cy = ((1 << 16) * 255) / 219;
         oy= 16 << 16;



More information about the MPlayer-cvslog mailing list