[SCM] libav/experimental: Set rgb2yuv constants more accurately, makes no real difference though.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:29:57 UTC 2013


The following commit has been merged in the experimental branch:
commit 7b5d7b9e85bc96ba77315d730f9351bc23dfdb71
Author: Michael Niedermayer <michaelni at gmx.at>
Date:   Thu Sep 11 01:49:35 2008 +0000

    Set rgb2yuv constants more accurately, makes no real difference though.
    
    Originally committed as revision 27577 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index b55d4d2..646885d 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -153,15 +153,15 @@ unsigned swscale_version(void)
     )
 
 #define RGB2YUV_SHIFT 15
-#define BY ((int)( 0.098*(1<<RGB2YUV_SHIFT)+0.5))
-#define BV ((int)(-0.071*(1<<RGB2YUV_SHIFT)+0.5))
-#define BU ((int)( 0.439*(1<<RGB2YUV_SHIFT)+0.5))
-#define GY ((int)( 0.504*(1<<RGB2YUV_SHIFT)+0.5))
-#define GV ((int)(-0.368*(1<<RGB2YUV_SHIFT)+0.5))
-#define GU ((int)(-0.291*(1<<RGB2YUV_SHIFT)+0.5))
-#define RY ((int)( 0.257*(1<<RGB2YUV_SHIFT)+0.5))
-#define RV ((int)( 0.439*(1<<RGB2YUV_SHIFT)+0.5))
-#define RU ((int)(-0.148*(1<<RGB2YUV_SHIFT)+0.5))
+#define BY ( (int)(0.114*219/255*(1<<RGB2YUV_SHIFT)+0.5))
+#define BV (-(int)(0.081*224/255*(1<<RGB2YUV_SHIFT)+0.5))
+#define BU ( (int)(0.500*224/255*(1<<RGB2YUV_SHIFT)+0.5))
+#define GY ( (int)(0.587*219/255*(1<<RGB2YUV_SHIFT)+0.5))
+#define GV (-(int)(0.419*224/255*(1<<RGB2YUV_SHIFT)+0.5))
+#define GU (-(int)(0.331*224/255*(1<<RGB2YUV_SHIFT)+0.5))
+#define RY ( (int)(0.299*219/255*(1<<RGB2YUV_SHIFT)+0.5))
+#define RV ( (int)(0.500*224/255*(1<<RGB2YUV_SHIFT)+0.5))
+#define RU (-(int)(0.169*224/255*(1<<RGB2YUV_SHIFT)+0.5))
 
 extern const int32_t Inverse_Table_6_9[8][4];
 

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list