Moving energy floor to coarse quantization

By moving the energy floor to the encoder, we can use a different
floor for prediction than for the decay level. Also, the fixed-point
dynamic range has been increased to avoid overflows when a fixed-point
decoder is used on a stream encoded in floating-point.
This commit is contained in:
Jean-Marc Valin 2011-01-24 15:53:17 -05:00
parent 6ec2ca56cf
commit 495114b755
2 changed files with 30 additions and 21 deletions

View file

@ -1379,11 +1379,6 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, i
st->prefilter_gain = gain1;
st->prefilter_tapset = prefilter_tapset;
/* Clamp the band energy used for prediction */
for (i=0;i<C*st->mode->nbEBands;i++)
if (oldBandE[i] < -QCONST16(28.f,DB_SHIFT))
oldBandE[i] = -QCONST16(28.f,DB_SHIFT);
/* In case start or end were to change */
c=0; do
{
@ -2186,11 +2181,6 @@ int celt_decode_with_ec_float(CELTDecoder * restrict st, const unsigned char *da
st->postfilter_tapset = postfilter_tapset;
#endif /* ENABLE_POSTFILTER */
/* Clamp the band energy used for prediction */
for (i=0;i<C*st->mode->nbEBands;i++)
if (oldBandE[i] < -QCONST16(28.f,DB_SHIFT))
oldBandE[i] = -QCONST16(28.f,DB_SHIFT);
/* In case start or end were to change */
c=0; do
{