Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: webrtc/modules/audio_processing/echo_detector/normalized_covariance_estimator.cc

Issue 2877803002: Adds fuzzer for the residual echo detector. (Closed)
Patch Set: Review comments by Henrik. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/echo_detector/normalized_covariance_estimator.cc
diff --git a/webrtc/modules/audio_processing/echo_detector/normalized_covariance_estimator.cc b/webrtc/modules/audio_processing/echo_detector/normalized_covariance_estimator.cc
index 0b8b68bfbdd0a247851e145e9bdee7078cb84a1f..8408f014048205e7f982dfe3bd7f2162d37ec087 100644
--- a/webrtc/modules/audio_processing/echo_detector/normalized_covariance_estimator.cc
+++ b/webrtc/modules/audio_processing/echo_detector/normalized_covariance_estimator.cc
@@ -10,6 +10,10 @@
#include "webrtc/modules/audio_processing/echo_detector/normalized_covariance_estimator.h"
+#include <math.h>
+
+#include "webrtc/base/checks.h"
+
namespace webrtc {
namespace {
@@ -27,6 +31,8 @@ void NormalizedCovarianceEstimator::Update(float x,
covariance_ =
(1.f - kAlpha) * covariance_ + kAlpha * (x - x_mean) * (y - y_mean);
normalized_cross_correlation_ = covariance_ / (x_sigma * y_sigma + .0001f);
+ RTC_DCHECK(isfinite(covariance_));
+ RTC_DCHECK(isfinite(normalized_cross_correlation_));
}
void NormalizedCovarianceEstimator::Clear() {

Powered by Google App Engine
This is Rietveld 408576698