| 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/typedefs.h" |
| 14 #if defined(WEBRTC_ARCH_X86_FAMILY) | 14 #if defined(WEBRTC_ARCH_X86_FAMILY) |
| 15 #include <emmintrin.h> | 15 #include <emmintrin.h> |
| 16 #endif | 16 #endif |
| 17 #include <math.h> | 17 #include <math.h> |
| 18 #include <algorithm> | 18 #include <algorithm> |
| 19 #include <functional> | 19 #include <functional> |
| 20 | 20 |
| 21 #include "webrtc/base/checks.h" |
| 22 |
| 21 namespace webrtc { | 23 namespace webrtc { |
| 22 namespace { | 24 namespace { |
| 23 | 25 |
| 24 void GainPostProcessing(std::array<float, kFftLengthBy2Plus1>* gain_squared) { | 26 void GainPostProcessing(std::array<float, kFftLengthBy2Plus1>* gain_squared) { |
| 25 // Limit the low frequency gains to avoid the impact of the high-pass filter | 27 // Limit the low frequency gains to avoid the impact of the high-pass filter |
| 26 // on the lower-frequency gain influencing the overall achieved gain. | 28 // on the lower-frequency gain influencing the overall achieved gain. |
| 27 (*gain_squared)[1] = std::min((*gain_squared)[1], (*gain_squared)[2]); | 29 (*gain_squared)[1] = std::min((*gain_squared)[1], (*gain_squared)[2]); |
| 28 (*gain_squared)[0] = (*gain_squared)[1]; | 30 (*gain_squared)[0] = (*gain_squared)[1]; |
| 29 | 31 |
| 30 // Limit the high frequency gains to avoid the impact of the anti-aliasing | 32 // Limit the high frequency gains to avoid the impact of the anti-aliasing |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 break; | 296 break; |
| 295 #endif | 297 #endif |
| 296 default: | 298 default: |
| 297 aec3::ComputeGains(nearend_power, residual_echo_power, | 299 aec3::ComputeGains(nearend_power, residual_echo_power, |
| 298 comfort_noise_power, strong_nearend_margin, | 300 comfort_noise_power, strong_nearend_margin, |
| 299 &previous_gain_squared_, &previous_masker_, gain); | 301 &previous_gain_squared_, &previous_masker_, gain); |
| 300 } | 302 } |
| 301 } | 303 } |
| 302 | 304 |
| 303 } // namespace webrtc | 305 } // namespace webrtc |
| OLD | NEW |