Delete AecState::EchoPathGain()
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 <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29412}
diff --git a/modules/audio_processing/aec3/aec_state.cc b/modules/audio_processing/aec3/aec_state.cc
index 803a598..f0e183a 100644
--- a/modules/audio_processing/aec3/aec_state.cc
+++ b/modules/audio_processing/aec3/aec_state.cc
@@ -66,7 +66,6 @@
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 @@
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 @@
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 @@
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 @@
// 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 f6a31d8..500822d 100644
--- a/modules/audio_processing/aec3/aec_state.h
+++ b/modules/audio_processing/aec3/aec_state.h
@@ -56,9 +56,6 @@
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 @@
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<std::unique_ptr<FilterAnalyzer>> filter_analyzers_;
absl::optional<DelayEstimate> external_delay_;