Implemented rate-dependant allocation for the fine energy quantisation.

This commit is contained in:
Jean-Marc Valin 2008-05-07 13:44:39 +10:00
parent 827f93175b
commit ad6371906a
5 changed files with 108 additions and 19 deletions

View file

@ -321,7 +321,7 @@ int EXPORT celt_encode(CELTEncoder * restrict st, celt_int16_t * restrict pcm, u
for (i=0;i<C*N;i++)
P[i] = 0;
}
quant_energy(st->mode, bandE, st->oldBandE, nbCompressedBytes*8/3, st->mode->prob, &st->enc);
quant_energy(st->mode, bandE, st->oldBandE, 20+nbCompressedBytes*8/5, st->mode->prob, &st->enc);
if (C==2)
{
@ -589,7 +589,7 @@ int EXPORT celt_decode(CELTDecoder * restrict st, unsigned char *data, int len,
}
/* Get band energies */
unquant_energy(st->mode, bandE, st->oldBandE, len*8/3, st->mode->prob, &dec);
unquant_energy(st->mode, bandE, st->oldBandE, 20+len*8/5, st->mode->prob, &dec);
/* Pitch MDCT */
compute_mdcts(st->mode, st->mode->window, st->out_mem+pitch_index*C, freq);