From bac00121208659b48a965882ab85a4ae1257a026 Mon Sep 17 00:00:00 2001 From: "bjornv@webrtc.org" Date: Fri, 2 Jan 2015 09:23:49 +0000 Subject: [PATCH] Extend delay estimation window in AEC to 500 ms on all platforms On non-Android the delay estimator in audio_processing/aec has solely been used for logging purposes. The maximum possible observed delay has been 236 ms. We have seen longer delays for which the delay estimate at best ends up at 236 ms, but can also be 'random'. reported delays are clamped to 500 ms. This cl extends the delay estimation window to match that. BUG=4086, 3504, 4113 TESTED=locally on Linux and trybots R=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/36569004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7989 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../modules/audio_processing/aec/aec_core_internal.h | 10 ++-------- .../audio_processing/test/audio_processing_unittest.cc | 1 + 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/webrtc/modules/audio_processing/aec/aec_core_internal.h b/webrtc/modules/audio_processing/aec/aec_core_internal.h index d11df931ff..a8f0c0ce95 100644 --- a/webrtc/modules/audio_processing/aec/aec_core_internal.h +++ b/webrtc/modules/audio_processing/aec/aec_core_internal.h @@ -24,20 +24,14 @@ enum { }; static const int kNormalNumPartitions = 12; -// Delay estimator constants, used for logging. -enum { - kMaxDelayBlocks = 60 -}; +// Delay estimator constants, used for logging and delay compensation if +// if reported delays are disabled. enum { kLookaheadBlocks = 15 }; enum { -#ifdef WEBRTC_ANDROID // 500 ms for 16 kHz which is equivalent with the limit of reported delays. kHistorySizeBlocks = 125 -#else - kHistorySizeBlocks = kMaxDelayBlocks + kLookaheadBlocks -#endif }; // Extended filter adaptation parameters. diff --git a/webrtc/modules/audio_processing/test/audio_processing_unittest.cc b/webrtc/modules/audio_processing/test/audio_processing_unittest.cc index 78e79a5eb9..2c916f1d68 100644 --- a/webrtc/modules/audio_processing/test/audio_processing_unittest.cc +++ b/webrtc/modules/audio_processing/test/audio_processing_unittest.cc @@ -826,6 +826,7 @@ TEST_F(ApmTest, EchoCancellation) { } TEST_F(ApmTest, DISABLED_EchoCancellationReportsCorrectDelays) { + // TODO(bjornv): Fix this test to work with DA-AEC. // Enable AEC only. EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->enable_drift_compensation(false));