Index: webrtc/modules/audio_processing/aec3/erle_estimator.cc |
diff --git a/webrtc/modules/audio_processing/aec3/erle_estimator.cc b/webrtc/modules/audio_processing/aec3/erle_estimator.cc |
index 044e11ea3dcdf76cf2c98a6ada88d2ea864e3b39..2ceadd3f9e4a6effb5f5a43de1a7716bae4e01f0 100644 |
--- a/webrtc/modules/audio_processing/aec3/erle_estimator.cc |
+++ b/webrtc/modules/audio_processing/aec3/erle_estimator.cc |
@@ -17,7 +17,8 @@ namespace webrtc { |
namespace { |
constexpr float kMinErle = 1.f; |
-constexpr float kMaxErle = 8.f; |
+constexpr float kMaxLfErle = 8.f; |
+constexpr float kMaxHfErle = 1.5f; |
} // namespace |
@@ -40,15 +41,22 @@ void ErleEstimator::Update( |
constexpr float kX2Min = 44015068.0f; |
// Update the estimates in a clamped minimum statistics manner. |
- for (size_t k = 1; k < kFftLengthBy2; ++k) { |
- if (X2[k] > kX2Min && E2[k] > 0.f) { |
- const float new_erle = Y2[k] / E2[k]; |
- if (new_erle > erle_[k]) { |
- hold_counters_[k - 1] = 100; |
- erle_[k] += 0.1f * (new_erle - erle_[k]); |
- erle_[k] = std::max(kMinErle, std::min(erle_[k], kMaxErle)); |
+ size_t k = 1; |
+ size_t band_limit = kFftLengthBy2 / 2; |
+ float max_erle = kMaxLfErle; |
+ for (int j = 0; j < 2; ++j) { |
+ for (; k < band_limit; ++k) { |
+ if (X2[k] > kX2Min && E2[k] > 0.f) { |
+ const float new_erle = Y2[k] / E2[k]; |
+ if (new_erle > erle_[k]) { |
+ hold_counters_[k - 1] = 100; |
+ erle_[k] += 0.1f * (new_erle - erle_[k]); |
+ erle_[k] = std::max(kMinErle, std::min(erle_[k], max_erle)); |
+ } |
} |
} |
+ band_limit = kFftLengthBy2; |
+ max_erle = kMaxHfErle; |
} |
std::for_each(hold_counters_.begin(), hold_counters_.end(), |