[xiph-commits] r11539 - in branches/theora-playtime/lib: . x86_32_vs

illiminable at svn.xiph.org illiminable at svn.xiph.org
Wed Jun 7 10:27:55 PDT 2006


Author: illiminable
Date: 2006-06-07 10:27:44 -0700 (Wed, 07 Jun 2006)
New Revision: 11539

Modified:
   branches/theora-playtime/lib/scan.c
   branches/theora-playtime/lib/x86_32_vs/idct_sse2.c
Log:
* Factor out duplicated code in scan.c/RowDiffScan so optimisation opportunities become apparent... the compiler knows how to inline

Modified: branches/theora-playtime/lib/scan.c
===================================================================
--- branches/theora-playtime/lib/scan.c	2006-06-07 17:00:47 UTC (rev 11538)
+++ branches/theora-playtime/lib/scan.c	2006-06-07 17:27:44 UTC (rev 11539)
@@ -680,6 +680,37 @@
 
 }
 
+static ogg_int32_t RowDiffScan_DiffAndThresholding(PP_INSTANCE *ppi,
+                         unsigned char * YuvPtr1,
+                         unsigned char * YuvPtr2,
+                         ogg_int16_t   * YUVDiffsPtr,
+                         unsigned char * bits_map_ptr,
+                         signed char   * SgcPtr)
+{
+  ogg_int16_t Diff;     /* Temp local workspace. */
+  ogg_int32_t j; 
+  ogg_int32_t    FragChangedPixels = 0;
+
+    for ( j = 0; j < HFRAGPIXELS; j++ ){
+      /* Take a local copy of the measured difference. */
+      Diff = (int)YuvPtr1[j] - (int)YuvPtr2[j];
+
+      /* Store the actual difference value */
+      YUVDiffsPtr[j] = Diff;
+
+      /* Test against the Level thresholds and record the results */
+      SgcPtr[0] += ppi->SgcThreshTable[Diff+255];
+
+      /* Test against the SRF thresholds */
+      bits_map_ptr[j] = ppi->SrfThreshTable[Diff+255];
+      FragChangedPixels += ppi->SrfThreshTable[Diff+255];
+    }
+
+    return FragChangedPixels;
+
+}
+
+
 static void RowDiffScan( PP_INSTANCE *ppi,
                          unsigned char * YuvPtr1,
                          unsigned char * YuvPtr2,

Modified: branches/theora-playtime/lib/x86_32_vs/idct_sse2.c
===================================================================
--- branches/theora-playtime/lib/x86_32_vs/idct_sse2.c	2006-06-07 17:00:47 UTC (rev 11538)
+++ branches/theora-playtime/lib/x86_32_vs/idct_sse2.c	2006-06-07 17:27:44 UTC (rev 11539)
@@ -629,20 +629,20 @@
         /* Put this word in all the spaces */
         pshufd   xmm1, xmm0, 0
         movdqa   xmm2, xmm1
-        pslldq   xmm2, 2
-        por      xmm1, xmm2
+        pslldq   xmm1, 2
+        por      xmm2, xmm1
 
 
         
-        movdqa  [edi], xmm1
-        movdqa  [edi+16], xmm1
-        movdqa  [edi+32], xmm1
-        movdqa  [edi+48], xmm1
+        movdqa  [edi], xmm2
+        movdqa  [edi+16], xmm2
+        movdqa  [edi+32], xmm2
+        movdqa  [edi+48], xmm2
 
-        movdqa  [edi+64], xmm1
-        movdqa  [edi+80], xmm1
-        movdqa  [edi+96], xmm1
-        movdqa  [edi+112], xmm1
+        movdqa  [edi+64], xmm2
+        movdqa  [edi+80], xmm2
+        movdqa  [edi+96], xmm2
+        movdqa  [edi+112], xmm2
 
 
 



More information about the commits mailing list