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

Unified Diff: third_party/WebKit/Source/modules/webaudio/IIRDSPKernel.h

Issue 1361233004: Implement IIRFilter node for WebAudio. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix global-interface-listing Created 4 years, 11 months 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: third_party/WebKit/Source/modules/webaudio/IIRDSPKernel.h
diff --git a/third_party/WebKit/Source/modules/webaudio/IIRDSPKernel.h b/third_party/WebKit/Source/modules/webaudio/IIRDSPKernel.h
new file mode 100644
index 0000000000000000000000000000000000000000..0559e61f7627e0a6583e657e58e269009584cafa
--- /dev/null
+++ b/third_party/WebKit/Source/modules/webaudio/IIRDSPKernel.h
@@ -0,0 +1,41 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
haraken 2016/01/13 02:42:15 2016
Raymond Toy 2016/01/13 18:30:53 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IIRDSPKernel_h
+#define IIRDSPKernel_h
+
+#include "modules/webaudio/IIRProcessor.h"
+#include "platform/audio/AudioDSPKernel.h"
+#include "platform/audio/IIRFilter.h"
+
+namespace blink {
+
+class IIRProcessor;
+
+class IIRDSPKernel final : public AudioDSPKernel {
+public:
+ explicit IIRDSPKernel(IIRProcessor* processor)
+ : AudioDSPKernel(processor)
+ , m_iir(processor->feedforward(), processor->feedback())
+ {
+ }
+
+ // AudioDSPKernel
+ void process(const float* source, float* dest, size_t framesToProcess) override;
+ void reset() override { m_iir.reset(); }
+
+ // Get the magnitude and phase response of the filter at the given
+ // set of frequencies (in Hz). The phase response is in radians.
+ void getFrequencyResponse(int nFrequencies, const float* frequencyHz, float* magResponse, float* phaseResponse);
+
+ double tailTime() const override;
+ double latencyTime() const override;
+
+protected:
+ IIRFilter m_iir;
+};
+
+} // blink
tkent 2016/01/13 03:28:28 nit: blink -> namespace blink
Raymond Toy 2016/01/13 18:30:53 Done.
+
+#endif // IIRDSPKernel_h

Powered by Google App Engine
This is Rietveld 408576698