Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 #include "webrtc/modules/audio_processing/audio_processing_impl.h" | 10 #include "webrtc/modules/audio_processing/audio_processing_impl.h" |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 #include "webrtc/base/random.h" | 22 #include "webrtc/base/random.h" |
| 23 #include "webrtc/base/safe_conversions.h" | 23 #include "webrtc/base/safe_conversions.h" |
| 24 #include "webrtc/config.h" | 24 #include "webrtc/config.h" |
| 25 #include "webrtc/modules/audio_processing/test/test_utils.h" | 25 #include "webrtc/modules/audio_processing/test/test_utils.h" |
| 26 #include "webrtc/modules/include/module_common_types.h" | 26 #include "webrtc/modules/include/module_common_types.h" |
| 27 #include "webrtc/system_wrappers/include/clock.h" | 27 #include "webrtc/system_wrappers/include/clock.h" |
| 28 #include "webrtc/system_wrappers/include/event_wrapper.h" | 28 #include "webrtc/system_wrappers/include/event_wrapper.h" |
| 29 #include "webrtc/system_wrappers/include/sleep.h" | 29 #include "webrtc/system_wrappers/include/sleep.h" |
| 30 #include "webrtc/test/testsupport/perf_test.h" | 30 #include "webrtc/test/testsupport/perf_test.h" |
| 31 | 31 |
| 32 // Check to verify that the define for the intelligibility enhancer is properly | |
| 33 // set. | |
| 34 #if !defined(WEBRTC_INTELLIGIBILITY_ENHANCER) || \ | |
| 35 (WEBRTC_INTELLIGIBILITY_ENHANCER != 0 && \ | |
| 36 WEBRTC_INTELLIGIBILITY_ENHANCER != 1) | |
| 37 #error "Set WEBRTC_INTELLIGIBILITY_ENHANCER to either 0 or 1" | |
| 38 #endif | |
| 39 | |
| 32 namespace webrtc { | 40 namespace webrtc { |
| 33 | 41 |
| 34 namespace { | 42 namespace { |
| 35 | 43 |
| 36 static const bool kPrintAllDurations = false; | 44 static const bool kPrintAllDurations = false; |
| 37 | 45 |
| 38 class CallSimulator; | 46 class CallSimulator; |
| 39 | 47 |
| 40 // Type of the render thread APM API call to use in the test. | 48 // Type of the render thread APM API call to use in the test. |
| 41 enum class ProcessorType { kRender, kCapture }; | 49 enum class ProcessorType { kRender, kCapture }; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 SettingsType::kDefaultApmDesktopWithoutExtendedFilter}; | 97 SettingsType::kDefaultApmDesktopWithoutExtendedFilter}; |
| 90 | 98 |
| 91 const int desktop_sample_rates[] = {8000, 16000, 32000, 48000}; | 99 const int desktop_sample_rates[] = {8000, 16000, 32000, 48000}; |
| 92 | 100 |
| 93 for (auto sample_rate : desktop_sample_rates) { | 101 for (auto sample_rate : desktop_sample_rates) { |
| 94 for (auto settings : desktop_settings) { | 102 for (auto settings : desktop_settings) { |
| 95 simulation_configs.push_back(SimulationConfig(sample_rate, settings)); | 103 simulation_configs.push_back(SimulationConfig(sample_rate, settings)); |
| 96 } | 104 } |
| 97 } | 105 } |
| 98 | 106 |
| 107 #if (WEBRTC_INTELLIGIBILITY_ENHANCER == 1) | |
|
kwiberg-webrtc
2016/09/13 10:09:43
No parentheses needed.
peah-webrtc
2016/09/13 12:46:49
Done.
| |
| 99 const SettingsType intelligibility_enhancer_settings[] = { | 108 const SettingsType intelligibility_enhancer_settings[] = { |
| 100 SettingsType::kDefaultApmDesktopAndIntelligibilityEnhancer}; | 109 SettingsType::kDefaultApmDesktopAndIntelligibilityEnhancer}; |
| 101 | 110 |
| 102 const int intelligibility_enhancer_sample_rates[] = {8000, 16000, 32000, | 111 const int intelligibility_enhancer_sample_rates[] = {8000, 16000, 32000, |
| 103 48000}; | 112 48000}; |
| 104 | 113 |
| 105 for (auto sample_rate : intelligibility_enhancer_sample_rates) { | 114 for (auto sample_rate : intelligibility_enhancer_sample_rates) { |
| 106 for (auto settings : intelligibility_enhancer_settings) { | 115 for (auto settings : intelligibility_enhancer_settings) { |
| 107 simulation_configs.push_back(SimulationConfig(sample_rate, settings)); | 116 simulation_configs.push_back(SimulationConfig(sample_rate, settings)); |
| 108 } | 117 } |
| 109 } | 118 } |
| 119 #endif | |
| 110 | 120 |
| 111 const SettingsType beamformer_settings[] = { | 121 const SettingsType beamformer_settings[] = { |
| 112 SettingsType::kDefaultApmDesktopAndBeamformer}; | 122 SettingsType::kDefaultApmDesktopAndBeamformer}; |
| 113 | 123 |
| 114 const int beamformer_sample_rates[] = {8000, 16000, 32000, 48000}; | 124 const int beamformer_sample_rates[] = {8000, 16000, 32000, 48000}; |
| 115 | 125 |
| 116 for (auto sample_rate : beamformer_sample_rates) { | 126 for (auto sample_rate : beamformer_sample_rates) { |
| 117 for (auto settings : beamformer_settings) { | 127 for (auto settings : beamformer_settings) { |
| 118 simulation_configs.push_back(SimulationConfig(sample_rate, settings)); | 128 simulation_configs.push_back(SimulationConfig(sample_rate, settings)); |
| 119 } | 129 } |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 708 // Run test and verify that it did not time out. | 718 // Run test and verify that it did not time out. |
| 709 EXPECT_EQ(kEventSignaled, Run()); | 719 EXPECT_EQ(kEventSignaled, Run()); |
| 710 } | 720 } |
| 711 | 721 |
| 712 INSTANTIATE_TEST_CASE_P( | 722 INSTANTIATE_TEST_CASE_P( |
| 713 AudioProcessingPerformanceTest, | 723 AudioProcessingPerformanceTest, |
| 714 CallSimulator, | 724 CallSimulator, |
| 715 ::testing::ValuesIn(SimulationConfig::GenerateSimulationConfigs())); | 725 ::testing::ValuesIn(SimulationConfig::GenerateSimulationConfigs())); |
| 716 | 726 |
| 717 } // namespace webrtc | 727 } // namespace webrtc |
| OLD | NEW |