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

Side by Side Diff: third_party/WebKit/Source/platform/audio/IIRFilter.cpp

Issue 2700123003: DO NOT COMMIT: Results of running old (current) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/audio/IIRFilter.h" 5 #include "platform/audio/IIRFilter.h"
6 6
7 #include <complex>
7 #include "wtf/MathExtras.h" 8 #include "wtf/MathExtras.h"
8 #include <complex>
9 9
10 namespace blink { 10 namespace blink {
11 11
12 // The length of the memory buffers for the IIR filter. This MUST be a power of 12 // The length of the memory buffers for the IIR filter. This MUST be a power of
13 // two and must be greater than the possible length of the filter coefficients. 13 // two and must be greater than the possible length of the filter coefficients.
14 const int kBufferLength = 32; 14 const int kBufferLength = 32;
15 static_assert(kBufferLength >= IIRFilter::kMaxOrder + 1, 15 static_assert(kBufferLength >= IIRFilter::kMaxOrder + 1,
16 "Internal IIR buffer length must be greater than maximum IIR " 16 "Internal IIR buffer length must be greater than maximum IIR "
17 "Filter order."); 17 "Filter order.");
18 18
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 std::complex<double> denominator = 132 std::complex<double> denominator =
133 evaluatePolynomial(m_feedback->data(), zRecip, m_feedback->size() - 1); 133 evaluatePolynomial(m_feedback->data(), zRecip, m_feedback->size() - 1);
134 std::complex<double> response = numerator / denominator; 134 std::complex<double> response = numerator / denominator;
135 magResponse[k] = static_cast<float>(abs(response)); 135 magResponse[k] = static_cast<float>(abs(response));
136 phaseResponse[k] = 136 phaseResponse[k] =
137 static_cast<float>(atan2(imag(response), real(response))); 137 static_cast<float>(atan2(imag(response), real(response)));
138 } 138 }
139 } 139 }
140 140
141 } // namespace blink 141 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698