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

Unified Diff: webrtc/modules/audio_processing/aec3/erle_estimator_unittest.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_unittest.cc
diff --git a/webrtc/modules/audio_processing/aec3/erle_estimator_unittest.cc b/webrtc/modules/audio_processing/aec3/erle_estimator_unittest.cc
index 5fdabfa9069785f33fc5483a42b832d0689b27fa..dc95eee040ad37c7094dd0def14a1a130940b58c 100644
--- a/webrtc/modules/audio_processing/aec3/erle_estimator_unittest.cc
+++ b/webrtc/modules/audio_processing/aec3/erle_estimator_unittest.cc
@@ -15,10 +15,17 @@ namespace webrtc {
namespace {
+constexpr int kLowFrequencyLimit = kFftLengthBy2 / 2;
+
void VerifyErle(const std::array<float, kFftLengthBy2Plus1>& erle,
- float reference) {
- std::for_each(erle.begin(), erle.end(),
- [reference](float a) { EXPECT_NEAR(reference, a, 0.001); });
+ float reference_lf,
+ float reference_hf) {
+ std::for_each(
+ erle.begin(), erle.begin() + kLowFrequencyLimit,
+ [reference_lf](float a) { EXPECT_NEAR(reference_lf, a, 0.001); });
+ std::for_each(
+ erle.begin() + kLowFrequencyLimit, erle.end(),
+ [reference_hf](float a) { EXPECT_NEAR(reference_hf, a, 0.001); });
}
} // namespace
@@ -38,7 +45,7 @@ TEST(ErleEstimator, Estimates) {
for (size_t k = 0; k < 200; ++k) {
estimator.Update(X2, Y2, E2);
}
- VerifyErle(estimator.Erle(), 8.f);
+ VerifyErle(estimator.Erle(), 8.f, 1.5f);
// Verifies that the ERLE is not immediately decreased when the ERLE in the
// data decreases.
@@ -46,13 +53,13 @@ TEST(ErleEstimator, Estimates) {
for (size_t k = 0; k < 98; ++k) {
estimator.Update(X2, Y2, E2);
}
- VerifyErle(estimator.Erle(), 8.f);
+ VerifyErle(estimator.Erle(), 8.f, 1.5f);
// Verifies that the minimum ERLE is eventually achieved.
for (size_t k = 0; k < 1000; ++k) {
estimator.Update(X2, Y2, E2);
}
- VerifyErle(estimator.Erle(), 1.f);
+ VerifyErle(estimator.Erle(), 1.f, 1.f);
// Verifies that the ERLE estimate is is not updated for low-level render
// signals.
@@ -61,6 +68,6 @@ TEST(ErleEstimator, Estimates) {
for (size_t k = 0; k < 200; ++k) {
estimator.Update(X2, Y2, E2);
}
- VerifyErle(estimator.Erle(), 1.f);
+ VerifyErle(estimator.Erle(), 1.f, 1.f);
}
} // namespace webrtc
« no previous file with comments | « webrtc/modules/audio_processing/aec3/erle_estimator.cc ('k') | webrtc/modules/audio_processing/aec3/suppression_gain.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698