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_FILTER_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_FILTER_H_ |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_FILTER_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_FILTER_H_ |
13 | 13 |
14 #include <array> | 14 #include <array> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "webrtc/base/constructormagic.h" | |
18 #include "webrtc/modules/audio_processing/aec3/aec3_common.h" | 17 #include "webrtc/modules/audio_processing/aec3/aec3_common.h" |
19 #include "webrtc/modules/audio_processing/aec3/aec3_fft.h" | 18 #include "webrtc/modules/audio_processing/aec3/aec3_fft.h" |
| 19 #include "webrtc/rtc_base/constructormagic.h" |
20 | 20 |
21 namespace webrtc { | 21 namespace webrtc { |
22 | 22 |
23 class SuppressionFilter { | 23 class SuppressionFilter { |
24 public: | 24 public: |
25 explicit SuppressionFilter(int sample_rate_hz); | 25 explicit SuppressionFilter(int sample_rate_hz); |
26 ~SuppressionFilter(); | 26 ~SuppressionFilter(); |
27 void ApplyGain(const FftData& comfort_noise, | 27 void ApplyGain(const FftData& comfort_noise, |
28 const FftData& comfort_noise_high_bands, | 28 const FftData& comfort_noise_high_bands, |
29 const std::array<float, kFftLengthBy2Plus1>& suppression_gain, | 29 const std::array<float, kFftLengthBy2Plus1>& suppression_gain, |
30 float high_bands_gain, | 30 float high_bands_gain, |
31 std::vector<std::vector<float>>* e); | 31 std::vector<std::vector<float>>* e); |
32 | 32 |
33 private: | 33 private: |
34 const int sample_rate_hz_; | 34 const int sample_rate_hz_; |
35 const OouraFft ooura_fft_; | 35 const OouraFft ooura_fft_; |
36 const Aec3Fft fft_; | 36 const Aec3Fft fft_; |
37 std::array<float, kFftLengthBy2> e_input_old_; | 37 std::array<float, kFftLengthBy2> e_input_old_; |
38 std::vector<std::array<float, kFftLengthBy2>> e_output_old_; | 38 std::vector<std::array<float, kFftLengthBy2>> e_output_old_; |
39 RTC_DISALLOW_COPY_AND_ASSIGN(SuppressionFilter); | 39 RTC_DISALLOW_COPY_AND_ASSIGN(SuppressionFilter); |
40 }; | 40 }; |
41 | 41 |
42 } // namespace webrtc | 42 } // namespace webrtc |
43 | 43 |
44 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_FILTER_H_ | 44 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_FILTER_H_ |
OLD | NEW |