Index: webrtc/modules/audio_processing/residual_echo_detector.cc |
diff --git a/webrtc/modules/audio_processing/residual_echo_detector.cc b/webrtc/modules/audio_processing/residual_echo_detector.cc |
index 66b34ff10541c02550cf1f8ee65af319b3965aae..f72e3aedd8d54f04f157b589ebb0d22622820118 100644 |
--- a/webrtc/modules/audio_processing/residual_echo_detector.cc |
+++ b/webrtc/modules/audio_processing/residual_echo_detector.cc |
@@ -25,6 +25,7 @@ float Power(rtc::ArrayView<const float> input) { |
constexpr size_t kLookbackFrames = 650; |
// TODO(ivoc): Verify the size of this buffer. |
constexpr size_t kRenderBufferSize = 30; |
+constexpr float kAlpha = 0.001f; |
} // namespace |
@@ -100,6 +101,8 @@ void ResidualEchoDetector::AnalyzeCaptureAudio( |
echo_likelihood_ = std::max( |
echo_likelihood_, covariances_[delay].normalized_cross_correlation()); |
} |
+ reliability_ = (1.0f - kAlpha) * reliability_ + kAlpha * 1.0f; |
hlundin-webrtc
2016/11/16 09:46:30
How long until this converges to close enough to 1
ivoc
2016/11/16 12:30:38
After about a minute the reliability is at 0.9975
hlundin-webrtc
2016/11/17 08:14:45
Neither am I...
|
+ echo_likelihood_ *= reliability_; |
int echo_percentage = static_cast<int>(echo_likelihood_ * 100); |
RTC_HISTOGRAM_COUNTS("WebRTC.Audio.ResidualEchoDetector.EchoLikelihood", |
echo_percentage, 0, 100, 100 /* number of bins */); |