From 0169a3e5cc794880f060cd3ed87701c7a97e5531 Mon Sep 17 00:00:00 2001 From: Sam Zackrisson Date: Wed, 9 Oct 2019 08:00:29 +0200 Subject: [PATCH] Delete AecState::EchoPathGain() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up CL to https://webrtc-review.googlesource.com/c/src/+/155363 The value is computed, and only used, within AecState::Update(). Bug: webrtc:10913 Change-Id: I4e4248452a463f654c0310657b49c74ffa4c55b6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156161 Reviewed-by: Per Ã…hgren Commit-Queue: Sam Zackrisson Cr-Commit-Position: refs/heads/master@{#29412} --- modules/audio_processing/aec3/aec_state.cc | 10 ++++------ modules/audio_processing/aec3/aec_state.h | 4 ---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/modules/audio_processing/aec3/aec_state.cc b/modules/audio_processing/aec3/aec_state.cc index 803a598e95..f0e183aa57 100644 --- a/modules/audio_processing/aec3/aec_state.cc +++ b/modules/audio_processing/aec3/aec_state.cc @@ -66,7 +66,6 @@ AecState::AecState(const EchoCanceller3Config& config, filter_quality_state_(config_), erl_estimator_(2 * kNumBlocksPerSecond), erle_estimator_(2 * kNumBlocksPerSecond, config_, num_capture_channels), - max_echo_path_gain_(config_.ep_strength.default_gain), filter_analyzers_(num_capture_channels), echo_audibility_( config_.echo_audibility.use_stationarity_properties_at_init), @@ -85,7 +84,6 @@ void AecState::HandleEchoPathChange( for (auto& filter_analyzer : filter_analyzers_) { filter_analyzer->Reset(); } - max_echo_path_gain_ = config_.ep_strength.default_gain; capture_signal_saturation_ = false; strong_not_saturated_render_blocks_ = 0; blocks_with_active_render_ = 0; @@ -130,7 +128,7 @@ void AecState::Update( bool any_filter_converged = false; bool all_filters_diverged = true; bool any_filter_consistent = false; - max_echo_path_gain_ = 0.f; + float max_echo_path_gain = 0.f; for (size_t ch = 0; ch < subtractor_output.size(); ++ch) { subtractor_output_analyzers_[ch].Update(subtractor_output[ch]); any_filter_converged = any_filter_converged || @@ -142,8 +140,8 @@ void AecState::Update( render_buffer); any_filter_consistent = any_filter_consistent || filter_analyzers_[ch]->Consistent(); - max_echo_path_gain_ = - std::max(max_echo_path_gain_, filter_analyzers_[ch]->Gain()); + max_echo_path_gain = + std::max(max_echo_path_gain, filter_analyzers_[ch]->Gain()); } // Estimate the direct path delay of the filter. @@ -206,7 +204,7 @@ void AecState::Update( // Detect and flag echo saturation. saturation_detector_.Update(aligned_render_block, SaturatedCapture(), UsableLinearEstimate(), subtractor_output, - EchoPathGain()); + max_echo_path_gain); // Update the decision on whether to use the initial state parameter set. initial_state_.Update(active_render, SaturatedCapture()); diff --git a/modules/audio_processing/aec3/aec_state.h b/modules/audio_processing/aec3/aec_state.h index f6a31d8e6e..500822dc40 100644 --- a/modules/audio_processing/aec3/aec_state.h +++ b/modules/audio_processing/aec3/aec_state.h @@ -56,9 +56,6 @@ class AecState { config_.filter.use_linear_filter; } - // Returns the estimated echo path gain. - float EchoPathGain() const { return max_echo_path_gain_; } - // Returns whether the render signal is currently active. bool ActiveRender() const { return blocks_with_active_render_ > 200; } @@ -292,7 +289,6 @@ class AecState { ErleEstimator erle_estimator_; size_t strong_not_saturated_render_blocks_ = 0; size_t blocks_with_active_render_ = 0; - float max_echo_path_gain_; bool capture_signal_saturation_ = false; std::vector> filter_analyzers_; absl::optional external_delay_;