[xiph-commits] r14641 - branches/theora-thusnelda/lib/enc

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Thu Mar 27 07:48:16 PDT 2008


Author: xiphmont
Date: 2008-03-27 07:48:15 -0700 (Thu, 27 Mar 2008)
New Revision: 14641

Modified:
   branches/theora-thusnelda/lib/enc/mode.c
Log:
Might as well make use of some preexisting asm for INTER SAD calculation



Modified: branches/theora-thusnelda/lib/enc/mode.c
===================================================================
--- branches/theora-thusnelda/lib/enc/mode.c	2008-03-27 11:01:12 UTC (rev 14640)
+++ branches/theora-thusnelda/lib/enc/mode.c	2008-03-27 14:48:15 UTC (rev 14641)
@@ -305,8 +305,6 @@
     0, 1, 1, 1,  0, 1, 1, 1,  0, 1, 1, 1,  0, 1, 1, 1 }
 };
 
-#define AV(a) ((r[a]+(int)r2[a])>>1)
-
 static int BInterSAD(CP_INSTANCE *cpi, int fi, int plane, int goldenp, mv_t mv, int qp){
   int sad = 0;
   unsigned char *b = cpi->frame + cpi->frag_buffer_index[fi];
@@ -321,22 +319,9 @@
   
   if(mx2 || my2){
     unsigned char *r2 = r + my2 * stride + mx2;
-    
-    for(j=0;j<8;j++){
-      for(k=0;k<8;k++)
-	sad += abs(b[k]-AV(k));
-      b += stride;
-      r += stride;
-      r2 += stride;
-    }
-    
+    sad =  dsp_sad8x8_xy2_thres (cpi->dsp, b, r, r2, stride, 9999999);
   }else{
-    for(j=0;j<8;j++){
-      for(k=0;k<8;k++)
-	sad += abs (b[k]-(int)r[k]);
-      b += stride;
-      r += stride;
-    }
+    sad =  dsp_sad8x8 (cpi->dsp, b, r, stride);
   }
 
   if(plane)



More information about the commits mailing list