Commit be68a9ae authored by Jesús de Vicente Peña's avatar Jesús de Vicente Peña Committed by Felicia Lim
Browse files

Fix for an assertion when running the fixed point tests


Signed-off-by: Felicia Lim's avatarFelicia Lim <flim@google.com>
parent 3880c5ab
......@@ -1152,16 +1152,18 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
if (!is_silence)
st->voice_ratio = -1;
if (analysis_info.valid) {
activity = !is_silence &&
analysis_info.activity_probability >= DTX_ACTIVITY_THRESHOLD;
if (!activity) {
opus_val32 noise_energy = compute_frame_energy(pcm, frame_size, st->channels, st->arch);
/* do not mark as active unless is sufficiently quiet */
activity = st->peak_signal_energy < (PSEUDO_SNR_THRESHOLD * noise_energy);
}
} else {
if (is_silence)
{
activity = !is_silence;
} else if (analysis_info.valid)
{
activity = analysis_info.activity_probability >= DTX_ACTIVITY_THRESHOLD;
if (!activity)
{
/* Mark as active if this noise frame is sufficiently loud */
opus_val32 noise_energy = compute_frame_energy(pcm, frame_size, st->channels, st->arch);
activity = st->peak_signal_energy < (PSEUDO_SNR_THRESHOLD * noise_energy);
}
}
st->detected_bandwidth = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment