# HG changeset patch # User michael # Date 1174221113 0 # Node ID f37a3ef2685e57e7b62c2db8cb4731d29cf15950 # Parent 595f9fb8082791543eef690c5ef3fc455d76b19e fix full range (jpeg yuv) chroma diff -r 595f9fb80827 -r f37a3ef2685e libswscale/swscale.c --- a/libswscale/swscale.c Sun Mar 18 11:04:47 2007 +0000 +++ b/libswscale/swscale.c Sun Mar 18 12:31:53 2007 +0000 @@ -1876,7 +1876,12 @@ 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; diff -r 595f9fb80827 -r f37a3ef2685e libswscale/yuv2rgb.c --- a/libswscale/yuv2rgb.c Sun Mar 18 11:04:47 2007 +0000 +++ b/libswscale/yuv2rgb.c Sun Mar 18 12:31:53 2007 +0000 @@ -670,6 +670,11 @@ 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; diff -r 595f9fb80827 -r f37a3ef2685e libswscale/yuv2rgb_init.c --- a/libswscale/yuv2rgb_init.c Sun Mar 18 11:04:47 2007 +0000 +++ b/libswscale/yuv2rgb_init.c Sun Mar 18 12:31:53 2007 +0000 @@ -263,6 +263,11 @@ 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;