diff --git a/modules/audio_processing/aec3/aec_state.cc b/modules/audio_processing/aec3/aec_state.cc index 5b31e3cb9f..15f3e17801 100644 --- a/modules/audio_processing/aec3/aec_state.cc +++ b/modules/audio_processing/aec3/aec_state.cc @@ -113,14 +113,6 @@ void AecState::GetResidualEchoScaling( residual_scaling); } -absl::optional AecState::ErleUncertainty() const { - if (SaturatedEcho()) { - return 1.f; - } - - return absl::nullopt; -} - AecState::AecState(const EchoCanceller3Config& config, size_t num_capture_channels) : data_dumper_( diff --git a/modules/audio_processing/aec3/aec_state.h b/modules/audio_processing/aec3/aec_state.h index 5b40e9513a..22b4fed4a2 100644 --- a/modules/audio_processing/aec3/aec_state.h +++ b/modules/audio_processing/aec3/aec_state.h @@ -74,12 +74,6 @@ class AecState { return erle_estimator_.Erle(); } - // Returns an offset to apply to the estimation of the residual echo - // computation. Returning nullopt means that no offset should be used, while - // any other value will be applied as a multiplier to the estimated residual - // echo. - absl::optional ErleUncertainty() const; - // Returns the fullband ERLE estimate in log2 units. float FullBandErleLog2() const { return erle_estimator_.FullbandErleLog2(); } diff --git a/modules/audio_processing/aec3/residual_echo_estimator.cc b/modules/audio_processing/aec3/residual_echo_estimator.cc index e352cf5552..0567b546c9 100644 --- a/modules/audio_processing/aec3/residual_echo_estimator.cc +++ b/modules/audio_processing/aec3/residual_echo_estimator.cc @@ -84,22 +84,6 @@ void LinearEstimate( } } -// Estimates the residual echo power based on an uncertainty estimate of the -// echo return loss enhancement (ERLE) and the linear power estimate. -void LinearEstimate( - rtc::ArrayView> S2_linear, - float erle_uncertainty, - rtc::ArrayView> R2) { - RTC_DCHECK_EQ(S2_linear.size(), R2.size()); - - const size_t num_capture_channels = R2.size(); - for (size_t ch = 0; ch < num_capture_channels; ++ch) { - for (size_t k = 0; k < kFftLengthBy2Plus1; ++k) { - R2[ch][k] = S2_linear[ch][k] * erle_uncertainty; - } - } -} - // Estimates the residual echo power based on the estimate of the echo path // gain. void NonLinearEstimate( @@ -201,12 +185,7 @@ void ResidualEchoEstimator::Estimate( std::copy(Y2[ch].begin(), Y2[ch].end(), R2[ch].begin()); } } else { - absl::optional erle_uncertainty = aec_state.ErleUncertainty(); - if (erle_uncertainty) { - LinearEstimate(S2_linear, *erle_uncertainty, R2); - } else { - LinearEstimate(S2_linear, aec_state.Erle(), R2); - } + LinearEstimate(S2_linear, aec_state.Erle(), R2); } AddReverb(ReverbType::kLinear, aec_state, render_buffer, R2);