[MPlayer-cvslog] r27323 - trunk/libswscale/swscale_template.c

michael subversion at mplayerhq.hu
Fri Jul 18 02:09:09 CEST 2008


Author: michael
Date: Fri Jul 18 02:09:09 2008
New Revision: 27323

Log:
Make C code in yuv2yuv1() do accurate rounding, this could be split
depending on SWS_ACCURATE as well if someone wants.


Modified:
   trunk/libswscale/swscale_template.c

Modified: trunk/libswscale/swscale_template.c
==============================================================================
--- trunk/libswscale/swscale_template.c	(original)
+++ trunk/libswscale/swscale_template.c	Fri Jul 18 02:09:09 2008
@@ -1020,7 +1020,7 @@ static inline void RENAME(yuv2yuv1)(SwsC
     int i;
     for (i=0; i<dstW; i++)
     {
-        int val= lumSrc[i]>>7;
+        int val= (lumSrc[i]+64)>>7;
 
         if (val&256){
             if (val<0) val=0;
@@ -1033,8 +1033,8 @@ static inline void RENAME(yuv2yuv1)(SwsC
     if (uDest)
         for (i=0; i<chrDstW; i++)
         {
-            int u=chrSrc[i]>>7;
-            int v=chrSrc[i + VOFW]>>7;
+            int u=(chrSrc[i       ]+64)>>7;
+            int v=(chrSrc[i + VOFW]+64)>>7;
 
             if ((u|v)&256){
                 if (u<0)        u=0;



More information about the MPlayer-cvslog mailing list