diff --git a/libcelt/celt.c b/libcelt/celt.c index acac0c06..d972f9e2 100644 --- a/libcelt/celt.c +++ b/libcelt/celt.c @@ -617,28 +617,39 @@ static void tf_analysis(celt_word16 *bandLogE, celt_word16 *oldBandE, int len, i RESTORE_STACK } -static void tf_encode(int len, int isTransient, int *tf_res, ec_enc *enc) +static void tf_encode(int len, int isTransient, int *tf_res, int nbCompressedBytes, ec_enc *enc) { int curr, i; - ec_enc_bit_prob(enc, tf_res[0], isTransient ? 16384 : 4096); - curr = tf_res[0]; - for (i=1;imode->nbEBands, isTransient, tf_res, enc); + tf_encode(st->mode->nbEBands, isTransient, tf_res, nbCompressedBytes, enc); ALLOC(offsets, st->mode->nbEBands, int); ALLOC(fine_priority, st->mode->nbEBands, int); @@ -1704,7 +1715,7 @@ int celt_decode_with_ec_float(CELTDecoder * restrict st, const unsigned char *da unquant_coarse_energy(st->mode, st->start, bandE, st->oldBandE, len*4-8, intra_ener, st->mode->prob, dec, C); ALLOC(tf_res, st->mode->nbEBands, int); - tf_decode(st->mode->nbEBands, C, isTransient, tf_res, dec); + tf_decode(st->mode->nbEBands, C, isTransient, tf_res, len, dec); ALLOC(pulses, st->mode->nbEBands, int); ALLOC(offsets, st->mode->nbEBands, int);