diff options
author | Andrew Larkin <andrewl@arcadius.com.au> | 2017-07-06 21:00:36 +0300 |
---|---|---|
committer | Felicia Lim <flim@google.com> | 2017-07-06 21:00:36 +0300 |
commit | b1d51b2d3f0118a598d8813c59e02fd596e12646 (patch) | |
tree | 724c55aba66a6d32ff37fbdf659e129d0910eddd | |
parent | 3105fa273c125faeda6b7168c74854a7f71a90c4 (diff) |
Fix uninitialized variables in decide_dtx_mode()
Signed-off-by: Felicia Lim <flim@google.com>
-rw-r--r-- | src/opus_encoder.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/opus_encoder.c b/src/opus_encoder.c index 474e6c24..cd37fcdf 100644 --- a/src/opus_encoder.c +++ b/src/opus_encoder.c @@ -909,21 +909,20 @@ static int decide_dtx_mode(float activity_probability, /* probability that cu int arch ) { - int is_noise; opus_val32 noise_energy; - int is_sufficiently_quiet; if (!is_silence) { - is_noise = activity_probability < DTX_ACTIVITY_THRESHOLD; - if (is_noise) + if (activity_probability < DTX_ACTIVITY_THRESHOLD) /* is noise */ { noise_energy = compute_frame_energy(pcm, frame_size, channels, arch); - is_sufficiently_quiet = peak_signal_energy >= (PSEUDO_SNR_THRESHOLD * noise_energy); + + /* but is sufficiently quiet */ + is_silence = peak_signal_energy >= (PSEUDO_SNR_THRESHOLD * noise_energy); } } - if (is_silence || (is_noise && is_sufficiently_quiet)) + if (is_silence) { /* The number of consecutive DTX frames should be within the allowed bounds */ (*nb_no_activity_frames)++; |