| 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_AEC_STATE_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_AEC_STATE_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_AEC_STATE_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_AEC_STATE_H_ |
| 13 | 13 |
| 14 #include <algorithm> | 14 #include <algorithm> |
| 15 #include <memory> | 15 #include <memory> |
| 16 #include <vector> | 16 #include <vector> |
| 17 | 17 |
| 18 #include "webrtc/base/array_view.h" | 18 #include "webrtc/base/array_view.h" |
| 19 #include "webrtc/base/constructormagic.h" | 19 #include "webrtc/base/constructormagic.h" |
| 20 #include "webrtc/base/optional.h" | 20 #include "webrtc/base/optional.h" |
| 21 #include "webrtc/modules/audio_processing/aec3/aec3_common.h" | 21 #include "webrtc/modules/audio_processing/aec3/aec3_common.h" |
| 22 #include "webrtc/modules/audio_processing/aec3/echo_path_variability.h" | 22 #include "webrtc/modules/audio_processing/aec3/echo_path_variability.h" |
| 23 #include "webrtc/modules/audio_processing/aec3/erl_estimator.h" |
| 23 #include "webrtc/modules/audio_processing/aec3/erle_estimator.h" | 24 #include "webrtc/modules/audio_processing/aec3/erle_estimator.h" |
| 24 #include "webrtc/modules/audio_processing/aec3/erl_estimator.h" | 25 #include "webrtc/modules/audio_processing/aec3/render_buffer.h" |
| 25 #include "webrtc/modules/audio_processing/aec3/fft_buffer.h" | |
| 26 | 26 |
| 27 namespace webrtc { | 27 namespace webrtc { |
| 28 | 28 |
| 29 class ApmDataDumper; | 29 class ApmDataDumper; |
| 30 | 30 |
| 31 // Handles the state and the conditions for the echo removal functionality. | 31 // Handles the state and the conditions for the echo removal functionality. |
| 32 class AecState { | 32 class AecState { |
| 33 public: | 33 public: |
| 34 AecState(); | 34 AecState(); |
| 35 ~AecState(); | 35 ~AecState(); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 capture_signal_saturation_ = capture_signal_saturation; | 90 capture_signal_saturation_ = capture_signal_saturation; |
| 91 } | 91 } |
| 92 | 92 |
| 93 // Returns whether a probable headset setup has been detected. | 93 // Returns whether a probable headset setup has been detected. |
| 94 bool HeadsetDetected() const { return headset_detected_; } | 94 bool HeadsetDetected() const { return headset_detected_; } |
| 95 | 95 |
| 96 // Updates the aec state. | 96 // Updates the aec state. |
| 97 void Update(const std::vector<std::array<float, kFftLengthBy2Plus1>>& | 97 void Update(const std::vector<std::array<float, kFftLengthBy2Plus1>>& |
| 98 filter_frequency_response, | 98 filter_frequency_response, |
| 99 const rtc::Optional<size_t>& external_delay_samples, | 99 const rtc::Optional<size_t>& external_delay_samples, |
| 100 const FftBuffer& X_buffer, | 100 const RenderBuffer& X_buffer, |
| 101 const std::array<float, kFftLengthBy2Plus1>& E2_main, | 101 const std::array<float, kFftLengthBy2Plus1>& E2_main, |
| 102 const std::array<float, kFftLengthBy2Plus1>& E2_shadow, | 102 const std::array<float, kFftLengthBy2Plus1>& E2_shadow, |
| 103 const std::array<float, kFftLengthBy2Plus1>& Y2, | 103 const std::array<float, kFftLengthBy2Plus1>& Y2, |
| 104 rtc::ArrayView<const float> x, | 104 rtc::ArrayView<const float> x, |
| 105 const EchoPathVariability& echo_path_variability, | 105 const EchoPathVariability& echo_path_variability, |
| 106 bool echo_leakage_detected); | 106 bool echo_leakage_detected); |
| 107 | 107 |
| 108 private: | 108 private: |
| 109 static int instance_count_; | 109 static int instance_count_; |
| 110 std::unique_ptr<ApmDataDumper> data_dumper_; | 110 std::unique_ptr<ApmDataDumper> data_dumper_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 123 std::array<bool, kFftLengthBy2Plus1> bands_with_reliable_filter_; | 123 std::array<bool, kFftLengthBy2Plus1> bands_with_reliable_filter_; |
| 124 std::array<float, kFftLengthBy2Plus1> filter_estimate_strength_; | 124 std::array<float, kFftLengthBy2Plus1> filter_estimate_strength_; |
| 125 size_t filter_length_; | 125 size_t filter_length_; |
| 126 | 126 |
| 127 RTC_DISALLOW_COPY_AND_ASSIGN(AecState); | 127 RTC_DISALLOW_COPY_AND_ASSIGN(AecState); |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 } // namespace webrtc | 130 } // namespace webrtc |
| 131 | 131 |
| 132 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_AEC_STATE_H_ | 132 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_AEC_STATE_H_ |
| OLD | NEW |