Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Unified Diff: webrtc/modules/audio_processing/aec3/cascaded_biquad_filter.h

Issue 2584493002: Added first layer of the echo canceller 3 functionality (Closed)
Patch Set: Restricted the AnalyzeRender access, added ability to add external reporting of echo failure, and o… Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/aec3/cascaded_biquad_filter.h
diff --git a/webrtc/modules/audio_processing/aec3/cascaded_biquad_filter.h b/webrtc/modules/audio_processing/aec3/cascaded_biquad_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..0f587f5913b5f01eeaa92473c7dc8ffa26f7f397
--- /dev/null
+++ b/webrtc/modules/audio_processing/aec3/cascaded_biquad_filter.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2016 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_CASCADED_BIQUAD_FILTER_H_
+#define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_CASCADED_BIQUAD_FILTER_H_
+
+#include <vector>
+
+#include "webrtc/base/array_view.h"
+#include "webrtc/base/constructormagic.h"
+
+namespace webrtc {
+
+class CascadedBiQuadFilter {
hlundin-webrtc 2016/12/16 10:04:46 Short comment for the class. Cascades a number of
ivoc 2016/12/19 11:30:22 It would also be nice to make a note of which form
peah-webrtc 2016/12/20 10:10:25 Done.
peah-webrtc 2016/12/20 10:10:25 Done.
+ public:
+ struct BiQuadState {
ivoc 2016/12/19 11:30:22 I think you can consider restructuring this a litt
peah-webrtc 2016/12/20 10:10:24 It would be nicer code-wise but I prefer to have i
ivoc 2016/12/21 13:04:04 Ok, that makes sense, let's leave it like this.
peah-webrtc 2016/12/21 23:13:48 Acknowledged.
+ float b[2];
hlundin-webrtc 2016/12/16 10:04:46 Slightly confusing that both the state and the coe
peah-webrtc 2016/12/20 10:10:25 Agree. Done.
+ float a[2];
+ };
+
+ struct BiQuadCoefficients {
+ float b[3];
+ float a[2];
+ };
+
+ CascadedBiQuadFilter(
+ const CascadedBiQuadFilter::BiQuadCoefficients& coefficients,
+ size_t num_biquads);
+ ~CascadedBiQuadFilter();
+ void Process(rtc::ArrayView<const float> x, rtc::ArrayView<float> y);
hlundin-webrtc 2016/12/16 10:04:46 Comment on the Process methods, and how they diffe
peah-webrtc 2016/12/20 10:10:24 Done.
+ void Process(rtc::ArrayView<float> y);
+
+ private:
+ void ApplyBiQuad(rtc::ArrayView<const float> x,
+ rtc::ArrayView<float> y,
+ CascadedBiQuadFilter::BiQuadState* biquad_state);
+
+ const size_t num_biquads_;
ivoc 2016/12/19 11:30:22 I don't think this is used anywhere. Also, the siz
peah-webrtc 2016/12/20 10:10:25 Great find! Done.
+ std::vector<BiQuadState> biquad_states_;
+ BiQuadCoefficients coefficients_;
+
+ RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CascadedBiQuadFilter);
+};
+
+} // namespace webrtc
+
+#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_CASCADED_BIQUAD_FILTER_H_

Powered by Google App Engine
This is Rietveld 408576698