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

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

Issue 2980493002: Add adaptive notch filter to remove narrowband echo components in AEC3 (Closed)
Patch Set: Fixed build error in debug mode Created 3 years, 5 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 b6d6aaeb2e576bb7a9d5fa1c97e047333bbd9383..61238d93d4a6d1f0732009e2c119ebca1f609f79 100644
--- a/webrtc/modules/audio_processing/aec3/suppression_gain_unittest.cc
+++ b/webrtc/modules/audio_processing/aec3/suppression_gain_unittest.cc
@@ -30,7 +30,7 @@ TEST(SuppressionGain, NullOutputGains) {
N2.fill(0.f);
float high_bands_gain;
EXPECT_DEATH(SuppressionGain(DetectOptimization())
- .GetGain(E2, R2, N2, false,
+ .GetGain(E2, R2, N2, RenderSignalAnalyzer(), false,
std::vector<std::vector<float>>(
3, std::vector<float>(kBlockSize, 0.f)),
false, &high_bands_gain, nullptr),
@@ -42,6 +42,7 @@ TEST(SuppressionGain, NullOutputGains) {
// Does a sanity check that the gains are correctly computed.
TEST(SuppressionGain, BasicGainComputation) {
SuppressionGain suppression_gain(DetectOptimization());
+ RenderSignalAnalyzer analyzer;
float high_bands_gain;
std::array<float, kFftLengthBy2Plus1> E2;
std::array<float, kFftLengthBy2Plus1> R2;
@@ -54,7 +55,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, false, &high_bands_gain, &g);
+ suppression_gain.GetGain(E2, R2, N2, analyzer, false, x, false,
+ &high_bands_gain, &g);
}
std::for_each(g.begin(), g.end(),
[](float a) { EXPECT_NEAR(1.f, a, 0.001); });
@@ -64,7 +66,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, false, &high_bands_gain, &g);
+ suppression_gain.GetGain(E2, R2, N2, analyzer, false, x, false,
+ &high_bands_gain, &g);
}
std::for_each(g.begin(), g.end(),
[](float a) { EXPECT_NEAR(1.f, a, 0.001); });
@@ -74,13 +77,15 @@ TEST(SuppressionGain, BasicGainComputation) {
R2.fill(10000000000000.f);
N2.fill(0.f);
for (int k = 0; k < 10; ++k) {
- suppression_gain.GetGain(E2, R2, N2, false, x, false, &high_bands_gain, &g);
+ suppression_gain.GetGain(E2, R2, N2, analyzer, false, x, 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, true, &high_bands_gain, &g);
+ suppression_gain.GetGain(E2, R2, N2, analyzer, false, x, 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);
}
« 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