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

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

Issue 2782423003: Major updates to the echo removal functionality in AEC3 (Closed)
Patch Set: Added initialization of uninitialized vector 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 9d41f18fd63fb3f239bc1baeadb0919f28e4d95a..f4feb74a776bf95bc18011bdb2d759ca9a0f39a2 100644
--- a/webrtc/modules/audio_processing/aec3/suppression_gain_unittest.cc
+++ b/webrtc/modules/audio_processing/aec3/suppression_gain_unittest.cc
@@ -25,9 +25,16 @@ TEST(SuppressionGain, NullOutputGains) {
std::array<float, kFftLengthBy2Plus1> E2;
std::array<float, kFftLengthBy2Plus1> R2;
std::array<float, kFftLengthBy2Plus1> N2;
- EXPECT_DEATH(
- SuppressionGain(DetectOptimization()).GetGain(E2, R2, N2, 0.1f, nullptr),
- "");
+ E2.fill(0.f);
+ R2.fill(0.f);
+ N2.fill(0.f);
+ float high_bands_gain;
+ EXPECT_DEATH(SuppressionGain(DetectOptimization())
+ .GetGain(E2, R2, N2, false,
+ std::vector<std::vector<float>>(
+ 3, std::vector<float>(kBlockSize, 0.f)),
+ 1, &high_bands_gain, nullptr),
+ "");
}
#endif
@@ -109,17 +116,19 @@ TEST(SuppressionGain, TestOptimizations) {
// Does a sanity check that the gains are correctly computed.
TEST(SuppressionGain, BasicGainComputation) {
SuppressionGain suppression_gain(DetectOptimization());
+ float high_bands_gain;
std::array<float, kFftLengthBy2Plus1> E2;
std::array<float, kFftLengthBy2Plus1> R2;
std::array<float, kFftLengthBy2Plus1> N2;
std::array<float, kFftLengthBy2Plus1> g;
+ std::vector<std::vector<float>> x(1, std::vector<float>(kBlockSize, 0.f));
// Ensure that a strong noise is detected to mask any echoes.
E2.fill(10.f);
R2.fill(0.1f);
N2.fill(100.f);
for (int k = 0; k < 10; ++k) {
- suppression_gain.GetGain(E2, R2, N2, 0.1f, &g);
+ suppression_gain.GetGain(E2, R2, N2, false, x, 1, &high_bands_gain, &g);
}
std::for_each(g.begin(), g.end(),
[](float a) { EXPECT_NEAR(1.f, a, 0.001); });
@@ -129,7 +138,7 @@ TEST(SuppressionGain, BasicGainComputation) {
R2.fill(0.1f);
N2.fill(0.f);
for (int k = 0; k < 10; ++k) {
- suppression_gain.GetGain(E2, R2, N2, 0.1f, &g);
+ suppression_gain.GetGain(E2, R2, N2, false, x, 1, &high_bands_gain, &g);
}
std::for_each(g.begin(), g.end(),
[](float a) { EXPECT_NEAR(1.f, a, 0.001); });
@@ -139,7 +148,7 @@ TEST(SuppressionGain, BasicGainComputation) {
R2.fill(100.f);
N2.fill(0.f);
for (int k = 0; k < 10; ++k) {
- suppression_gain.GetGain(E2, R2, N2, 0.1f, &g);
+ suppression_gain.GetGain(E2, R2, N2, false, x, 1, &high_bands_gain, &g);
}
std::for_each(g.begin(), g.end(),
[](float a) { EXPECT_NEAR(0.f, a, 0.001); });
« 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