Index: webrtc/modules/audio_processing/aec3/residual_echo_estimator.h |
diff --git a/webrtc/modules/audio_processing/aec3/residual_echo_estimator.h b/webrtc/modules/audio_processing/aec3/residual_echo_estimator.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6c59f434b971a63116754279f66efe013090a520 |
--- /dev/null |
+++ b/webrtc/modules/audio_processing/aec3/residual_echo_estimator.h |
@@ -0,0 +1,52 @@ |
+/* |
+ * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
+ * |
+ * Use of this source code is governed by a BSD-style license |
+ * that can be found in the LICENSE file in the root of the source |
+ * tree. An additional intellectual property rights grant can be found |
+ * in the file PATENTS. All contributing project authors may |
+ * be found in the AUTHORS file in the root of the source tree. |
+ */ |
+ |
+#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_RESIDUAL_ECHO_ESTIMATOR_H_ |
+#define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_RESIDUAL_ECHO_ESTIMATOR_H_ |
+ |
+#include <algorithm> |
+#include <array> |
+#include <vector> |
+ |
+#include "webrtc/base/array_view.h" |
+#include "webrtc/base/constructormagic.h" |
+#include "webrtc/modules/audio_processing/aec3/aec3_common.h" |
+#include "webrtc/modules/audio_processing/aec3/aec_state.h" |
+#include "webrtc/modules/audio_processing/aec3/fft_buffer.h" |
+ |
+namespace webrtc { |
+ |
+class ResidualEchoEstimator { |
+ public: |
+ ResidualEchoEstimator(); |
+ ~ResidualEchoEstimator(); |
+ |
+ void Estimate(bool using_subtractor_output, |
+ const AecState& aec_state, |
+ const FftBuffer& X_buffer, |
+ const std::vector<std::array<float, kFftLengthBy2Plus1>>& H2, |
+ const std::array<float, kFftLengthBy2Plus1>& E2_main, |
+ const std::array<float, kFftLengthBy2Plus1>& E2_shadow, |
+ const std::array<float, kFftLengthBy2Plus1>& S2_linear, |
+ const std::array<float, kFftLengthBy2Plus1>& S2_fallback, |
+ const std::array<float, kFftLengthBy2Plus1>& Y2, |
+ std::array<float, kFftLengthBy2Plus1>* R2); |
+ |
+ private: |
+ std::array<float, kFftLengthBy2Plus1> echo_path_gain_; |
+ size_t active_render_counter_ = 0; |
+ size_t blocks_since_last_saturation_ = 1000; |
+ |
+ RTC_DISALLOW_COPY_AND_ASSIGN(ResidualEchoEstimator); |
+}; |
+ |
+} // namespace webrtc |
+ |
+#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_RESIDUAL_ECHO_ESTIMATOR_H_ |