>From 4cb36565f59926e8a9acf9877142ab0951e4cf86 Mon Sep 17 00:00:00 2001 From: Timothy B. Terriberry Date: Wed, 2 Mar 2011 15:28:08 -0800 Subject: [PATCH] Fix CNG when effEBands is less than nbEBands. We were trying to normalize bands that didn't actually exist (e.g., the last band with 320-sample frames at 32kHz). Thanks to John Ridges for the report. --- libcelt/celt.c | 24 +++++++++++++++++------- 1 files changed, 17 insertions(+), 7 deletions(-) diff --git a/libcelt/celt.c b/libcelt/celt.c index 31d35f8..287c720 100644 --- a/libcelt/celt.c +++ b/libcelt/celt.c @@ -1137,6 +1137,7 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, i ec_enc_icdf(enc, prefilter_tapset, tapset_icdf, 2); else prefilter_tapset = 0; + fprintf(stderr,"pitch_index: %4i gain %0.2f tapset: %i\n",pitch_index,gain1,prefilter_tapset); gain1 = QCONST16(0.09375f,15)*(qg+1); pf_on = 1; } @@ -1967,17 +1968,26 @@ static void celt_decode_lost(CELTDecoder * restrict st, celt_word16 * restrict p log2Amp(st->mode, st->start, st->end, bandE, backgroundLogE, C); seed = st->rng; - for (i=0;i>20; + for (i=0;imode->effEBands;i++) + { + int j; + int boffs; + int blen; + boffs = N*c+(st->mode->eBands[i]<mode->eBands[i+1]-st->mode->eBands[i])<>20; + } + renormalise_vector(X+boffs, blen, Q15ONE); + } } st->rng = seed; - for (c=0;cmode->nbEBands;i++) - renormalise_vector(X+N*c+(st->mode->eBands[i]<mode->eBands[i+1]-st->mode->eBands[i])<mode, X, freq, bandE, st->mode->nbEBands, C, 1<mode, X, freq, bandE, st->mode->effEBands, C, 1<mode, 0, freq, out_syn, overlap_mem, C, LM); plc = 0; -- 1.7.3.4