OLD | NEW |
(Empty) | |
| 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_MAIN_FILTER_UPDATE_GAIN_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_MAIN_FILTER_UPDATE_GAIN_H_ |
| 13 |
| 14 #include <memory> |
| 15 #include <vector> |
| 16 |
| 17 #include "webrtc/base/constructormagic.h" |
| 18 #include "webrtc/modules/audio_processing/aec3/adaptive_fir_filter.h" |
| 19 #include "webrtc/modules/audio_processing/aec3/aec3_common.h" |
| 20 #include "webrtc/modules/audio_processing/aec3/render_signal_analyzer.h" |
| 21 #include "webrtc/modules/audio_processing/aec3/subtractor_output.h" |
| 22 #include "webrtc/modules/audio_processing/aec3/fft_buffer.h" |
| 23 |
| 24 namespace webrtc { |
| 25 |
| 26 class ApmDataDumper; |
| 27 |
| 28 // Provides functionality for computing the adaptive gain for the main filter. |
| 29 class MainFilterUpdateGain { |
| 30 public: |
| 31 MainFilterUpdateGain(); |
| 32 ~MainFilterUpdateGain(); |
| 33 |
| 34 // Takes action in the case of a known echo path change. |
| 35 void HandleEchoPathChange(); |
| 36 |
| 37 // Computes the gain. |
| 38 void Compute(const FftBuffer& render_buffer, |
| 39 const RenderSignalAnalyzer& render_signal_analyzer, |
| 40 const SubtractorOutput& subtractor_output, |
| 41 const AdaptiveFirFilter& filter, |
| 42 bool saturated_capture_signal, |
| 43 FftData* gain_fft); |
| 44 |
| 45 private: |
| 46 static int instance_count_; |
| 47 std::unique_ptr<ApmDataDumper> data_dumper_; |
| 48 std::array<float, kFftLengthBy2Plus1> H_error_; |
| 49 size_t poor_excitation_counter_; |
| 50 size_t call_counter_ = 0; |
| 51 RTC_DISALLOW_COPY_AND_ASSIGN(MainFilterUpdateGain); |
| 52 }; |
| 53 |
| 54 } // namespace webrtc |
| 55 |
| 56 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_MAIN_FILTER_UPDATE_GAIN_H_ |
OLD | NEW |