Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Unified Diff: webrtc/modules/audio_processing/aec3/erle_estimator.cc

Issue 2886733002: Transparency increasing tuning for AEC3 (Closed)
Patch Set: Fixed memory issue Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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(),
« no previous file with comments | « webrtc/modules/audio_processing/aec3/echo_remover.cc ('k') | webrtc/modules/audio_processing/aec3/erle_estimator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698