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

Unified Diff: Source/modules/webaudio/RealtimeAnalyser.cpp

Issue 170453004: Add constant twoPiDouble/twoPiFloat to MathExtras.h (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add constant values to header Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/svg/SVGPathParser.cpp ('k') | Source/platform/audio/DownSampler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/RealtimeAnalyser.cpp
diff --git a/Source/modules/webaudio/RealtimeAnalyser.cpp b/Source/modules/webaudio/RealtimeAnalyser.cpp
index 24d7b729cabe902441ddda2c9099e0677199e03f..d7f671224a0b6512d22c7c771c487d7a526b1e73 100644
--- a/Source/modules/webaudio/RealtimeAnalyser.cpp
+++ b/Source/modules/webaudio/RealtimeAnalyser.cpp
@@ -138,7 +138,7 @@ void applyWindow(float* p, size_t n)
for (unsigned i = 0; i < n; ++i) {
double x = static_cast<double>(i) / static_cast<double>(n);
- double window = a0 - a1 * cos(2 * piDouble * x) + a2 * cos(4 * piDouble * x);
+ double window = a0 - a1 * cos(twoPiDouble * x) + a2 * cos(twoPiDouble * 2.0 * x);
p[i] *= float(window);
}
}
« no previous file with comments | « Source/core/svg/SVGPathParser.cpp ('k') | Source/platform/audio/DownSampler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698