[xiph-commits] r14320 - trunk/theora/lib/dec

tterribe at svn.xiph.org tterribe at svn.xiph.org
Sat Dec 22 09:07:51 PST 2007


Author: tterribe
Date: 2007-12-22 09:07:49 -0800 (Sat, 22 Dec 2007)
New Revision: 14320

Modified:
   trunk/theora/lib/dec/decode.c
Log:
Don't use bx in the dering loop when its still got the value from the last loop,
 which can be out of bounds.


Modified: trunk/theora/lib/dec/decode.c
===================================================================
--- trunk/theora/lib/dec/decode.c	2007-12-20 16:49:02 UTC (rev 14319)
+++ trunk/theora/lib/dec/decode.c	2007-12-22 17:07:49 UTC (rev 14320)
@@ -1916,71 +1916,54 @@
   for(by=0;by<8;by++){
     int a;
     int b;
-    int p;
-    int p1;
-    int a1;
+    int w;
     a=128;
     b=64;
-    p=src[0];
-    p1=*(src-!(_b&1));
-    a1=hmod[(bx<<3)+by];
-    a-=a1;
-    b+=a1*p1;
-    p1=psrc[0];
-    a1=vmod[(by<<3)+bx];
-    a-=a1;
-    b+=a1*p1;
-    p1=nsrc[0];
-    a1=vmod[(by+1<<3)+bx];
-    a-=a1;
-    b+=a1*p1;
-    p1=src[1];
-    a1=hmod[(bx+1<<3)+by];
-    a-=a1;
-    b+=a1*p1;
-    dst[0]=OC_CLAMP255(a*p+b>>7);
+    w=hmod[by];
+    a-=w;
+    b+=w**(src-!(_b&1));
+    w=vmod[(by<<3)];
+    a-=w;
+    b+=w*psrc[0];
+    w=vmod[(by+1<<3)];
+    a-=w;
+    b+=w*nsrc[0];
+    w=hmod[(1<<3)+by];
+    a-=w;
+    b+=w*src[1];
+    dst[0]=OC_CLAMP255(a*src[0]+b>>7);
     for(bx=1;bx<7;bx++){
       a=128;
       b=64;
-      p=src[bx];
-      p1=src[bx-1];
-      a1=hmod[(bx<<3)+by];
-      a-=a1;
-      b+=a1*p1;
-      p1=psrc[bx];
-      a1=vmod[(by<<3)+bx];
-      a-=a1;
-      b+=a1*p1;
-      p1=nsrc[bx];
-      a1=vmod[(by+1<<3)+bx];
-      a-=a1;
-      b+=a1*p1;
-      p1=src[bx+1];
-      a1=hmod[(bx+1<<3)+by];
-      a-=a1;
-      b+=a1*p1;
-      dst[bx]=OC_CLAMP255(a*p+b>>7);
+      w=hmod[(bx<<3)+by];
+      a-=w;
+      b+=w*src[bx-1];
+      w=vmod[(by<<3)+bx];
+      a-=w;
+      b+=w*psrc[bx];
+      w=vmod[(by+1<<3)+bx];
+      a-=w;
+      b+=w*nsrc[bx];
+      w=hmod[(bx+1<<3)+by];
+      a-=w;
+      b+=w*src[bx+1];
+      dst[bx]=OC_CLAMP255(a*src[bx]+b>>7);
     }
     a=128;
     b=64;
-    p=src[7];
-    p1=src[6];
-    a1=hmod[(bx<<3)+by];
-    a-=a1;
-    b+=a1*p1;
-    p1=psrc[7];
-    a1=vmod[(by<<3)+bx];
-    a-=a1;
-    b+=a1*p1;
-    p1=nsrc[7];
-    a1=vmod[(by+1<<3)+bx];
-    a-=a1;
-    b+=a1*p1;
-    p1=src[7+!(_b&2)];
-    a1=hmod[(bx+1<<3)+by];
-    a-=a1;
-    b+=a1*p1;
-    dst[7]=OC_CLAMP255(a*p+b>>7);
+    w=hmod[(7<<3)+by];
+    a-=w;
+    b+=w*src[6];
+    w=vmod[(by<<3)+7];
+    a-=w;
+    b+=w*psrc[7];
+    w=vmod[(by+1<<3)+7];
+    a-=w;
+    b+=w*nsrc[7];
+    w=hmod[(8<<3)+by];
+    a-=w;
+    b+=w*src[7+!(_b&2)];
+    dst[7]=OC_CLAMP255(a*src[7]+b>>7);
     dst+=_ystride;
     psrc=src;
     src=nsrc;



More information about the commits mailing list