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 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_GAIN_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_GAIN_H_ |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_GAIN_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_GAIN_H_ |
13 | 13 |
14 #include <array> | 14 #include <array> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "webrtc/modules/audio_processing/aec3/aec3_common.h" | 17 #include "webrtc/modules/audio_processing/aec3/aec3_common.h" |
18 #include "webrtc/modules/audio_processing/aec3/render_signal_analyzer.h" | 18 #include "webrtc/modules/audio_processing/aec3/render_signal_analyzer.h" |
| 19 #include "webrtc/modules/audio_processing/include/audio_processing.h" |
19 #include "webrtc/rtc_base/constructormagic.h" | 20 #include "webrtc/rtc_base/constructormagic.h" |
20 | 21 |
21 namespace webrtc { | 22 namespace webrtc { |
22 | 23 |
23 class SuppressionGain { | 24 class SuppressionGain { |
24 public: | 25 public: |
25 explicit SuppressionGain(Aec3Optimization optimization); | 26 SuppressionGain(const AudioProcessing::Config::EchoCanceller3& config, |
| 27 Aec3Optimization optimization); |
26 void GetGain(const std::array<float, kFftLengthBy2Plus1>& nearend, | 28 void GetGain(const std::array<float, kFftLengthBy2Plus1>& nearend, |
27 const std::array<float, kFftLengthBy2Plus1>& echo, | 29 const std::array<float, kFftLengthBy2Plus1>& echo, |
28 const std::array<float, kFftLengthBy2Plus1>& comfort_noise, | 30 const std::array<float, kFftLengthBy2Plus1>& comfort_noise, |
29 const RenderSignalAnalyzer& render_signal_analyzer, | 31 const RenderSignalAnalyzer& render_signal_analyzer, |
30 bool saturated_echo, | 32 bool saturated_echo, |
31 const std::vector<std::vector<float>>& render, | 33 const std::vector<std::vector<float>>& render, |
32 bool force_zero_gain, | 34 bool force_zero_gain, |
33 float* high_bands_gain, | 35 float* high_bands_gain, |
34 std::array<float, kFftLengthBy2Plus1>* low_band_gain); | 36 std::array<float, kFftLengthBy2Plus1>* low_band_gain); |
35 | 37 |
(...skipping 15 matching lines...) Expand all Loading... |
51 }; | 53 }; |
52 | 54 |
53 const Aec3Optimization optimization_; | 55 const Aec3Optimization optimization_; |
54 std::array<float, kFftLengthBy2Plus1> last_gain_; | 56 std::array<float, kFftLengthBy2Plus1> last_gain_; |
55 std::array<float, kFftLengthBy2Plus1> last_masker_; | 57 std::array<float, kFftLengthBy2Plus1> last_masker_; |
56 std::array<float, kFftLengthBy2Plus1> gain_increase_; | 58 std::array<float, kFftLengthBy2Plus1> gain_increase_; |
57 std::array<float, kFftLengthBy2Plus1> last_echo_; | 59 std::array<float, kFftLengthBy2Plus1> last_echo_; |
58 | 60 |
59 LowNoiseRenderDetector low_render_detector_; | 61 LowNoiseRenderDetector low_render_detector_; |
60 size_t no_saturation_counter_ = 0; | 62 size_t no_saturation_counter_ = 0; |
61 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SuppressionGain); | 63 const AudioProcessing::Config::EchoCanceller3 config_; |
| 64 RTC_DISALLOW_COPY_AND_ASSIGN(SuppressionGain); |
62 }; | 65 }; |
63 | 66 |
64 } // namespace webrtc | 67 } // namespace webrtc |
65 | 68 |
66 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_GAIN_H_ | 69 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_GAIN_H_ |
OLD | NEW |