Remove ErleUncertainty

Erle Uncertainty changes the residual echo computation during saturated
echo. However, the case of saturated echo is already handled by the
residual echo estimator causing the ErleUncertainty to be a no-op.

The change has been tested for bit-exactness.

Bug: webrtc:8671
Change-Id: I779ba67f99f29d4475a0465d05da03d42d50e075
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215072
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33719}
This commit is contained in:
Gustaf Ullberg 2021-04-13 14:05:34 +02:00 committed by Commit Bot
parent 77d73a62d5
commit 1fad94f502
3 changed files with 1 additions and 36 deletions

View File

@ -113,14 +113,6 @@ void AecState::GetResidualEchoScaling(
residual_scaling);
}
absl::optional<float> AecState::ErleUncertainty() const {
if (SaturatedEcho()) {
return 1.f;
}
return absl::nullopt;
}
AecState::AecState(const EchoCanceller3Config& config,
size_t num_capture_channels)
: data_dumper_(

View File

@ -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<float> ErleUncertainty() const;
// Returns the fullband ERLE estimate in log2 units.
float FullBandErleLog2() const { return erle_estimator_.FullbandErleLog2(); }

View File

@ -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<const std::array<float, kFftLengthBy2Plus1>> S2_linear,
float erle_uncertainty,
rtc::ArrayView<std::array<float, kFftLengthBy2Plus1>> 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<float> 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);