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

Unified Diff: Source/platform/audio/SincResampler.cpp

Issue 511333002: Removing "using" declarations that import names in the C++ Standard library.(Source/platform/audio) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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/HRTFPanner.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/audio/SincResampler.cpp
diff --git a/Source/platform/audio/SincResampler.cpp b/Source/platform/audio/SincResampler.cpp
index bf4880d4ecbb67629a28690d00067cdd7c72584b..fe7598c7e4d03aaef9b3de33e3336268642b9c52 100644
--- a/Source/platform/audio/SincResampler.cpp
+++ b/Source/platform/audio/SincResampler.cpp
@@ -40,8 +40,6 @@
#include <emmintrin.h>
#endif
-using namespace std;
-
// Input buffer layout, dividing the total buffer into regions (r0 - r5):
//
// |----------------|----------------------------------------------------------------|----------------|
@@ -115,12 +113,12 @@ void SincResampler::initializeKernel()
for (int i = 0; i < n; ++i) {
// Compute the sinc() with offset.
double s = sincScaleFactor * piDouble * (i - halfSize - subsampleOffset);
- double sinc = !s ? 1.0 : sin(s) / s;
+ double sinc = !s ? 1.0 : std::sin(s) / s;
sinc *= sincScaleFactor;
// Compute Blackman window, matching the offset of the sinc().
double x = (i - subsampleOffset) / n;
- double window = a0 - a1 * cos(twoPiDouble * x) + a2 * cos(twoPiDouble * 2.0 * x);
+ double window = a0 - a1 * std::cos(twoPiDouble * x) + a2 * std::cos(twoPiDouble * 2.0 * x);
// Window the sinc() function and store at the correct offset.
m_kernelStorage[i + offsetIndex * m_kernelSize] = sinc * window;
@@ -165,7 +163,7 @@ public:
float* buffer = bus->channel(0)->mutableData();
// Clamp to number of frames available and zero-pad.
- size_t framesToCopy = min(m_sourceFramesAvailable, framesToProcess);
+ size_t framesToCopy = std::min(m_sourceFramesAvailable, framesToProcess);
memcpy(buffer, m_source, sizeof(float) * framesToCopy);
// Zero-pad if necessary.
@@ -192,7 +190,7 @@ void SincResampler::process(const float* source, float* destination, unsigned nu
unsigned remaining = numberOfDestinationFrames;
while (remaining) {
- unsigned framesThisTime = min(remaining, m_blockSize);
+ unsigned framesThisTime = std::min(remaining, m_blockSize);
process(&sourceProvider, destination, framesThisTime);
destination += framesThisTime;
« no previous file with comments | « Source/platform/audio/HRTFPanner.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698