#include "wtf/MathExtras.h"
#include "wtf/Uint8Array.h"
-using namespace std;
-
-namespace WebCore {
+namespace blink {
const double RealtimeAnalyser::DefaultSmoothingTimeConstant = 0.8;
const double RealtimeAnalyser::DefaultMinDecibels = -100;
// A value of 0 does no averaging with the previous result. Larger values produce slower, but smoother changes.
double k = m_smoothingTimeConstant;
- k = max(0.0, k);
- k = min(1.0, k);
+ k = std::max(0.0, k);
+ k = std::min(1.0, k);
// Convert the analysis data from complex to magnitude and average with the previous result.
float* destination = magnitudeBuffer().data();
// Convert from linear magnitude to floating-point decibels.
const double minDecibels = m_minDecibels;
unsigned sourceLength = magnitudeBuffer().size();
- size_t len = min(sourceLength, destinationArray->length());
+ size_t len = std::min(sourceLength, destinationArray->length());
if (len > 0) {
const float* source = magnitudeBuffer().data();
float* destination = destinationArray->data();
// Convert from linear magnitude to unsigned-byte decibels.
unsigned sourceLength = magnitudeBuffer().size();
- size_t len = min(sourceLength, destinationArray->length());
+ size_t len = std::min(sourceLength, destinationArray->length());
if (len > 0) {
const double rangeScaleFactor = m_maxDecibels == m_minDecibels ? 1 : 1 / (m_maxDecibels - m_minDecibels);
const double minDecibels = m_minDecibels;
return;
unsigned fftSize = this->fftSize();
- size_t len = min(fftSize, destinationArray->length());
+ size_t len = std::min(fftSize, destinationArray->length());
if (len > 0) {
bool isInputBufferGood = m_inputBuffer.size() == InputBufferSize && m_inputBuffer.size() > fftSize;
ASSERT(isInputBufferGood);
return;
unsigned fftSize = this->fftSize();
- size_t len = min(fftSize, destinationArray->length());
+ size_t len = std::min(fftSize, destinationArray->length());
if (len > 0) {
bool isInputBufferGood = m_inputBuffer.size() == InputBufferSize && m_inputBuffer.size() > fftSize;
ASSERT(isInputBufferGood);
}
}
-} // namespace WebCore
+} // namespace blink
#endif // ENABLE(WEB_AUDIO)