[FFmpeg-soc] AACSBR review: sbr_qmf_synthesis

Alex Converse alex.converse at gmail.com
Sun Nov 15 20:30:43 CET 2009


> // Synthesis QMF Bank (14496-3 sp04 p206)
> // Downsampled Synthesis QMF Bank (14496-3 sp04 p206)
> static void sbr_qmf_synthesis(float *out, const float **X,
>                               const unsigned int div)
> {
>     int k, l, n;
>     float v[1280], w[640];
>     for (l = 0; l < 32; l++) {
>         memmove(&v[128 / div], v, (1280 - 128) / div * sizeof(float));
>         for (n = 0; n < 128 / div; n++) {
>             v[n] = X[0][l] * cosf((2.0f * n - 255.0f / div) * M_PI / (256.0f / div));

Since this isn't LP SBR shouldn't this be
             v[n] = X[0][l][0] * cosf((2.0f * n - 255.0f / div) * M_PI
/ (256.0f / div)) -
                    X[0][l][1] * sinf((2.0f * n - 255.0f / div) * M_PI
/ (256.0f / div));

>             for (k = 1; k < 64 / div; k++) {
>                 v[n] += X[k][l] * cosf((k + 0.5f) * (2.0f * n - 255.0f / div) * M_PI / (128.0f / div));
>             }
>             v[n] /= 64.0f * 64 / div;
>         }
>         for (n = 0; n <= 4; n++) {
>             int temp1 = 128 / div * n, temp2 = temp1 << 1;
>             for (k = 0; k < 64 / div; k++) {
>                 w[temp1 + k]            = v[temp2 + k]             * sbr_qmf_window[temp1 + k];
>                 w[temp1 + k + 64 / div] = v[temp2 + k + 192 / div] * sbr_qmf_window[temp1 + k + 64 / div];
>             }
>         }
>         for (k = 0; k < 64 / div; k++) {
>             out[k] = w[k]             + w[64  / div + k] + w[128 / div + k] + w[192 / div + k] + w[256 / div + k]
>                    + w[320 / div + k] + w[384 / div + k] + w[448 / div + k] + w[512 / div + k] + w[576 / div + k];
>         }
>         out += 64 / div;
>     }
> }


More information about the FFmpeg-soc mailing list