Mercurial > mplayer.hg
changeset 25072:6c3f9215d606
Rearrange scaletempo inner loop.
Speedup on x86 with gcc 3.4 36%, on x86_64 with gcc 4.1 5%
author | reimar |
---|---|
date | Sun, 18 Nov 2007 17:28:27 +0000 |
parents | a961cea10603 |
children | 21227667b70a |
files | libaf/af_scaletempo.c |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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; 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;