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; }