[Scummvm-cvs-logs] CVS: scummvm/backends/midi/mt32 synth.cpp,1.8,1.9
Torbjörn Andersson
eriktorbjorn at users.sourceforge.net
Sat Oct 23 06:03:07 CEST 2004
Update of /cvsroot/scummvm/scummvm/backends/midi/mt32
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21632
Modified Files:
synth.cpp
Log Message:
Cleanup
Index: synth.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/midi/mt32/synth.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- synth.cpp 23 Oct 2004 12:50:31 -0000 1.8
+++ synth.cpp 23 Oct 2004 13:02:05 -0000 1.9
@@ -94,52 +94,35 @@
return result;
}
-typedef struct {
- unsigned int length; /* size of filter */
- float *history; /* pointer to history in filter */
- float *coef; /* pointer to coefficients of filter */
-} FILTER;
-
-
-#define FILTER_SECTIONS 2 /* 2 filter sections for 24 db/oct filter */
-
-typedef struct {
- double a0, a1, a2; /* numerator coefficients */
- double b0, b1, b2; /* denominator coefficients */
-} BIQUAD;
+struct FILTER {
+ unsigned int length; // size of filter
+ float *history; // pointer to history in filter
+ float *coef; // pointer to coefficients of filter
+};
-BIQUAD ProtoCoef[FILTER_SECTIONS]; /* Filter prototype coefficients,
- 1 for each filter section */
+#define FILTER_SECTIONS 2 // 2 filter sections for 24 db/oct filter
-void prewarp(double *a0, double *a1, double *a2, double fc, double fs);
-void bilinear(
- double a0, double a1, double a2, /* numerator coefficients */
- double b0, double b1, double b2, /* denominator coefficients */
- double *k, /* overall gain factor */
- double fs, /* sampling rate */
- float *coef); /* pointer to 4 iir coefficients */
+struct BIQUAD {
+ double a0, a1, a2; // numerator coefficients
+ double b0, b1, b2; // denominator coefficients
+};
+// Filter prototype coefficients, 1 for each filter section
+BIQUAD ProtoCoef[FILTER_SECTIONS];
-/*
- * ----------------------------------------------------------
- * Pre-warp the coefficients of a numerator or denominator.
- * Note that a0 is assumed to be 1, so there is no wrapping
- * of it.
- * ----------------------------------------------------------
+/**
+ * Pre-warp the coefficients of a numerator or denominator. Note that a0 is
+ * assumed to be 1, so there is no wrapping of it.
*/
-void prewarp(
- double *a0, double *a1, double *a2,
- double fc, double fs)
-{
- double wp, pi;
- pi = 4.0 * atan(1.0);
- wp = 2.0 * fs * tan(pi * fc / fs);
+void prewarp(double *a0, double *a1, double *a2, double fc, double fs) {
+ double wp;
- *a2 = (*a2) / (wp * wp);
- *a1 = (*a1) / wp;
-}
+ wp = 2.0 * fs * tan(PI * fc / fs);
+ *a2 = (*a2) / (wp * wp);
+ *a1 = (*a1) / wp;
+}
/*
* ----------------------------------------------------------
More information about the Scummvm-git-logs
mailing list