OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 int sample_rates_to_test[] = { | 177 int sample_rates_to_test[] = { |
178 AudioProcessing::kSampleRate8kHz, AudioProcessing::kSampleRate16kHz, | 178 AudioProcessing::kSampleRate8kHz, AudioProcessing::kSampleRate16kHz, |
179 AudioProcessing::kSampleRate32kHz, AudioProcessing::kSampleRate48kHz}; | 179 AudioProcessing::kSampleRate32kHz, AudioProcessing::kSampleRate48kHz}; |
180 for (auto sample_rate : sample_rates_to_test) { | 180 for (auto sample_rate : sample_rates_to_test) { |
181 for (size_t num_channels = 1; num_channels <= 2; ++num_channels) { | 181 for (size_t num_channels = 1; num_channels <= 2; ++num_channels) { |
182 RunStandaloneSubmodule(sample_rate, num_channels); | 182 RunStandaloneSubmodule(sample_rate, num_channels); |
183 } | 183 } |
184 } | 184 } |
185 } | 185 } |
186 | 186 |
| 187 void TestSomeSampleRatesWithApm(const std::string& test_name, |
| 188 bool use_mobile_agc, |
| 189 bool include_default_apm_processing) { |
| 190 // Test some stereo combinations first. |
| 191 size_t num_channels = 2; |
| 192 RunTogetherWithApm(test_name, 48000, 48000, AudioProcessing::kSampleRate8kHz, |
| 193 AudioProcessing::kSampleRate48kHz, num_channels, |
| 194 use_mobile_agc, include_default_apm_processing); |
| 195 RunTogetherWithApm(test_name, 48000, 48000, AudioProcessing::kSampleRate16kHz, |
| 196 AudioProcessing::kSampleRate32kHz, num_channels, |
| 197 use_mobile_agc, include_default_apm_processing); |
| 198 RunTogetherWithApm(test_name, 48000, 48000, AudioProcessing::kSampleRate32kHz, |
| 199 AudioProcessing::kSampleRate16kHz, num_channels, |
| 200 use_mobile_agc, include_default_apm_processing); |
| 201 RunTogetherWithApm(test_name, 48000, 48000, AudioProcessing::kSampleRate48kHz, |
| 202 AudioProcessing::kSampleRate8kHz, num_channels, |
| 203 use_mobile_agc, include_default_apm_processing); |
| 204 RunTogetherWithApm(test_name, 48000, 48000, 44100, 44100, num_channels, |
| 205 use_mobile_agc, include_default_apm_processing); |
| 206 |
| 207 // Then test mono combinations. |
| 208 num_channels = 1; |
| 209 RunTogetherWithApm(test_name, 48000, 48000, AudioProcessing::kSampleRate48kHz, |
| 210 AudioProcessing::kSampleRate48kHz, num_channels, |
| 211 use_mobile_agc, include_default_apm_processing); |
| 212 } |
| 213 |
187 #if !defined(WEBRTC_ANDROID) | 214 #if !defined(WEBRTC_ANDROID) |
188 TEST(LevelControllerPerformanceTest, ProcessingViaApm) { | 215 TEST(LevelControllerPerformanceTest, ProcessingViaApm) { |
189 #else | 216 #else |
190 TEST(LevelControllerPerformanceTest, DISABLED_ProcessingViaApm) { | 217 TEST(LevelControllerPerformanceTest, DISABLED_ProcessingViaApm) { |
191 #endif | 218 #endif |
192 int sample_rates_to_test[] = {AudioProcessing::kSampleRate8kHz, | 219 // Run without default APM processing and desktop AGC. |
193 AudioProcessing::kSampleRate16kHz, | 220 TestSomeSampleRatesWithApm("SimpleLevelControlViaApm", false, false); |
194 AudioProcessing::kSampleRate32kHz, | |
195 AudioProcessing::kSampleRate48kHz, 44100}; | |
196 for (auto capture_input_sample_rate_hz : sample_rates_to_test) { | |
197 for (auto capture_output_sample_rate_hz : sample_rates_to_test) { | |
198 for (size_t num_channels = 1; num_channels <= 2; ++num_channels) { | |
199 RunTogetherWithApm("SimpleLevelControlViaApm", 48000, 48000, | |
200 capture_input_sample_rate_hz, | |
201 capture_output_sample_rate_hz, num_channels, false, | |
202 false); | |
203 } | |
204 } | |
205 } | |
206 } | 221 } |
207 | 222 |
208 #if !defined(WEBRTC_ANDROID) | 223 #if !defined(WEBRTC_ANDROID) |
209 TEST(LevelControllerPerformanceTest, InteractionWithDefaultApm) { | 224 TEST(LevelControllerPerformanceTest, InteractionWithDefaultApm) { |
210 #else | 225 #else |
211 TEST(LevelControllerPerformanceTest, DISABLED_InteractionWithDefaultApm) { | 226 TEST(LevelControllerPerformanceTest, DISABLED_InteractionWithDefaultApm) { |
212 #endif | 227 #endif |
213 int sample_rates_to_test[] = {AudioProcessing::kSampleRate8kHz, | 228 bool include_default_apm_processing = true; |
214 AudioProcessing::kSampleRate16kHz, | 229 TestSomeSampleRatesWithApm("LevelControlAndDefaultDesktopApm", false, |
215 AudioProcessing::kSampleRate32kHz, | 230 include_default_apm_processing); |
216 AudioProcessing::kSampleRate48kHz, 44100}; | 231 TestSomeSampleRatesWithApm("LevelControlAndDefaultMobileApm", true, |
217 for (auto capture_input_sample_rate_hz : sample_rates_to_test) { | 232 include_default_apm_processing); |
218 for (auto capture_output_sample_rate_hz : sample_rates_to_test) { | |
219 for (size_t num_channels = 1; num_channels <= 2; ++num_channels) { | |
220 RunTogetherWithApm("LevelControlAndDefaultDesktopApm", 48000, 48000, | |
221 capture_input_sample_rate_hz, | |
222 capture_output_sample_rate_hz, num_channels, false, | |
223 true); | |
224 RunTogetherWithApm("LevelControlAndDefaultMobileApm", 48000, 48000, | |
225 capture_input_sample_rate_hz, | |
226 capture_output_sample_rate_hz, num_channels, true, | |
227 true); | |
228 } | |
229 } | |
230 } | |
231 } | 233 } |
232 | 234 |
233 } // namespace webrtc | 235 } // namespace webrtc |
OLD | NEW |