aboutsummaryrefslogtreecommitdiff
path: root/pd/portaudio/pa_common/pa_dither.c
diff options
context:
space:
mode:
Diffstat (limited to 'pd/portaudio/pa_common/pa_dither.c')
-rw-r--r--pd/portaudio/pa_common/pa_dither.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pd/portaudio/pa_common/pa_dither.c b/pd/portaudio/pa_common/pa_dither.c
index eb6bec38..0600db62 100644
--- a/pd/portaudio/pa_common/pa_dither.c
+++ b/pd/portaudio/pa_common/pa_dither.c
@@ -1,5 +1,5 @@
/*
- * $Id: pa_dither.c,v 1.1.2.5 2003/09/20 21:06:19 rossbencina Exp $
+ * $Id: pa_dither.c,v 1.1.2.6 2005/05/28 22:49:02 rossbencina Exp $
* Portable Audio I/O Library triangular dither generator
*
* Based on the Open Source API proposed by Ross Bencina
@@ -35,6 +35,7 @@
#include "pa_dither.h"
+#include "pa_types.h"
#define PA_DITHER_BITS_ (15)
@@ -59,7 +60,7 @@ signed long PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerato
* Shift before adding to prevent overflow which would skew the distribution.
* Also shift an extra bit for the high pass filter.
*/
-#define DITHER_SHIFT_ ((32 - PA_DITHER_BITS_) + 1)
+#define DITHER_SHIFT_ ((SIZEOF_LONG*8 - PA_DITHER_BITS_) + 1)
current = (((signed long)state->randSeed1)>>DITHER_SHIFT_) +
(((signed long)state->randSeed2)>>DITHER_SHIFT_);
@@ -86,7 +87,7 @@ float PaUtil_GenerateFloatTriangularDither( PaUtilTriangularDitherGenerator *sta
* Shift before adding to prevent overflow which would skew the distribution.
* Also shift an extra bit for the high pass filter.
*/
-#define DITHER_SHIFT_ ((32 - PA_DITHER_BITS_) + 1)
+#define DITHER_SHIFT_ ((SIZEOF_LONG*8 - PA_DITHER_BITS_) + 1)
current = (((signed long)state->randSeed1)>>DITHER_SHIFT_) +
(((signed long)state->randSeed2)>>DITHER_SHIFT_);