Remove global "using namespace std;" declarations, use "std::" prefixes on all std elements
Fix whitespace changes
This commit is contained in:
committed by
Martin Natano
parent
f0680a29fc
commit
0cba3579de
@@ -64,7 +64,7 @@ namespace
|
||||
for( int n = 0; n < iLen; ++n )
|
||||
{
|
||||
float fN1 = fabsf((n-p)/p);
|
||||
float fNum = fBeta * sqrtf( max(1-fN1*fN1, 0) );
|
||||
float fNum = fBeta * sqrtf( std::max(1-fN1*fN1, 0.0f) );
|
||||
fNum = BesselI0( fNum );
|
||||
float fVal = fNum/fDenom;
|
||||
pBuf[n] *= fVal;
|
||||
@@ -104,7 +104,7 @@ namespace
|
||||
|
||||
void NormalizeVector( float *pBuf, int iSize )
|
||||
{
|
||||
float fTotal = accumulate( &pBuf[0], &pBuf[iSize], 0.0f );
|
||||
float fTotal = std::accumulate( &pBuf[0], &pBuf[iSize], 0.0f );
|
||||
MultiplyVector( &pBuf[0], &pBuf[iSize], 1/fTotal );
|
||||
}
|
||||
|
||||
@@ -402,14 +402,14 @@ namespace PolyphaseFilterCache
|
||||
{
|
||||
/* Cache filter data, and reuse it without copying. All operations after creation
|
||||
* are const, so this doesn't cause thread-safety problems. */
|
||||
typedef map<pair<int,float>, PolyphaseFilter *> FilterMap;
|
||||
typedef std::map<std::pair<int, float>, PolyphaseFilter*> FilterMap;
|
||||
static RageMutex PolyphaseFiltersLock("PolyphaseFiltersLock");
|
||||
static FilterMap g_mapPolyphaseFilters;
|
||||
|
||||
const PolyphaseFilter *MakePolyphaseFilter( int iUpFactor, float fCutoffFrequency )
|
||||
{
|
||||
PolyphaseFiltersLock.Lock();
|
||||
pair<int,float> params( make_pair(iUpFactor, fCutoffFrequency) );
|
||||
std::pair<int, float> params( std::make_pair(iUpFactor, fCutoffFrequency) );
|
||||
FilterMap::const_iterator it = g_mapPolyphaseFilters.find(params);
|
||||
if( it != g_mapPolyphaseFilters.end() )
|
||||
{
|
||||
@@ -440,7 +440,7 @@ namespace PolyphaseFilterCache
|
||||
* Round the cutoff down, if possible; it's better to filter out too much than
|
||||
* too little. */
|
||||
PolyphaseFiltersLock.Lock();
|
||||
pair<int,float> params( make_pair(iUpFactor, fCutoffFrequency + 0.0001f) );
|
||||
std::pair<int, float> params( std::make_pair(iUpFactor, fCutoffFrequency + 0.0001f) );
|
||||
FilterMap::const_iterator it = g_mapPolyphaseFilters.upper_bound( params );
|
||||
if( it != g_mapPolyphaseFilters.begin() )
|
||||
--it;
|
||||
@@ -470,7 +470,7 @@ public:
|
||||
m_iUpFactor = iUpFactor;
|
||||
m_pPolyphase = nullptr;
|
||||
|
||||
int iFilterIncrement = max( (iMaxDownFactor - iMinDownFactor)/10, 1 );
|
||||
int iFilterIncrement = std::max( (iMaxDownFactor - iMinDownFactor)/10, 1 );
|
||||
for( int iDownFactor = iMinDownFactor; iDownFactor <= iMaxDownFactor; iDownFactor += iFilterIncrement )
|
||||
{
|
||||
float fCutoffFrequency = GetCutoffFrequency( iDownFactor );
|
||||
@@ -529,7 +529,7 @@ private:
|
||||
|
||||
float fCutoffFrequency;
|
||||
fCutoffFrequency = 1.0f / (2*m_iUpFactor);
|
||||
fCutoffFrequency = min( fCutoffFrequency, 1.0f / (2*iDownFactor) );
|
||||
fCutoffFrequency = std::min( fCutoffFrequency, 1.0f / (2*iDownFactor) );
|
||||
return fCutoffFrequency;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user