diff options
author | Felicia Lim <flim@google.com> | 2016-07-20 13:37:13 +0200 |
---|---|---|
committer | Timothy B. Terriberry <tterribe@xiph.org> | 2016-07-20 05:02:39 -0700 |
commit | e1bce7b3f6eff218cd23fe26b115d315e78f3ad6 (patch) | |
tree | 55061f446ffff4b827bbb76837bb65a1ea4be9e3 /src/opus_encoder.c | |
parent | 6f260111299209dafd58ffbf5aafe7bdeedcc4fa (diff) | |
download | opus-e1bce7b3f6eff218cd23fe26b115d315e78f3ad6.tar.gz |
Fix use_dtx for DISABLE_FLOAT_API
Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
Diffstat (limited to 'src/opus_encoder.c')
-rw-r--r-- | src/opus_encoder.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/opus_encoder.c b/src/opus_encoder.c index 2bb29f67..0c4e297a 100644 --- a/src/opus_encoder.c +++ b/src/opus_encoder.c @@ -86,9 +86,9 @@ struct OpusEncoder { 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 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ 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 |