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}
This commit is contained in:
ivoc 2017-05-05 05:50:10 -07:00 committed by Commit bot
parent 2979f55f95
commit 8f94cd3419

View File

@ -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<int>(echo_likelihood_ * 100);
RTC_HISTOGRAM_COUNTS("WebRTC.Audio.ResidualEchoDetector.EchoLikelihood",
echo_percentage, 0, 100, 100 /* number of bins */);