peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_GAIN_H_ |
| 12 | #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_GAIN_H_ |
| 13 | |
| 14 | #include <array> |
peah | 86afe9d | 2017-04-06 15:45:32 -0700 | [diff] [blame] | 15 | #include <vector> |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 16 | |
| 17 | #include "webrtc/base/constructormagic.h" |
| 18 | #include "webrtc/modules/audio_processing/aec3/aec3_common.h" |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 19 | |
| 20 | namespace webrtc { |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 21 | |
| 22 | class SuppressionGain { |
| 23 | public: |
| 24 | explicit SuppressionGain(Aec3Optimization optimization); |
| 25 | void GetGain(const std::array<float, kFftLengthBy2Plus1>& nearend_power, |
| 26 | const std::array<float, kFftLengthBy2Plus1>& residual_echo_power, |
| 27 | const std::array<float, kFftLengthBy2Plus1>& comfort_noise_power, |
peah | 86afe9d | 2017-04-06 15:45:32 -0700 | [diff] [blame] | 28 | bool saturated_echo, |
| 29 | const std::vector<std::vector<float>>& render, |
| 30 | size_t num_capture_bands, |
peah | 6d822ad | 2017-04-10 13:52:14 -0700 | [diff] [blame] | 31 | bool force_zero_gain, |
peah | 86afe9d | 2017-04-06 15:45:32 -0700 | [diff] [blame] | 32 | float* high_bands_gain, |
| 33 | std::array<float, kFftLengthBy2Plus1>* low_band_gain); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 34 | |
| 35 | private: |
| 36 | const Aec3Optimization optimization_; |
| 37 | std::array<float, kFftLengthBy2 - 1> previous_gain_squared_; |
| 38 | std::array<float, kFftLengthBy2 - 1> previous_masker_; |
| 39 | RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SuppressionGain); |
| 40 | }; |
| 41 | |
| 42 | } // namespace webrtc |
| 43 | |
| 44 | #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_GAIN_H_ |