]> git.sesse.net Git - ffmpeg/commitdiff
100l FastUVMC rounding was incorrect.
authorKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 1 Dec 2006 07:24:56 +0000 (07:24 +0000)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 1 Dec 2006 07:24:56 +0000 (07:24 +0000)
This should also improve quality on WMV9Drifting.asf

Originally committed as revision 7190 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/vc1.c

index db1a5fa9d57d23a3c43e5b52397d7a6f1cea1011..cd3c0c2d6aa576e8c9d7ded01b56bcbda64aa8fa 100644 (file)
@@ -879,8 +879,8 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
     }
 
     if(v->fastuvmc) {
-        uvmx = uvmx + ((uvmx<0)?(uvmx&1):-(uvmx&1));
-        uvmy = uvmy + ((uvmy<0)?(uvmy&1):-(uvmy&1));
+        uvmx = uvmx + ((uvmx<0)?-(uvmx&1):(uvmx&1));
+        uvmy = uvmy + ((uvmy<0)?-(uvmy&1):(uvmy&1));
     }
 
     if(s->mspel) {
@@ -1103,8 +1103,8 @@ static void vc1_mc_4mv_chroma(VC1Context *v)
     }
 
     if(v->fastuvmc) {
-        uvmx = uvmx + ((uvmx<0)?(uvmx&1):-(uvmx&1));
-        uvmy = uvmy + ((uvmy<0)?(uvmy&1):-(uvmy&1));
+        uvmx = uvmx + ((uvmx<0)?-(uvmx&1):(uvmx&1));
+        uvmy = uvmy + ((uvmy<0)?-(uvmy&1):(uvmy&1));
     }
 
     /* Chroma MC always uses qpel bilinear */
@@ -2124,8 +2124,8 @@ static void vc1_interp_mc(VC1Context *v)
     }
 
     if(v->fastuvmc) {
-        uvmx = uvmx + ((uvmx<0)?(uvmx&1):-(uvmx&1));
-        uvmy = uvmy + ((uvmy<0)?(uvmy&1):-(uvmy&1));
+        uvmx = uvmx + ((uvmx<0)?-(uvmx&1):(uvmx&1));
+        uvmy = uvmy + ((uvmy<0)?-(uvmy&1):(uvmy&1));
     }
 
     mx >>= 1;