changeset 27291:ca46d66b3143

Make C code in yuv2yuv1() do accurate rounding, this could be split depending on SWS_ACCURATE as well if someone wants.
author michael
date Fri, 18 Jul 2008 00:09:09 +0000
parents c7893977be2c
children 80ee781f6528
files libswscale/swscale_template.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libswscale/swscale_template.c	Thu Jul 17 23:43:48 2008 +0000
+++ b/libswscale/swscale_template.c	Fri Jul 18 00:09:09 2008 +0000
@@ -1020,7 +1020,7 @@
     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 @@
     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;