aboutsummaryrefslogtreecommitdiffhomepage
path: root/libaf
diff options
context:
space:
mode:
authorGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-11-18 17:28:27 +0000
committerGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-11-18 17:28:27 +0000
commit0bc7ce3b0477fd0da3e4158dde50e91681e3a790 (patch)
tree97068cfb02167c00a4b095523f96122ce018911a /libaf
parentfdbceb63b9844f931107382fc063783519669bb1 (diff)
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
Diffstat (limited to 'libaf')
-rw-r--r--libaf/af_scaletempo.c7
1 files changed, 5 insertions, 2 deletions
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; 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;