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

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

Issue 2808733002: Added forced zero AEC output after call startup and echo path changes (Closed)
Patch Set: Fixed memory access issue again Created 3 years, 8 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
« no previous file with comments | « webrtc/modules/audio_processing/aec3/suppression_gain.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/aec3/suppression_gain_unittest.cc
diff --git a/webrtc/modules/audio_processing/aec3/suppression_gain_unittest.cc b/webrtc/modules/audio_processing/aec3/suppression_gain_unittest.cc
index f4feb74a776bf95bc18011bdb2d759ca9a0f39a2..83c41e12543f9f8d14a48236e1849871a0904e2d 100644
--- a/webrtc/modules/audio_processing/aec3/suppression_gain_unittest.cc
+++ b/webrtc/modules/audio_processing/aec3/suppression_gain_unittest.cc
@@ -33,7 +33,7 @@ TEST(SuppressionGain, NullOutputGains) {
.GetGain(E2, R2, N2, false,
std::vector<std::vector<float>>(
3, std::vector<float>(kBlockSize, 0.f)),
- 1, &high_bands_gain, nullptr),
+ 1, false, &high_bands_gain, nullptr),
"");
}
@@ -128,7 +128,8 @@ TEST(SuppressionGain, BasicGainComputation) {
R2.fill(0.1f);
N2.fill(100.f);
for (int k = 0; k < 10; ++k) {
- suppression_gain.GetGain(E2, R2, N2, false, x, 1, &high_bands_gain, &g);
+ suppression_gain.GetGain(E2, R2, N2, false, x, 1, false, &high_bands_gain,
+ &g);
}
std::for_each(g.begin(), g.end(),
[](float a) { EXPECT_NEAR(1.f, a, 0.001); });
@@ -138,7 +139,8 @@ TEST(SuppressionGain, BasicGainComputation) {
R2.fill(0.1f);
N2.fill(0.f);
for (int k = 0; k < 10; ++k) {
- suppression_gain.GetGain(E2, R2, N2, false, x, 1, &high_bands_gain, &g);
+ suppression_gain.GetGain(E2, R2, N2, false, x, 1, false, &high_bands_gain,
+ &g);
}
std::for_each(g.begin(), g.end(),
[](float a) { EXPECT_NEAR(1.f, a, 0.001); });
@@ -148,10 +150,16 @@ TEST(SuppressionGain, BasicGainComputation) {
R2.fill(100.f);
N2.fill(0.f);
for (int k = 0; k < 10; ++k) {
- suppression_gain.GetGain(E2, R2, N2, false, x, 1, &high_bands_gain, &g);
+ suppression_gain.GetGain(E2, R2, N2, false, x, 1, false, &high_bands_gain,
+ &g);
}
std::for_each(g.begin(), g.end(),
[](float a) { EXPECT_NEAR(0.f, a, 0.001); });
+
+ // Verify the functionality for forcing a zero gain.
+ suppression_gain.GetGain(E2, R2, N2, false, x, 1, true, &high_bands_gain, &g);
+ std::for_each(g.begin(), g.end(), [](float a) { EXPECT_FLOAT_EQ(0.f, a); });
+ EXPECT_FLOAT_EQ(0.f, high_bands_gain);
}
} // namespace aec3
« no previous file with comments | « webrtc/modules/audio_processing/aec3/suppression_gain.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698