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

Unified Diff: Source/platform/audio/DynamicsCompressorKernel.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/platform/audio/DownSampler.cpp ('k') | Source/platform/audio/EqualPowerPanner.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/audio/DynamicsCompressorKernel.cpp
diff --git a/Source/platform/audio/DynamicsCompressorKernel.cpp b/Source/platform/audio/DynamicsCompressorKernel.cpp
index 41869b7472eb33f5ccb324ef31e073c2859544ee..1f52859661de80e1ada66d852538d1bde9491785 100644
--- a/Source/platform/audio/DynamicsCompressorKernel.cpp
+++ b/Source/platform/audio/DynamicsCompressorKernel.cpp
@@ -294,7 +294,7 @@ void DynamicsCompressorKernel::process(const float* sourceChannels[],
float desiredGain = m_detectorAverage;
// Pre-warp so we get desiredGain after sin() warp below.
- float scaledDesiredGain = asinf(desiredGain) / (0.5f * piFloat);
+ float scaledDesiredGain = asinf(desiredGain) / (piOverTwoFloat);
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Deal with envelopes
@@ -426,7 +426,7 @@ void DynamicsCompressorKernel::process(const float* sourceChannels[],
}
// Warp pre-compression gain to smooth out sharp exponential transition points.
- float postWarpCompressorGain = sinf(0.5f * piFloat * compressorGain);
+ float postWarpCompressorGain = sinf(piOverTwoFloat * compressorGain);
// Calculate total gain using master gain and effect blend.
float totalGain = dryMix + wetMix * masterLinearGain * postWarpCompressorGain;
« no previous file with comments | « Source/platform/audio/DownSampler.cpp ('k') | Source/platform/audio/EqualPowerPanner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698