[MPlayer-cvslog] r25100 - trunk/libaf/af_scaletempo.c

reimar subversion at mplayerhq.hu
Sun Nov 18 18:28:28 CET 2007


Author: reimar
Date: Sun Nov 18 18:28:27 2007
New Revision: 25100

Log:
Rearrange scaletempo inner loop.
Speedup on x86 with gcc 3.4 36%, on x86_64 with gcc 4.1 5%


Modified:
   trunk/libaf/af_scaletempo.c

Modified: trunk/libaf/af_scaletempo.c
==============================================================================
--- trunk/libaf/af_scaletempo.c	(original)
+++ trunk/libaf/af_scaletempo.c	Sun Nov 18 18:28:27 2007
@@ -170,9 +170,12 @@ static int best_overlap_offset_s16(af_sc
     int32_t corr = 0;
     int16_t* ps = search_start;
     ppc = s->buf_pre_corr;
-    for (i=s->num_channels; i<s->samples_overlap; i++) {
+    ppc += s->samples_overlap - s->num_channels;
+    ps  += s->samples_overlap - s->num_channels;
+    i  = -(s->samples_overlap - s->num_channels);
+    do {
       corr += ( *ppc++ * *ps++ ) >> s->shift_corr;
-    }
+    } while (++i < 0);
     if (corr > best_corr) {
       best_corr = corr;
       best_off  = off;



More information about the MPlayer-cvslog mailing list