[MPlayer-dev-eng] [PATCH] af_scaletempo
JustFillBug
mozbugbox at yahoo.com.au
Wed Sep 26 02:54:04 CEST 2007
On 2007-09-24, Robert Juliano <juliano.1 at osu.edu> wrote:
> +
> +int _best_overlap_offset_float(af_scaletempo_t* s) {
> + float *pw, *po, *ppc, *search_start;
> + float best_corr = INT_MIN;
> + int best_off = 0;
> + int i, off;
> +
> + pw = (float*)s->table_window;
> + po = (float*)s->buf_overlap;
> + ppc = (float*)s->buf_pre_corr;
> + for (i=0; i<s->samples_overlap; i++) {
> + *ppc++ = *pw++ * *po++;
> + }
> +
> + search_start = (float*)s->buf_queue;
> + for (off=0; off<s->frames_search; off++) {
> + float corr = 0;
> + float* ps = search_start;
> + ppc = (float*)s->buf_pre_corr;
> + for (i=0; i<s->samples_overlap; i++) {
shouldn't this be s->num_channels?
> + corr += *ppc++ * *ps++;
> + }
> + if (corr > best_corr) {
> + best_corr = corr;
> + best_off = off;
> + }
> + search_start += s->num_channels;
> + }
> +
> + return best_off * 4;
> +}
More information about the MPlayer-dev-eng
mailing list