shithub: opus

Download patch

ref: e1bce7b3f6eff218cd23fe26b115d315e78f3ad6
parent: 6f260111299209dafd58ffbf5aafe7bdeedcc4fa
author: Felicia Lim <[email protected]>
date: Wed Jul 20 09:37:13 EDT 2016

Fix use_dtx for DISABLE_FLOAT_API

Signed-off-by: Timothy B. Terriberry <[email protected]>

--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -86,9 +86,9 @@
     int          encoder_buffer;
     int          lfe;
     int          arch;
+    int          use_dtx;                 /* general DTX for both SILK and CELT */
 #ifndef DISABLE_FLOAT_API
     TonalityAnalysisState analysis;
-    int          use_dtx;                 /* general DTX for both SILK and CELT */
 #endif
 
 #define OPUS_ENCODER_RESET_START stream_channels
@@ -1422,9 +1422,13 @@
        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 but the generalized DTX cannot be used,
-          because of complexity and sampling frequency settings,
-          set the encoder to SILK mode so that the SILK DTX can be used */
+          because of complexity and sampling frequency settings, switch to SILK DTX and
+          set the encoder to SILK mode */
+#ifndef DISABLE_FLOAT_API
        st->silk_mode.useDTX = st->use_dtx && !(analysis_info.valid || is_silence);
+#else
+       st->silk_mode.useDTX = st->use_dtx;
+#endif
        if (st->silk_mode.useDTX && voice_est > 100)
           st->mode = MODE_SILK_ONLY;
 #endif