diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2015-12-04 16:11:39 -0500 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2015-12-04 16:11:39 -0500 |
commit | cfaf14788e28a561099d8bb4898e6bebd3098174 (patch) | |
tree | ca0ce086db1fb80ed8cf4f7b6b47b58e60b061b5 /celt | |
parent | 77cf9edad492cd627ff2818ca449eeaff520ad5d (diff) | |
download | opus-cfaf14788e28a561099d8bb4898e6bebd3098174.tar.gz |
Make the CELT background noise estimator adapt more quickly on DTX update
Diffstat (limited to 'celt')
-rw-r--r-- | celt/celt_decoder.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/celt/celt_decoder.c b/celt/celt_decoder.c index bda317e4..b688f2a4 100644 --- a/celt/celt_decoder.c +++ b/celt/celt_decoder.c @@ -1030,10 +1030,18 @@ int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *dat /* In case start or end were to change */ if (!isTransient) { + opus_val16 max_background_increase; OPUS_COPY(oldLogE2, oldLogE, 2*nbEBands); OPUS_COPY(oldLogE, oldBandE, 2*nbEBands); + /* In normal circumstances, we only allow the noise floor to increase by + up to 2.4 dB/second, but when we're in DTX, we allow up to 6 dB + increase for each update.*/ + if (st->loss_count < 10) + max_background_increase = M*QCONST16(0.001f,DB_SHIFT); + else + max_background_increase = QCONST16(1.f,DB_SHIFT); for (i=0;i<2*nbEBands;i++) - backgroundLogE[i] = MIN16(backgroundLogE[i] + M*QCONST16(0.001f,DB_SHIFT), oldBandE[i]); + backgroundLogE[i] = MIN16(backgroundLogE[i] + max_background_increase, oldBandE[i]); } else { for (i=0;i<2*nbEBands;i++) oldLogE[i] = MIN16(oldLogE[i], oldBandE[i]); |