aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMax Horn2003-10-03 10:30:33 +0000
committerMax Horn2003-10-03 10:30:33 +0000
commit88de9a21ae44d59e057f6ff85a1c7dcbfbd8b701 (patch)
tree7582ea02e2c6ce6886017a00e6497ae90c7cef1c /sound
parentbe1bd35ae5b93646ebad10b7ae837fec675f9d18 (diff)
downloadscummvm-rg350-88de9a21ae44d59e057f6ff85a1c7dcbfbd8b701.tar.gz
scummvm-rg350-88de9a21ae44d59e057f6ff85a1c7dcbfbd8b701.tar.bz2
scummvm-rg350-88de9a21ae44d59e057f6ff85a1c7dcbfbd8b701.zip
undo aquadran's recent changes here. If this doesn't compile on MSVC7, fine, simply remove it from your project file - it's not supposed to be compiled ATM
svn-id: r10564
Diffstat (limited to 'sound')
-rw-r--r--sound/resample.cpp24
-rw-r--r--sound/resample.h1
2 files changed, 13 insertions, 12 deletions
diff --git a/sound/resample.cpp b/sound/resample.cpp
index fbd501403b..5a772389fb 100644
--- a/sound/resample.cpp
+++ b/sound/resample.cpp
@@ -59,10 +59,10 @@ static void LpFilter(double c[], int N, double frq, double Beta, int Num);
static int makeFilter(HWORD Imp[], HWORD ImpD[], UHWORD *LpScl, UHWORD Nwing,
double Froll, double Beta);
-static int32 FilterUp(HWORD Imp[], HWORD ImpD[], UHWORD Nwing, bool Interp,
+static WORD FilterUp(HWORD Imp[], HWORD ImpD[], UHWORD Nwing, bool Interp,
HWORD *Xp, HWORD Inc, HWORD Ph);
-static int32 FilterUD(HWORD Imp[], HWORD ImpD[], UHWORD Nwing, bool Interp,
+static WORD FilterUD(HWORD Imp[], HWORD ImpD[], UHWORD Nwing, bool Interp,
HWORD *Xp, HWORD Ph, HWORD Inc, UHWORD dhb);
@@ -144,7 +144,7 @@ static int32 FilterUD(HWORD Imp[], HWORD ImpD[], UHWORD Nwing, bool Interp,
#define IBUFFSIZE 4096 /* Input buffer size */
-static inline HWORD WordToHword(int32 v, int scl)
+static inline HWORD WordToHword(WORD v, int scl)
{
HWORD out;
@@ -167,7 +167,7 @@ static int SrcUp(HWORD X[], HWORD Y[], double factor, UWORD *Time,
HWORD Imp[], HWORD ImpD[], bool Interp)
{
HWORD *Xp, *Ystart;
- int32 v;
+ WORD v;
double dt; /* Step through input signal */
UWORD dtb; /* Fixed-point version of Dt */
@@ -203,7 +203,7 @@ static int SrcUD(HWORD X[], HWORD Y[], double factor, UWORD *Time,
HWORD Imp[], HWORD ImpD[], bool Interp)
{
HWORD *Xp, *Ystart;
- int32 v;
+ WORD v;
double dh; /* Step through filter impulse response */
double dt; /* Step through input signal */
@@ -267,7 +267,7 @@ void LpFilter(double c[], int N, double frq, double Beta, int Num)
/* Calculate ideal lowpass filter impulse response coefficients: */
c[0] = 2.0*frq;
for (i=1; i<N; i++) {
- temp = PI*(double)i/(double)Num;
+ temp = M_PI*(double)i/(double)Num;
c[i] = sin(2.0*temp*frq)/temp; /* Analog sinc function, cutoff = frq */
}
@@ -346,13 +346,13 @@ int makeFilter(HWORD Imp[], HWORD ImpD[], UHWORD *LpScl, UHWORD Nwing,
#pragma mark -
-int32 FilterUp(HWORD Imp[], HWORD ImpD[],
+WORD FilterUp(HWORD Imp[], HWORD ImpD[],
UHWORD Nwing, bool Interp,
HWORD *Xp, HWORD Ph, HWORD Inc)
{
HWORD *Hp, *Hdp = NULL, *End;
HWORD a = 0;
- int32 v, t;
+ WORD v, t;
v=0;
Hp = &Imp[Ph>>Na];
@@ -397,7 +397,7 @@ int32 FilterUp(HWORD Imp[], HWORD ImpD[],
return(v);
}
-int32 FilterUD( HWORD Imp[], HWORD ImpD[],
+WORD FilterUD( HWORD Imp[], HWORD ImpD[],
UHWORD Nwing, bool Interp,
HWORD *Xp, HWORD Ph, HWORD Inc, UHWORD dhb)
{
@@ -492,7 +492,7 @@ static int resampleWithFilter( /* number of output samples returned */
for (i=0; i<Xoff; X1[i++]=0); /* Need Xoff zeros at begining of sample */
for (i=0; i<Xoff; X2[i++]=0); /* Need Xoff zeros at begining of sample */
-
+
do {
if (!last) /* If haven't read last sample yet */
{
@@ -932,8 +932,8 @@ ResampleRateConverter::ResampleRateConverter(st_rate_t inrate, st_rate_t outrate
Xread = Xoff; /* Position in input array to read into */
Time = (Xoff<<Np); /* Current-time pointer for converter */
- Nout = SrcUp(X1, Y1, factor, &Time, Nx, Nwing, LpScl, Imp, ImpD, quadr != 0);
- Nout = SrcUD(X1, Y1, factor, &Time, Nx, Nwing, LpScl, Imp, ImpD, quadr != 0);
+ Nout = SrcUp(X1, Y1, factor, &Time, Nx, Nwing, LpScl, Imp, ImpD, quadr);
+ Nout = SrcUD(X1, Y1, factor, &Time, Nx, Nwing, LpScl, Imp, ImpD, quadr);
// st_resample_start(&rstuff, inrate, outrate);
}
diff --git a/sound/resample.h b/sound/resample.h
index 8fd5f0f19b..46c33244ce 100644
--- a/sound/resample.h
+++ b/sound/resample.h
@@ -31,6 +31,7 @@
// From resample's stddef.h
typedef int16 HWORD;
typedef uint16 UHWORD;
+typedef int32 WORD;
typedef uint32 UWORD;
#define MAX_HWORD (32767)