OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 |
11 #include "webrtc/modules/audio_processing/aec3/main_filter_update_gain.h" | 11 #include "webrtc/modules/audio_processing/aec3/main_filter_update_gain.h" |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
14 #include <numeric> | 14 #include <numeric> |
15 #include <string> | 15 #include <string> |
16 | 16 |
| 17 #include "webrtc/base/random.h" |
| 18 #include "webrtc/base/safe_minmax.h" |
17 #include "webrtc/modules/audio_processing/aec3/adaptive_fir_filter.h" | 19 #include "webrtc/modules/audio_processing/aec3/adaptive_fir_filter.h" |
18 #include "webrtc/modules/audio_processing/aec3/aec_state.h" | 20 #include "webrtc/modules/audio_processing/aec3/aec_state.h" |
19 #include "webrtc/modules/audio_processing/aec3/render_buffer.h" | 21 #include "webrtc/modules/audio_processing/aec3/render_buffer.h" |
20 #include "webrtc/modules/audio_processing/aec3/render_signal_analyzer.h" | 22 #include "webrtc/modules/audio_processing/aec3/render_signal_analyzer.h" |
21 #include "webrtc/modules/audio_processing/aec3/shadow_filter_update_gain.h" | 23 #include "webrtc/modules/audio_processing/aec3/shadow_filter_update_gain.h" |
22 #include "webrtc/modules/audio_processing/aec3/subtractor_output.h" | 24 #include "webrtc/modules/audio_processing/aec3/subtractor_output.h" |
23 #include "webrtc/modules/audio_processing/logging/apm_data_dumper.h" | 25 #include "webrtc/modules/audio_processing/logging/apm_data_dumper.h" |
24 #include "webrtc/modules/audio_processing/test/echo_canceller_test_tools.h" | 26 #include "webrtc/modules/audio_processing/test/echo_canceller_test_tools.h" |
25 #include "webrtc/rtc_base/random.h" | |
26 #include "webrtc/rtc_base/safe_minmax.h" | |
27 #include "webrtc/test/gtest.h" | 27 #include "webrtc/test/gtest.h" |
28 | 28 |
29 namespace webrtc { | 29 namespace webrtc { |
30 namespace { | 30 namespace { |
31 | 31 |
32 // Method for performing the simulations needed to test the main filter update | 32 // Method for performing the simulations needed to test the main filter update |
33 // gain functionality. | 33 // gain functionality. |
34 void RunFilterUpdateTest(int num_blocks_to_process, | 34 void RunFilterUpdateTest(int num_blocks_to_process, |
35 size_t delay_samples, | 35 size_t delay_samples, |
36 const std::vector<int>& blocks_with_echo_path_changes, | 36 const std::vector<int>& blocks_with_echo_path_changes, |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 blocks_with_saturation, false, &e, &y, &G_b); | 278 blocks_with_saturation, false, &e, &y, &G_b); |
279 | 279 |
280 G_a.Spectrum(Aec3Optimization::kNone, &G_a_power); | 280 G_a.Spectrum(Aec3Optimization::kNone, &G_a_power); |
281 G_b.Spectrum(Aec3Optimization::kNone, &G_b_power); | 281 G_b.Spectrum(Aec3Optimization::kNone, &G_b_power); |
282 | 282 |
283 EXPECT_LT(std::accumulate(G_a_power.begin(), G_a_power.end(), 0.), | 283 EXPECT_LT(std::accumulate(G_a_power.begin(), G_a_power.end(), 0.), |
284 std::accumulate(G_b_power.begin(), G_b_power.end(), 0.)); | 284 std::accumulate(G_b_power.begin(), G_b_power.end(), 0.)); |
285 } | 285 } |
286 | 286 |
287 } // namespace webrtc | 287 } // namespace webrtc |
OLD | NEW |