From dbeb86fd0531b618b501a76414536b27d8d4484f Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Mon, 15 Aug 2011 10:01:00 -0400 Subject: [PATCH] Making the IMDCT work on interleaved data Saves a copy in the decoder --- libcelt/celt.c | 56 ++++++++++++++++++--------------------- libcelt/mdct.c | 9 ++++--- libcelt/mdct.h | 3 ++- libcelt/tests/mdct-test.c | 2 +- 4 files changed, 34 insertions(+), 36 deletions(-) diff --git a/libcelt/celt.c b/libcelt/celt.c index 8de9ddeb..037b5326 100644 --- a/libcelt/celt.c +++ b/libcelt/celt.c @@ -440,42 +440,38 @@ static void compute_inv_mdcts(const CELTMode *mode, int shortBlocks, celt_sig *X const int C = CHANNELS(_C); const int N = mode->shortMdctSize<shortMdctSize; + B = shortBlocks; + } + /* Prevents problems from the imdct doing the overlap-add */ + CELT_MEMSET(x, 0, overlap); - if (shortBlocks) - { - N2 = mode->shortMdctSize; - B = shortBlocks; - } - /* Prevents problems from the imdct doing the overlap-add */ - CELT_MEMSET(x, 0, overlap); + for (b=0;bmdct, &X[b+c*N2*B], x+N2*b, mode->window, overlap, shortBlocks ? mode->maxLM : mode->maxLM-LM, B); + } - for (b=0;bmdct, tmp, x+N2*b, mode->window, overlap, shortBlocks ? mode->maxLM : mode->maxLM-LM); - } - - for (j=0;jtrig[0]; for(i=0;i