Skip to content

Commit

Permalink
Add case to ApmTest.Process to test the extended filter mode
Browse files Browse the repository at this point in the history
R=andrew@webrtc.org, bjornv@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/40509004

Cr-Commit-Position: refs/heads/master@{#8192}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8192 4adac7df-926f-26a2-2b94-8c16560cd09d
  • Loading branch information
aluebs@webrtc.org committed Jan 29, 2015
1 parent e7a4a12 commit f17ee9c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
Binary file modified data/audio_processing/output_data_fixed.pb
Binary file not shown.
Binary file modified data/audio_processing/output_data_float.pb
Binary file not shown.
Binary file added data/audio_processing/output_data_mac.pb
Binary file not shown.
26 changes: 24 additions & 2 deletions webrtc/modules/audio_processing/test/audio_processing_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,13 @@ ApmTest::ApmTest()
#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),
Expand Down Expand Up @@ -1915,13 +1921,21 @@ TEST_F(ApmTest, Process) {
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());

Expand All @@ -1931,6 +1945,14 @@ TEST_F(ApmTest, Process) {
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(),
Expand Down
1 change: 1 addition & 0 deletions webrtc/modules/audio_processing/test/unittest.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ message Test {

optional float ns_speech_probability_average = 14;

optional bool use_aec_extended_filter = 15;
}

message OutputData {
Expand Down

0 comments on commit f17ee9c

Please sign in to comment.