# HG changeset patch # User reimar # Date 1195406907 0 # Node ID 6c3f9215d6064409d3d5048ecc412c8827e1fd7a # Parent a961cea106035bdc015ace0fb609a2d09e891062 Rearrange scaletempo inner loop. Speedup on x86 with gcc 3.4 36%, on x86_64 with gcc 4.1 5% diff -r a961cea10603 -r 6c3f9215d606 libaf/af_scaletempo.c --- a/libaf/af_scaletempo.c Sun Nov 18 16:19:03 2007 +0000 +++ b/libaf/af_scaletempo.c Sun Nov 18 17:28:27 2007 +0000 @@ -170,9 +170,12 @@ int32_t corr = 0; int16_t* ps = search_start; ppc = s->buf_pre_corr; - for (i=s->num_channels; isamples_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;