Add case to ApmTest.Process to test the extended filter mode
R=andrew@webrtc.org, bjornv@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/40509004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@8192 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/modules/audio_processing/test/audio_processing_unittest.cc b/modules/audio_processing/test/audio_processing_unittest.cc
index 931169e..7e36d67 100644
--- a/modules/audio_processing/test/audio_processing_unittest.cc
+++ b/modules/audio_processing/test/audio_processing_unittest.cc
@@ -381,8 +381,14 @@
#if defined(WEBRTC_AUDIOPROC_FIXED_PROFILE)
ref_filename_(ref_path_ + "output_data_fixed.pb"),
#elif defined(WEBRTC_AUDIOPROC_FLOAT_PROFILE)
+#if defined(WEBRTC_MAC)
+ // A different file for Mac is needed because on this platform the AEC
+ // constant |kFixedDelayMs| value is 20 and not 50 as it is on the rest.
+ ref_filename_(ref_path_ + "output_data_mac.pb"),
+#else
ref_filename_(ref_path_ + "output_data_float.pb"),
#endif
+#endif
frame_(NULL),
revframe_(NULL),
output_sample_rate_hz_(0),
@@ -1915,13 +1921,21 @@
test->set_num_input_channels(kChannels[j]);
test->set_num_output_channels(kChannels[j]);
test->set_sample_rate(kProcessSampleRates[l]);
+ test->set_use_aec_extended_filter(false);
}
}
}
+#if defined(WEBRTC_AUDIOPROC_FLOAT_PROFILE)
+ // To test the extended filter mode.
+ audioproc::Test* test = ref_data.add_test();
+ test->set_num_reverse_channels(2);
+ test->set_num_input_channels(2);
+ test->set_num_output_channels(2);
+ test->set_sample_rate(AudioProcessing::kSampleRate32kHz);
+ test->set_use_aec_extended_filter(true);
+#endif
}
- EnableAllComponents();
-
for (int i = 0; i < ref_data.test_size(); i++) {
printf("Running test %d of %d...\n", i + 1, ref_data.test_size());
@@ -1931,6 +1945,14 @@
if (test->num_input_channels() != test->num_output_channels())
continue;
+ Config config;
+ config.Set<ExperimentalAgc>(new ExperimentalAgc(false));
+ config.Set<DelayCorrection>(
+ new DelayCorrection(test->use_aec_extended_filter()));
+ apm_.reset(AudioProcessing::Create(config));
+
+ EnableAllComponents();
+
Init(test->sample_rate(),
test->sample_rate(),
test->sample_rate(),
diff --git a/modules/audio_processing/test/unittest.proto b/modules/audio_processing/test/unittest.proto
index 09ec942..47b962b 100644
--- a/modules/audio_processing/test/unittest.proto
+++ b/modules/audio_processing/test/unittest.proto
@@ -47,6 +47,7 @@
optional float ns_speech_probability_average = 14;
+ optional bool use_aec_extended_filter = 15;
}
message OutputData {