From 13d392d0e80a5053b4d16cd77974e26d9cc0bc37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=85hgren?= Date: Tue, 9 Oct 2018 23:33:00 +0200 Subject: [PATCH] AEC3: Utilize dominant nearend functionality to increase transparency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL utilizes the AEC3 ability to tailor the suppressor during situations when the nearend dominates over the residual echo. This is done by increasing the thresholds for transparent echo suppressor behavior when the nearend is strong compared to the residual echo. Bug: webrtc:9836, chromium:893744 Change-Id: Ic06569eefc7f2557b401db43b3ac84b299071294 Reviewed-on: https://webrtc-review.googlesource.com/c/104460 Commit-Queue: Per Ã…hgren Reviewed-by: Gustaf Ullberg Cr-Commit-Position: refs/heads/master@{#25071} --- api/audio/echo_canceller3_config.h | 10 +++++----- modules/audio_processing/aec3/echo_canceller3.cc | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/api/audio/echo_canceller3_config.h b/api/audio/echo_canceller3_config.h index dec9e06d74..d88c9c450c 100644 --- a/api/audio/echo_canceller3_config.h +++ b/api/audio/echo_canceller3_config.h @@ -182,15 +182,15 @@ struct EchoCanceller3Config { MaskingThresholds(.07f, .1f, .3f), 2.0f, 0.25f); - Tuning nearend_tuning = Tuning(MaskingThresholds(.2f, .3f, .3f), - MaskingThresholds(.07f, .1f, .3f), + Tuning nearend_tuning = Tuning(MaskingThresholds(1.09f, 1.1f, .3f), + MaskingThresholds(.1f, .3f, .3f), 2.0f, 0.25f); struct DominantNearendDetection { - float enr_threshold = 10.f; - float snr_threshold = 10.f; - int hold_duration = 25; + float enr_threshold = 6.f; + float snr_threshold = 6.f; + int hold_duration = 5; int trigger_threshold = 15; } dominant_nearend_detection; diff --git a/modules/audio_processing/aec3/echo_canceller3.cc b/modules/audio_processing/aec3/echo_canceller3.cc index e331c1887b..271d38422f 100644 --- a/modules/audio_processing/aec3/echo_canceller3.cc +++ b/modules/audio_processing/aec3/echo_canceller3.cc @@ -70,6 +70,10 @@ bool EnableNewFilterParams() { return !field_trial::IsEnabled("WebRTC-Aec3NewFilterParamsKillSwitch"); } +bool EnableLegacyDominantNearend() { + return field_trial::IsEnabled("WebRTC-Aec3EnableLegacyDominantNearend"); +} + // Method for adjusting config parameter dependencies.. EchoCanceller3Config AdjustConfig(const EchoCanceller3Config& config) { EchoCanceller3Config adjusted_cfg = config; @@ -166,6 +170,18 @@ EchoCanceller3Config AdjustConfig(const EchoCanceller3Config& config) { adjusted_cfg.ep_strength.default_len = 0.88f; } + if (EnableLegacyDominantNearend()) { + adjusted_cfg.suppressor.nearend_tuning = + EchoCanceller3Config::Suppressor::Tuning( + EchoCanceller3Config::Suppressor::MaskingThresholds(.2f, .3f, .3f), + EchoCanceller3Config::Suppressor::MaskingThresholds(.07f, .1f, .3f), + 2.0f, 0.25f); + + adjusted_cfg.suppressor.dominant_nearend_detection.enr_threshold = 10.f; + adjusted_cfg.suppressor.dominant_nearend_detection.snr_threshold = 10.f; + adjusted_cfg.suppressor.dominant_nearend_detection.hold_duration = 25; + } + return adjusted_cfg; }