summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon/DPL2Decoder.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2014-08-30 21:04:09 -0400
committerLioncash <mathew1800@gmail.com>2014-08-30 21:10:18 -0400
commit2f7df4a803ebb451d5f7a1ef765220a189cb7d6b (patch)
tree9ff57437473b8af1d2cde274cdbf584ebad31103 /Source/Core/AudioCommon/DPL2Decoder.cpp
parentfe518af22df5c293e026b23ff3a68629a563c2bf (diff)
AudioCommon: Declare iterator variable in loop body in DPL2Decoder
Diffstat (limited to 'Source/Core/AudioCommon/DPL2Decoder.cpp')
-rw-r--r--Source/Core/AudioCommon/DPL2Decoder.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Core/AudioCommon/DPL2Decoder.cpp b/Source/Core/AudioCommon/DPL2Decoder.cpp
index 17b74ea85b..680d193c45 100644
--- a/Source/Core/AudioCommon/DPL2Decoder.cpp
+++ b/Source/Core/AudioCommon/DPL2Decoder.cpp
@@ -7,6 +7,7 @@
// * Copyright (c) 2004-2006 Milan Cutka
// * based on mplayer HRTF plugin by ylai
+#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <functional>
@@ -14,6 +15,7 @@
#include <vector>
#include "AudioCommon/DPL2Decoder.h"
+#include "Common/CommonTypes.h"
#include "Common/MathUtil.h"
#ifndef M_PI
@@ -90,11 +92,10 @@ static T FIRFilter(const T *buf, int pos, int len, int count, const float *coeff
*/
static void Hamming(int n, float* w)
{
- int i;
float k = float(2*M_PI/((float)(n-1))); // 2*pi/(N-1)
// Calculate window coefficients
- for (i=0; i<n; i++)
+ for (int i = 0; i < n; i++)
*w++ = float(0.54 - 0.46*cos(k*(float)i));
}
@@ -119,7 +120,6 @@ static float* DesignFIR(unsigned int *n, float* fc, float opt)
{
unsigned int o = *n & 1; // Indicator for odd filter length
unsigned int end = ((*n + 1) >> 1) - o; // Loop end
- unsigned int i; // Loop index
float k1 = 2 * float(M_PI); // 2*pi*fc1
float k2 = 0.5f * (float)(1 - o); // Constant used if the filter has even length
@@ -154,7 +154,7 @@ static float* DesignFIR(unsigned int *n, float* fc, float opt)
}
// Create filter
- for (i=0 ; i<end ; i++)
+ for (u32 i = 0; i < end; i++)
{
t1 = (float)(i+1) - k2;
w[end-i-1] = w[*n-end+i] = float(w[end-i-1] * sin(k1 * t1)/(M_PI * t1)); // Sinc
@@ -164,7 +164,7 @@ static float* DesignFIR(unsigned int *n, float* fc, float opt)
// Normalize gain
g=1/g;
- for (i=0; i<*n; i++)
+ for (u32 i = 0; i < *n; i++)
w[i] *= g;
return w;