From 0bc7ce3b0477fd0da3e4158dde50e91681e3a790 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 18 Nov 2007 17:28:27 +0000 Subject: Rearrange scaletempo inner loop. Speedup on x86 with gcc 3.4 36%, on x86_64 with gcc 4.1 5% git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25100 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libaf/af_scaletempo.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libaf') diff --git a/libaf/af_scaletempo.c b/libaf/af_scaletempo.c index b2de4c33ef..d4c3fe731e 100644 --- a/libaf/af_scaletempo.c +++ b/libaf/af_scaletempo.c @@ -170,9 +170,12 @@ static int best_overlap_offset_s16(af_scaletempo_t* s) 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; -- cgit v1.2.3