From ecefde3d4a616b88c89066570f5bd97fdb437c0f Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Tue, 11 Jan 2011 09:20:39 -0500 Subject: [PATCH] Fixes the recombining stride and the deinterleaving stride Previously, recombining only worked when going all the way back to frequency domain. --- libcelt/bands.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/libcelt/bands.c b/libcelt/bands.c index 18d3db78..1362356e 100644 --- a/libcelt/bands.c +++ b/libcelt/bands.c @@ -573,13 +573,13 @@ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_ for (k=0;k>=1; - N_B<<=1; if (encode) - haar1(X, N_B, B); + haar1(X, N>>k, 1<>k, 1<>=recombine; + N_B<<=recombine; /* Increasing the time resolution */ while ((N_B&1) == 0 && tf_change<0) @@ -600,9 +600,9 @@ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_ if (B0>1) { if (encode) - deinterleave_hadamard(X, N_B, B0, longBlocks); + deinterleave_hadamard(X, N_B>>recombine, B0<>recombine, B0<1) - interleave_hadamard(X, N_B, B0, longBlocks); + interleave_hadamard(X, N_B>>recombine, B0<>=1; - B <<= 1; - } + haar1(X, N0>>k, 1<>=recombine; /* Scale output for later folding */ if (lowband_out)