From 8f94cd34191214d04d5ef72f1d54b7d733f866f7 Mon Sep 17 00:00:00 2001 From: ivoc Date: Fri, 5 May 2017 05:50:10 -0700 Subject: [PATCH] Prevent residual echo likelihood values greater than 1.0. The residual echo likelihood should report a likelihood between 0.0 and 1.0. Currently it can happen that echo likelihoods > 1.0 are reported. As a temporary mitigation to stop this, this CL enforces a hard maximum of 1.0 for the echo likelihood while we investigate the issue further. BUG=b/38014838 Review-Url: https://codereview.webrtc.org/2861123002 Cr-Commit-Position: refs/heads/master@{#18030} --- webrtc/modules/audio_processing/residual_echo_detector.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webrtc/modules/audio_processing/residual_echo_detector.cc b/webrtc/modules/audio_processing/residual_echo_detector.cc index 78b673ee1b..e95e0894bf 100644 --- a/webrtc/modules/audio_processing/residual_echo_detector.cc +++ b/webrtc/modules/audio_processing/residual_echo_detector.cc @@ -106,6 +106,9 @@ void ResidualEchoDetector::AnalyzeCaptureAudio( } reliability_ = (1.0f - kAlpha) * reliability_ + kAlpha * 1.0f; echo_likelihood_ *= reliability_; + // This is a temporary fix to prevent echo likelihood values > 1.0. + // TODO(ivoc): Find the root cause of this issue and fix it. + echo_likelihood_ = std::min(echo_likelihood_, 1.0f); int echo_percentage = static_cast(echo_likelihood_ * 100); RTC_HISTOGRAM_COUNTS("WebRTC.Audio.ResidualEchoDetector.EchoLikelihood", echo_percentage, 0, 100, 100 /* number of bins */);