Mercurial > libavcodec.hg
comparison ac3dec.c @ 5322:b55b8c792066 libavcodec
AC-3 decoder, soc revision 72, Sep 7 04:20:00 2006 UTC by cloud9
fix short block imdct.
author | jbr |
---|---|
date | Sat, 14 Jul 2007 16:04:40 +0000 |
parents | fcb2a52c88fe |
children | 4ba6d8132f36 |
comparison
equal
deleted
inserted
replaced
5321:fcb2a52c88fe | 5322:b55b8c792066 |
---|---|
1607 */ | 1607 */ |
1608 static void do_imdct_256(AC3DecodeContext *ctx, int chindex) | 1608 static void do_imdct_256(AC3DecodeContext *ctx, int chindex) |
1609 { | 1609 { |
1610 int k; | 1610 int k; |
1611 float x1[128], x2[128]; | 1611 float x1[128], x2[128]; |
1612 float *ptr; | 1612 float *o_ptr, *d_ptr, *w; |
1613 FFTComplex *ptr1, *ptr2; | |
1613 | 1614 |
1614 for (k = 0; k < N / 4; k++) { | 1615 for (k = 0; k < N / 4; k++) { |
1615 x1[k] = ctx->transform_coeffs[chindex][2 * k]; | 1616 x1[k] = ctx->transform_coeffs[chindex][2 * k]; |
1616 x2[k] = ctx->transform_coeffs[chindex][2 * k + 1]; | 1617 x2[k] = ctx->transform_coeffs[chindex][2 * k + 1]; |
1617 } | 1618 } |
1618 | 1619 |
1619 ff_imdct_calc(&ctx->imdct_256, ctx->tmp_output, x1, ctx->tmp_imdct); | 1620 ff_imdct_calc(&ctx->imdct_256, ctx->tmp_output, x1, ctx->tmp_imdct); |
1620 ff_imdct_calc(&ctx->imdct_256, ctx->tmp_output + 256, x2, ctx->tmp_imdct); | 1621 ff_imdct_calc(&ctx->imdct_256, ctx->tmp_output + 256, x2, ctx->tmp_imdct); |
1621 | 1622 |
1622 ptr = ctx->output[chindex]; | 1623 o_ptr = ctx->output[chindex]; |
1623 ctx->dsp.vector_fmul_add_add(ptr, ctx->tmp_output, ctx->window, ctx->delay[chindex], 384, BLOCK_SIZE, 1); | 1624 d_ptr = ctx->delay[chindex]; |
1624 ptr = ctx->delay[chindex]; | 1625 ptr1 = (FFTComplex *)ctx->tmp_output; |
1625 ctx->dsp.vector_fmul_reverse(ptr, ctx->tmp_output + 256, ctx->window, BLOCK_SIZE); | 1626 ptr2 = (FFTComplex *)ctx->tmp_output + 256; |
1627 w = ctx->window; | |
1628 | |
1629 for (k = 0; k < N / 8; k++) | |
1630 { | |
1631 o_ptr[2 * k] = -ptr1[k].im * w[2 * k] + d_ptr[2 * k] + 384.0; | |
1632 o_ptr[2 * k + 1] = ptr1[N / 8 - k - 1].re * w[2 * k + 1] + 384.0; | |
1633 o_ptr[N / 4 + 2 * k] = -ptr1[k].re * w[N / 4 + 2 * k] + d_ptr[N / 4 + 2 * k] + 384.0; | |
1634 o_ptr[N / 4 + 2 * k + 1] = ptr1[N / 8 - k - 1].im * w[N / 4 + 2 * k + 1] + d_ptr[N / 4 + 2 * k + 1] + 384.0; | |
1635 d_ptr[2 * k] = ptr2[k].re * w[k / 2 - 2 * k - 1]; | |
1636 d_ptr[2 * k + 1] = -ptr2[N / 8 - k - 1].im * w[N / 2 - 2 * k - 2]; | |
1637 d_ptr[N / 4 + 2 * k] = ptr2[k].im * w[N / 4 - 2 * k - 1]; | |
1638 d_ptr[N / 4 + 2 * k + 1] = -ptr2[N / 8 - k - 1].re * w[N / 4 - 2 * k - 2]; | |
1639 } | |
1626 } | 1640 } |
1627 | 1641 |
1628 /* This function performs the imdct on 512 sample transform | 1642 /* This function performs the imdct on 512 sample transform |
1629 * coefficients. | 1643 * coefficients. |
1630 */ | 1644 */ |