ref: 9dc0e40475e5326e2b9a1d0e0459f64d1aebb15c
parent: ec1ebf8ad744f0e7060c839a019c0a9806bd3e85
author: Jean-Marc Valin <[email protected]>
date: Mon Oct 24 16:26:29 EDT 2011
Disable CELT when FEC is on and we're losing too many packets
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -513,7 +513,7 @@
else if (st->application == OPUS_APPLICATION_VOIP)
voice_est = 115;
else
- voice_est = 64;
+ voice_est = 48;
if (st->force_channels!=OPUS_AUTO && st->channels == 2)
{
@@ -577,6 +577,9 @@
threshold += 4000;
st->mode = (equiv_rate >= threshold) ? MODE_CELT_ONLY: MODE_SILK_ONLY;
+
+ if (st->silk_mode.useInBandFEC && st->silk_mode.packetLossPercentage > (128-voice_est)>>4)
+ st->mode = MODE_SILK_ONLY;
#endif
} else {
st->mode = st->user_forced_mode;