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}
This commit is contained in:
Per Åhgren 2017-12-20 17:26:31 +01:00 committed by Commit Bot
parent f85e31b33c
commit 60e8965b6b
4 changed files with 4 additions and 17 deletions

View File

@ -73,7 +73,6 @@ void AecState::HandleEchoPathChange(
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 @@ void AecState::Update(
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_ &&

View File

@ -106,9 +106,6 @@ class AecState {
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 @@ class AecState {
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);

View File

@ -142,10 +142,10 @@ void ResidualEchoEstimator::Estimate(
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 @@ void ResidualEchoEstimator::NonLinearEstimate(
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 @@ void ResidualEchoEstimator::NonLinearEstimate(
// 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;

View File

@ -52,7 +52,6 @@ class ResidualEchoEstimator {
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);