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..f6aefa8702d84323a5a4b4c822a822ffa6389e23 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 = 32; |
ivoc
2017/05/22 14:57:59
I think it would be nice to initialize this to to
peah-webrtc
2017/05/22 21:52:46
Good point! I did not think of them being the same
|
+ 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)); |
aleloi
2017/05/22 20:41:45
I think the code gets simpler to follow without th
peah-webrtc
2017/05/22 21:52:46
I agree that that would produce nicer code, but I
|
+ } |
} |
} |
+ band_limit = kFftLengthBy2; |
+ max_erle = kMaxHfErle; |
} |
std::for_each(hold_counters_.begin(), hold_counters_.end(), |