diff --git a/api/audio/echo_canceller3_config.h b/api/audio/echo_canceller3_config.h index 55665caa33..592dce4550 100644 --- a/api/audio/echo_canceller3_config.h +++ b/api/audio/echo_canceller3_config.h @@ -62,9 +62,9 @@ struct EchoCanceller3Config { } erle; struct EpStrength { - float lf = 10.f; - float mf = 10.f; - float hf = 10.f; + float lf = 1.f; + float mf = 1.f; + float hf = 1.f; float default_len = 0.f; bool echo_can_saturate = true; bool bounded_erl = false; diff --git a/modules/audio_processing/aec3/aec_state.h b/modules/audio_processing/aec3/aec_state.h index ebfa62f062..4f5c8717b1 100644 --- a/modules/audio_processing/aec3/aec_state.h +++ b/modules/audio_processing/aec3/aec_state.h @@ -49,7 +49,7 @@ class AecState { bool UseLinearFilterOutput() const { return use_linear_filter_output_; } // Returns the estimated echo path gain. - bool EchoPathGain() const { return filter_analyzer_.Gain(); } + float EchoPathGain() const { return filter_analyzer_.Gain(); } // Returns whether the render signal is currently active. bool ActiveRender() const { return blocks_with_active_render_ > 200; } diff --git a/modules/audio_processing/aec3/residual_echo_estimator.cc b/modules/audio_processing/aec3/residual_echo_estimator.cc index 19f65d098e..da152e9f70 100644 --- a/modules/audio_processing/aec3/residual_echo_estimator.cc +++ b/modules/audio_processing/aec3/residual_echo_estimator.cc @@ -24,12 +24,17 @@ bool EnableSoftTransparentMode() { return !field_trial::IsEnabled("WebRTC-Aec3SoftTransparentModeKillSwitch"); } +bool OverrideEstimatedEchoPathGain() { + return !field_trial::IsEnabled("WebRTC-Aec3OverrideEchoPathGainKillSwitch"); +} + } // namespace ResidualEchoEstimator::ResidualEchoEstimator(const EchoCanceller3Config& config) : config_(config), S2_old_(config_.filter.main.length_blocks), - soft_transparent_mode_(EnableSoftTransparentMode()) { + soft_transparent_mode_(EnableSoftTransparentMode()), + override_estimated_echo_path_gain_(OverrideEstimatedEchoPathGain()) { Reset(); } @@ -74,9 +79,15 @@ void ResidualEchoEstimator::Estimate( 0.f, a - config_.echo_model.stationary_gate_slope * b); }); - float echo_path_gain = aec_state.TransparentMode() && soft_transparent_mode_ - ? 0.01f - : aec_state.EchoPathGain(); + float echo_path_gain; + if (override_estimated_echo_path_gain_) { + echo_path_gain = + aec_state.TransparentMode() && soft_transparent_mode_ ? 0.01f : 1.f; + } else { + echo_path_gain = aec_state.TransparentMode() && soft_transparent_mode_ + ? 0.01f + : aec_state.EchoPathGain(); + } NonLinearEstimate(echo_path_gain, X2, Y2, R2); // If the echo is saturated, estimate the echo power as the maximum echo diff --git a/modules/audio_processing/aec3/residual_echo_estimator.h b/modules/audio_processing/aec3/residual_echo_estimator.h index d03b89a464..5c8ba55368 100644 --- a/modules/audio_processing/aec3/residual_echo_estimator.h +++ b/modules/audio_processing/aec3/residual_echo_estimator.h @@ -83,6 +83,7 @@ class ResidualEchoEstimator { std::array X2_noise_floor_; std::array X2_noise_floor_counter_; const bool soft_transparent_mode_; + const bool override_estimated_echo_path_gain_; RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(ResidualEchoEstimator); };