| 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/suppression_gain.h" | 11 #include "webrtc/modules/audio_processing/aec3/suppression_gain.h" |
| 12 | 12 |
| 13 #include "webrtc/typedefs.h" | 13 #include "webrtc/base/checks.h" |
| 14 #include "webrtc/system_wrappers/include/cpu_features_wrapper.h" | 14 #include "webrtc/system_wrappers/include/cpu_features_wrapper.h" |
| 15 #include "webrtc/test/gtest.h" | 15 #include "webrtc/test/gtest.h" |
| 16 #include "webrtc/typedefs.h" |
| 16 | 17 |
| 17 namespace webrtc { | 18 namespace webrtc { |
| 18 namespace aec3 { | 19 namespace aec3 { |
| 19 | 20 |
| 20 #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) |
| 21 | 22 |
| 22 // Verifies that the check for non-null output gains works. | 23 // Verifies that the check for non-null output gains works. |
| 23 TEST(SuppressionGain, NullOutputGains) { | 24 TEST(SuppressionGain, NullOutputGains) { |
| 24 std::array<float, kFftLengthBy2Plus1> E2; | 25 std::array<float, kFftLengthBy2Plus1> E2; |
| 25 std::array<float, kFftLengthBy2Plus1> R2; | 26 std::array<float, kFftLengthBy2Plus1> R2; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 N2.fill(0.f); | 140 N2.fill(0.f); |
| 140 for (int k = 0; k < 10; ++k) { | 141 for (int k = 0; k < 10; ++k) { |
| 141 suppression_gain.GetGain(E2, R2, N2, 0.1f, &g); | 142 suppression_gain.GetGain(E2, R2, N2, 0.1f, &g); |
| 142 } | 143 } |
| 143 std::for_each(g.begin(), g.end(), | 144 std::for_each(g.begin(), g.end(), |
| 144 [](float a) { EXPECT_NEAR(0.f, a, 0.001); }); | 145 [](float a) { EXPECT_NEAR(0.f, a, 0.001); }); |
| 145 } | 146 } |
| 146 | 147 |
| 147 } // namespace aec3 | 148 } // namespace aec3 |
| 148 } // namespace webrtc | 149 } // namespace webrtc |
| OLD | NEW |