[FFmpeg-devel] [PATCH] Channels correlation

Reimar Döffinger Reimar.Doeffinger
Thu Oct 29 18:05:43 CET 2009


On Thu, Oct 29, 2009 at 05:47:30PM +0100, Reimar D?ffinger wrote:
>     double *m2 = state->matr_io + nc1 * nc1;
>     for (i = 0; i < nc1; i++) {
>         double d1val = d1[i];
>         for (j = 0; j < nc1; j++)
>             *m1++ += d1val * d1[j];

And obviously it should be
>     double *m2 = state->matr_io + (nc1>>1) * ((nc1+1)>>1);

>         for (j = i; j < nc1; j++)
>             *m1++ += d1val * d1[j];

No point in calculating more than one half of a self-correlation
(and thus symmetric) matrix.



More information about the ffmpeg-devel mailing list