From ccd51fe9478abba60bc97fa1a85a16781d680673 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Wed, 13 Oct 2010 11:48:17 -0400 Subject: [PATCH] No longer filling the stereo side with noise. --- libcelt/bands.c | 7 +------ libcelt/vq.c | 40 ++++++++++++++++++++++++++-------------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/libcelt/bands.c b/libcelt/bands.c index 4032aa58..085cfa0e 100644 --- a/libcelt/bands.c +++ b/libcelt/bands.c @@ -909,7 +909,6 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end, celt_nor int curr_balance; celt_norm * restrict X, * restrict Y; int tf_change=0; - celt_norm *effective_lowband; X = _X+M*eBands[i]; if (_Y!=NULL) @@ -953,12 +952,8 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end, celt_nor Y = norm; } - if (tf_change==0 && !shortBlocks && fold==2) - effective_lowband = NULL; - else - effective_lowband = lowband; quant_band(encode, m, i, X, Y, N, b, fold, B, tf_change, - effective_lowband, resynth, ec, &remaining_bits, LM, + lowband, resynth, ec, &remaining_bits, LM, norm+M*eBands[i], bandE, 0, &seed, Q15ONE, lowband_scratch); balance += pulses[i] + tell; diff --git a/libcelt/vq.c b/libcelt/vq.c index 7b8e2df6..b429ad05 100644 --- a/libcelt/vq.c +++ b/libcelt/vq.c @@ -183,17 +183,23 @@ void alg_quant(celt_norm *X, int N, int K, int spread, int B, celt_norm *lowband { if (lowband != NULL && resynth) { - for (j=0;j>20; + } + } else { + for (j=0;j>20; - } + X[j] = 0; } - renormalise_vector(X, N, gain); return; } K = get_pulses(K); @@ -361,17 +367,23 @@ void alg_unquant(celt_norm *X, int N, int K, int spread, int B, { if (lowband != NULL) { - for (i=0;i>20; + } + } else { + for (i=0;i>20; - } + X[i] = 0; } - renormalise_vector(X, N, gain); return; } K = get_pulses(K);