From b4dcac3e1a690661811cc793ce3f423cacce0648 Mon Sep 17 00:00:00 2001 From: Gustaf Ullberg Date: Wed, 15 May 2024 12:38:25 +0200 Subject: [PATCH] Retuning of the HMM transparent mode classifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Assume a non-zero probability of starting in transparent state (transparent mode can be reached sooner). - Relax the requirements for when the filter is considered converged (reduces the risk of incorrectly entering transparent mode in the presence of near-end noise). Bug: b/340578713 Change-Id: I6be9b5b74457066f9900c8020c0ebf19623a70df Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350602 Reviewed-by: Per Ã…hgren Commit-Queue: Gustaf Ullberg Reviewed-by: Jesus de Vicente Pena Cr-Commit-Position: refs/heads/main@{#42318} --- modules/audio_processing/aec3/subtractor_output_analyzer.cc | 2 +- modules/audio_processing/aec3/transparent_mode.cc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/audio_processing/aec3/subtractor_output_analyzer.cc b/modules/audio_processing/aec3/subtractor_output_analyzer.cc index baf0600161..2b8c4c6d14 100644 --- a/modules/audio_processing/aec3/subtractor_output_analyzer.cc +++ b/modules/audio_processing/aec3/subtractor_output_analyzer.cc @@ -44,7 +44,7 @@ void SubtractorOutputAnalyzer::Update( bool coarse_filter_converged_strict = e2_coarse < 0.05f * y2 && y2 > kConvergenceThreshold; bool coarse_filter_converged_relaxed = - e2_coarse < 0.2f * y2 && y2 > kConvergenceThresholdLowLevel; + e2_coarse < 0.3f * y2 && y2 > kConvergenceThresholdLowLevel; float min_e2 = std::min(e2_refined, e2_coarse); bool filter_diverged = min_e2 > 1.5f * y2 && y2 > 30.f * 30.f * kBlockSize; filters_converged_[ch] = diff --git a/modules/audio_processing/aec3/transparent_mode.cc b/modules/audio_processing/aec3/transparent_mode.cc index 489f53f4f1..4d6937ff96 100644 --- a/modules/audio_processing/aec3/transparent_mode.cc +++ b/modules/audio_processing/aec3/transparent_mode.cc @@ -19,6 +19,7 @@ namespace { constexpr size_t kBlocksSinceConvergencedFilterInit = 10000; constexpr size_t kBlocksSinceConsistentEstimateInit = 10000; +constexpr float kInitialTransparentStateProbability = 0.2f; bool DeactivateTransparentMode() { return field_trial::IsEnabled("WebRTC-Aec3TransparentModeKillSwitch"); @@ -41,7 +42,7 @@ class TransparentModeImpl : public TransparentMode { transparency_activated_ = false; // The estimated probability of being transparent mode. - prob_transparent_state_ = 0.f; + prob_transparent_state_ = kInitialTransparentStateProbability; } void Update(int filter_delay_blocks, @@ -118,7 +119,7 @@ class TransparentModeImpl : public TransparentMode { private: bool transparency_activated_ = false; - float prob_transparent_state_ = 0.f; + float prob_transparent_state_ = kInitialTransparentStateProbability; }; // Legacy classifier for toggling transparent mode.