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/adaptive_fir_filter.h" | 11 #include "webrtc/modules/audio_processing/aec3/adaptive_fir_filter.h" |
12 | 12 |
13 #include <math.h> | 13 #include <math.h> |
14 #include <algorithm> | 14 #include <algorithm> |
15 #include <numeric> | 15 #include <numeric> |
16 #include <string> | 16 #include <string> |
17 #include "webrtc/typedefs.h" | 17 #include "webrtc/typedefs.h" |
18 #if defined(WEBRTC_ARCH_X86_FAMILY) | 18 #if defined(WEBRTC_ARCH_X86_FAMILY) |
19 #include <emmintrin.h> | 19 #include <emmintrin.h> |
20 #endif | 20 #endif |
21 #include "webrtc/base/arraysize.h" | |
22 #include "webrtc/base/random.h" | |
23 #include "webrtc/base/safe_minmax.h" | |
24 #include "webrtc/modules/audio_processing/aec3/aec3_fft.h" | 21 #include "webrtc/modules/audio_processing/aec3/aec3_fft.h" |
25 #include "webrtc/modules/audio_processing/aec3/aec_state.h" | 22 #include "webrtc/modules/audio_processing/aec3/aec_state.h" |
26 #include "webrtc/modules/audio_processing/aec3/cascaded_biquad_filter.h" | 23 #include "webrtc/modules/audio_processing/aec3/cascaded_biquad_filter.h" |
27 #include "webrtc/modules/audio_processing/aec3/render_signal_analyzer.h" | 24 #include "webrtc/modules/audio_processing/aec3/render_signal_analyzer.h" |
28 #include "webrtc/modules/audio_processing/aec3/shadow_filter_update_gain.h" | 25 #include "webrtc/modules/audio_processing/aec3/shadow_filter_update_gain.h" |
29 #include "webrtc/modules/audio_processing/logging/apm_data_dumper.h" | 26 #include "webrtc/modules/audio_processing/logging/apm_data_dumper.h" |
30 #include "webrtc/modules/audio_processing/test/echo_canceller_test_tools.h" | 27 #include "webrtc/modules/audio_processing/test/echo_canceller_test_tools.h" |
| 28 #include "webrtc/rtc_base/arraysize.h" |
| 29 #include "webrtc/rtc_base/random.h" |
| 30 #include "webrtc/rtc_base/safe_minmax.h" |
31 #include "webrtc/system_wrappers/include/cpu_features_wrapper.h" | 31 #include "webrtc/system_wrappers/include/cpu_features_wrapper.h" |
32 #include "webrtc/test/gtest.h" | 32 #include "webrtc/test/gtest.h" |
33 | 33 |
34 namespace webrtc { | 34 namespace webrtc { |
35 namespace aec3 { | 35 namespace aec3 { |
36 namespace { | 36 namespace { |
37 | 37 |
38 std::string ProduceDebugText(size_t delay) { | 38 std::string ProduceDebugText(size_t delay) { |
39 std::ostringstream ss; | 39 std::ostringstream ss; |
40 ss << ", Delay: " << delay; | 40 ss << ", Delay: " << delay; |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 } | 365 } |
366 // Verify that the filter is able to perform well. | 366 // Verify that the filter is able to perform well. |
367 EXPECT_LT(1000 * std::inner_product(e.begin(), e.end(), e.begin(), 0.f), | 367 EXPECT_LT(1000 * std::inner_product(e.begin(), e.end(), e.begin(), 0.f), |
368 std::inner_product(y.begin(), y.end(), y.begin(), 0.f)); | 368 std::inner_product(y.begin(), y.end(), y.begin(), 0.f)); |
369 ASSERT_TRUE(aec_state.FilterDelay()); | 369 ASSERT_TRUE(aec_state.FilterDelay()); |
370 EXPECT_EQ(delay_samples / kBlockSize, *aec_state.FilterDelay()); | 370 EXPECT_EQ(delay_samples / kBlockSize, *aec_state.FilterDelay()); |
371 } | 371 } |
372 } | 372 } |
373 } // namespace aec3 | 373 } // namespace aec3 |
374 } // namespace webrtc | 374 } // namespace webrtc |
OLD | NEW |