From fddaf7528a34e397411a15dd92161339955ff456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=85hgren?= Date: Fri, 8 Jun 2018 10:26:40 +0200 Subject: [PATCH] AEC3: Increase the look window in the delay estimator. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:9374,chromium:850525 Change-Id: I587cb7951acf8e5ec92d9941f1979ba2c9887876 Reviewed-on: https://webrtc-review.googlesource.com/81747 Commit-Queue: Per Ã…hgren Reviewed-by: Gustaf Ullberg Cr-Commit-Position: refs/heads/master@{#23561} --- api/audio/echo_canceller3_config.h | 2 +- modules/audio_processing/aec3/echo_canceller3.cc | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/api/audio/echo_canceller3_config.h b/api/audio/echo_canceller3_config.h index e5bda8617d..a58362ebec 100644 --- a/api/audio/echo_canceller3_config.h +++ b/api/audio/echo_canceller3_config.h @@ -22,7 +22,7 @@ struct EchoCanceller3Config { struct Delay { size_t default_delay = 5; size_t down_sampling_factor = 4; - size_t num_filters = 5; + size_t num_filters = 6; size_t api_call_jitter_blocks = 26; size_t min_echo_path_delay_blocks = 0; size_t delay_headroom_blocks = 2; diff --git a/modules/audio_processing/aec3/echo_canceller3.cc b/modules/audio_processing/aec3/echo_canceller3.cc index 765e4de073..07ee54f1b5 100644 --- a/modules/audio_processing/aec3/echo_canceller3.cc +++ b/modules/audio_processing/aec3/echo_canceller3.cc @@ -12,6 +12,7 @@ #include "modules/audio_processing/logging/apm_data_dumper.h" #include "rtc_base/atomicops.h" #include "rtc_base/logging.h" +#include "system_wrappers/include/field_trial.h" namespace webrtc { @@ -28,6 +29,10 @@ bool DetectSaturation(rtc::ArrayView y) { return false; } +bool UseShortDelayEstimatorWindow() { + return field_trial::IsEnabled("WebRTC-Aec3UseShortDelayEstimatorWindow"); +} + // Method for adjusting config parameter dependencies.. EchoCanceller3Config AdjustConfig(const EchoCanceller3Config& config) { EchoCanceller3Config adjusted_cfg = config; @@ -62,6 +67,12 @@ EchoCanceller3Config AdjustConfig(const EchoCanceller3Config& config) { adjusted_cfg.echo_model.nonlinear_release = 0.6f; } } + + if (UseShortDelayEstimatorWindow()) { + adjusted_cfg.delay.num_filters = + std::min(adjusted_cfg.delay.num_filters, static_cast(5)); + } + return adjusted_cfg; }