diff src/audio/SDL_audiocvt.c @ 2760:02aa80d7905f

Updated Visual C++ build
author Sam Lantinga <slouken@libsdl.org>
date Mon, 15 Sep 2008 07:34:36 +0000
parents 79c1bd651f04
children f55c87ae336b
line wrap: on
line diff
--- a/src/audio/SDL_audiocvt.c	Mon Sep 15 06:49:23 2008 +0000
+++ b/src/audio/SDL_audiocvt.c	Mon Sep 15 07:34:36 2008 +0000
@@ -29,6 +29,8 @@
 #include "SDL_audio.h"
 #include "SDL_audio_c.h"
 
+#include "../libm/math.h"
+
 //#define DEBUG_CONVERT
 
 /* These are fractional multiplication routines. That is, their inputs
@@ -1352,6 +1354,7 @@
    For now, use RBJ's cookbook coefficients. It might be more
    optimal to create a Butterworth filter, but this is more difficult.
 */
+#if 0
 int
 SDL_BuildIIRLowpass(SDL_AudioCVT * cvt, SDL_AudioFormat format)
 {
@@ -1443,7 +1446,10 @@
     SDL_memset(cvt->state_buf, 0, 4 * SDL_AUDIO_BITSIZE(format) / 4);
     cvt->state_pos = 0;
 #undef convert_fixed
+
+	return 0;
 }
+#endif
 
 /* Apply the lowpass IIR filter to the given SDL_AudioCVT struct */
 /* This was implemented because it would be much faster than the fir filter, 
@@ -1667,7 +1673,7 @@
                 0.42f - 0.5f * cosf(two_pi_over_m * (float) i) +
                 0.08f * cosf(four_pi_over_m * (float) i);
         }
-        norm_sum += fabs(fSinc[i]);
+        norm_sum += fSinc[i] < 0 ? -fSinc[i] : fSinc[i]; /* fabs(fSinc[i]); */
     }
 
     norm_fact = 1.0f / norm_sum;