ref: 6ef378725f274ce60c7b0b42f8ff5f55df95d25d
parent: 6b9c29aee40ecefba6aa47ded63828b796659e84
author: Jean-Marc Valin <[email protected]>
date: Thu Oct 27 09:39:12 EDT 2011
Making sure DTX for voice still works at high bit-rate
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -580,7 +580,11 @@
st->mode = (equiv_rate >= threshold) ? MODE_CELT_ONLY: MODE_SILK_ONLY;
+ /* When FEC is enabled and there's enough packet loss, use SILK */
if (st->silk_mode.useInBandFEC && st->silk_mode.packetLossPercentage > (128-voice_est)>>4)
+ st->mode = MODE_SILK_ONLY;
+ /* When encoding voice and DTX is enabled, set the encoder to SILK mode (at least for now) */
+ if (st->silk_mode.useDTX && voice_est > 100)
st->mode = MODE_SILK_ONLY;
#endif
} else {