Removed the redundant functionality for the initial state in AEC3
Bug: webrtc:8671
Change-Id: I93412675a6b56c20c8d866e64e24560a4546dc66
Reviewed-on: https://webrtc-review.googlesource.com/35200
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21391}
diff --git a/modules/audio_processing/aec3/aec_state.cc b/modules/audio_processing/aec3/aec_state.cc
index 195f5dc..8edecf7 100644
--- a/modules/audio_processing/aec3/aec_state.cc
+++ b/modules/audio_processing/aec3/aec_state.cc
@@ -73,7 +73,6 @@
std::fill(max_render_.begin(), max_render_.end(), 0.f);
force_zero_gain_counter_ = 0;
blocks_with_proper_filter_adaptation_ = 0;
- initial_state_ = true;
capture_block_counter_ = 0;
filter_has_had_time_to_converge_ = false;
render_received_ = false;
@@ -162,9 +161,6 @@
filter_has_had_time_to_converge_ =
blocks_with_proper_filter_adaptation_ >= 2 * kNumBlocksPerSecond;
- // TODO(peah): Remove.
- initial_state_ = capture_block_counter_ < 3 * kNumBlocksPerSecond;
-
// Flag whether the linear filter estimate is usable.
usable_linear_estimate_ =
!echo_saturation_ &&
diff --git a/modules/audio_processing/aec3/aec_state.h b/modules/audio_processing/aec3/aec_state.h
index afc55a2..1479c0c 100644
--- a/modules/audio_processing/aec3/aec_state.h
+++ b/modules/audio_processing/aec3/aec_state.h
@@ -106,9 +106,6 @@
return filter_has_had_time_to_converge_;
}
- // Returns whether the AEC is in an initial state.
- bool InitialState() const { return initial_state_; }
-
// Updates the aec state.
void Update(const std::vector<std::array<float, kFftLengthBy2Plus1>>&
adaptive_filter_frequency_response,
@@ -169,7 +166,6 @@
std::vector<float> max_render_;
float reverb_decay_;
bool saturating_echo_path_ = false;
- bool initial_state_ = true;
bool filter_has_had_time_to_converge_ = false;
RTC_DISALLOW_COPY_AND_ASSIGN(AecState);
diff --git a/modules/audio_processing/aec3/residual_echo_estimator.cc b/modules/audio_processing/aec3/residual_echo_estimator.cc
index 95f64e1..c89084b 100644
--- a/modules/audio_processing/aec3/residual_echo_estimator.cc
+++ b/modules/audio_processing/aec3/residual_echo_estimator.cc
@@ -142,10 +142,10 @@
X2.begin(), X2.end(), X2_noise_floor_.begin(), X2.begin(),
[](float a, float b) { return std::max(0.f, a - 10.f * b); });
- NonLinearEstimate(
- aec_state.FilterHasHadTimeToConverge(), aec_state.SaturatedEcho(),
- config_.ep_strength.bounded_erl, aec_state.TransparentMode(),
- aec_state.InitialState(), X2, Y2, R2);
+ NonLinearEstimate(aec_state.FilterHasHadTimeToConverge(),
+ aec_state.SaturatedEcho(),
+ config_.ep_strength.bounded_erl,
+ aec_state.TransparentMode(), X2, Y2, R2);
if (aec_state.ExternalDelay() && aec_state.FilterDelay() &&
aec_state.SaturatedEcho()) {
@@ -195,7 +195,6 @@
bool saturated_echo,
bool bounded_erl,
bool transparent_mode,
- bool initial_state,
const std::array<float, kFftLengthBy2Plus1>& X2,
const std::array<float, kFftLengthBy2Plus1>& Y2,
std::array<float, kFftLengthBy2Plus1>* R2) {
@@ -215,9 +214,6 @@
// If the filter should have been able to converge, and and it is known that
// the ERL is bounded, use a very low gain.
echo_path_gain_lf = echo_path_gain_mf = echo_path_gain_hf = 0.001f;
- } else if (!initial_state) {
- // If the AEC is no longer in an initial state, assume a weak echo path.
- echo_path_gain_lf = echo_path_gain_mf = echo_path_gain_hf = 0.01f;
} else {
// In the initial state, use conservative gains.
echo_path_gain_lf = config_.ep_strength.lf;
diff --git a/modules/audio_processing/aec3/residual_echo_estimator.h b/modules/audio_processing/aec3/residual_echo_estimator.h
index 271b1c0..f2ecea1 100644
--- a/modules/audio_processing/aec3/residual_echo_estimator.h
+++ b/modules/audio_processing/aec3/residual_echo_estimator.h
@@ -52,7 +52,6 @@
bool saturated_echo,
bool bounded_erl,
bool transparent_mode,
- bool initial_state,
const std::array<float, kFftLengthBy2Plus1>& X2,
const std::array<float, kFftLengthBy2Plus1>& Y2,
std::array<float, kFftLengthBy2Plus1>* R2);