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/residual_echo_estimator.h" | 11 #include "webrtc/modules/audio_processing/aec3/residual_echo_estimator.h" |
12 | 12 |
| 13 #include "webrtc/base/random.h" |
| 14 #include "webrtc/modules/audio_processing/aec3/aec_state.h" |
13 #include "webrtc/modules/audio_processing/aec3/aec3_fft.h" | 15 #include "webrtc/modules/audio_processing/aec3/aec3_fft.h" |
14 #include "webrtc/modules/audio_processing/aec3/aec_state.h" | |
15 #include "webrtc/modules/audio_processing/test/echo_canceller_test_tools.h" | 16 #include "webrtc/modules/audio_processing/test/echo_canceller_test_tools.h" |
16 #include "webrtc/rtc_base/random.h" | |
17 #include "webrtc/test/gtest.h" | 17 #include "webrtc/test/gtest.h" |
18 | 18 |
19 namespace webrtc { | 19 namespace webrtc { |
20 | 20 |
21 #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) | 21 #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) |
22 | 22 |
23 // Verifies that the check for non-null output residual echo power works. | 23 // Verifies that the check for non-null output residual echo power works. |
24 TEST(ResidualEchoEstimator, NullResidualEchoPowerOutput) { | 24 TEST(ResidualEchoEstimator, NullResidualEchoPowerOutput) { |
25 AecState aec_state(0.f); | 25 AecState aec_state(0.f); |
26 RenderBuffer render_buffer(Aec3Optimization::kNone, 3, 10, | 26 RenderBuffer render_buffer(Aec3Optimization::kNone, 3, 10, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 aec_state.Update(H2, rtc::Optional<size_t>(2), render_buffer, E2_main, Y2, | 77 aec_state.Update(H2, rtc::Optional<size_t>(2), render_buffer, E2_main, Y2, |
78 x[0], false); | 78 x[0], false); |
79 | 79 |
80 estimator.Estimate(true, aec_state, render_buffer, S2_linear, Y2, &R2); | 80 estimator.Estimate(true, aec_state, render_buffer, S2_linear, Y2, &R2); |
81 } | 81 } |
82 std::for_each(R2.begin(), R2.end(), | 82 std::for_each(R2.begin(), R2.end(), |
83 [&](float a) { EXPECT_NEAR(kLevel, a, 0.1f); }); | 83 [&](float a) { EXPECT_NEAR(kLevel, a, 0.1f); }); |
84 } | 84 } |
85 | 85 |
86 } // namespace webrtc | 86 } // namespace webrtc |
OLD | NEW |