From f80cf814353d11a9f22bef5ce5e8868f2c72f0d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20de=20Vicente=20Pe=C3=B1a?= Date: Tue, 20 Jun 2023 15:14:30 +0200 Subject: [PATCH] Changing the pre echo configuration default. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:14205 Change-Id: I17add3bf19c599f170ffe98d0da0a561794591c1 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/309481 Commit-Queue: Jesus de Vicente Pena Reviewed-by: Per Ã…hgren Cr-Commit-Position: refs/heads/main@{#40319} --- modules/audio_processing/aec3/matched_filter.cc | 10 ++++++---- .../audio_processing/aec3/matched_filter_unittest.cc | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/audio_processing/aec3/matched_filter.cc b/modules/audio_processing/aec3/matched_filter.cc index af30ff1b9f..edaa2a4d14 100644 --- a/modules/audio_processing/aec3/matched_filter.cc +++ b/modules/audio_processing/aec3/matched_filter.cc @@ -109,14 +109,16 @@ size_t ComputePreEchoLag( } webrtc::MatchedFilter::PreEchoConfiguration FetchPreEchoConfiguration() { - float threshold = 0.5f; - int mode = 0; + constexpr float kDefaultThreshold = 0.5f; + constexpr int kDefaultMode = 3; + float threshold = kDefaultThreshold; + int mode = kDefaultMode; const std::string pre_echo_configuration_field_trial = webrtc::field_trial::FindFullName("WebRTC-Aec3PreEchoConfiguration"); webrtc::FieldTrialParameter threshold_field_trial_parameter( - /*key=*/"threshold", /*default_value=*/threshold); + /*key=*/"threshold", /*default_value=*/kDefaultThreshold); webrtc::FieldTrialParameter mode_field_trial_parameter( - /*key=*/"mode", /*default_value=*/mode); + /*key=*/"mode", /*default_value=*/kDefaultMode); webrtc::ParseFieldTrial( {&threshold_field_trial_parameter, &mode_field_trial_parameter}, pre_echo_configuration_field_trial); diff --git a/modules/audio_processing/aec3/matched_filter_unittest.cc b/modules/audio_processing/aec3/matched_filter_unittest.cc index 0a04c7809c..3f26cc146e 100644 --- a/modules/audio_processing/aec3/matched_filter_unittest.cc +++ b/modules/audio_processing/aec3/matched_filter_unittest.cc @@ -584,7 +584,7 @@ TEST(MatchedFilterFieldTrialTest, PreEchoConfigurationTest) { TEST(MatchedFilterFieldTrialTest, WrongPreEchoConfigurationTest) { constexpr float kDefaultThreshold = 0.5f; - constexpr int kDefaultMode = 0; + constexpr int kDefaultMode = 3; float threshold_in = -0.1f; int mode_in = 5; rtc::StringBuilder field_trial_name;