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

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: Changes in response to reviewer comments 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
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 6016f182a999781255117e911927a6ee9477077f..ce6b46a3d36d88865f4dc3b51896ec2f16159ff3 100644
--- a/webrtc/modules/audio_processing/aec3/suppression_gain_unittest.cc
+++ b/webrtc/modules/audio_processing/aec3/suppression_gain_unittest.cc
@@ -24,9 +24,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
@@ -108,17 +115,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); });
@@ -128,7 +137,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); });
@@ -138,7 +147,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); });

Powered by Google App Engine
This is Rietveld 408576698