summaryrefslogtreecommitdiff
path: root/attic/muse2-oom/muse2/plugins/freeverb/denormals.h
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2011-03-07 19:01:11 +0000
committerRobert Jonsson <spamatica@gmail.com>2011-03-07 19:01:11 +0000
commite40fc849149dd97c248866a4a1d026dda5e57b62 (patch)
treeb12b358f3b3a0608001d30403358f8443118ec5f /attic/muse2-oom/muse2/plugins/freeverb/denormals.h
parent1bd4f2e8d9745cabb667b043171cad22c8577768 (diff)
clean3
Diffstat (limited to 'attic/muse2-oom/muse2/plugins/freeverb/denormals.h')
-rw-r--r--attic/muse2-oom/muse2/plugins/freeverb/denormals.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/attic/muse2-oom/muse2/plugins/freeverb/denormals.h b/attic/muse2-oom/muse2/plugins/freeverb/denormals.h
new file mode 100644
index 00000000..d18412b4
--- /dev/null
+++ b/attic/muse2-oom/muse2/plugins/freeverb/denormals.h
@@ -0,0 +1,28 @@
+// Macro for killing denormalled numbers
+//
+// Written by Jezar at Dreampoint, June 2000
+// http://www.dreampoint.co.uk
+// Based on IS_DENORMAL macro by Jon Watte
+// This code is public domain
+
+#ifndef _denormals_
+#define _denormals_
+
+// this does not work with at least gcc3.3 and -O2:
+// #define undenormalise(sample) if(((*(unsigned int*)&sample)&0x7f800000)==0) sample=0.0f
+//
+// from Laurent de Soras Paper: Denormal numbers in floating point
+// signal processing applications
+// (ws)
+
+#define undenormalise(sample) \
+ { \
+ float anti_denormal = 1e-18; \
+ sample += anti_denormal; \
+ sample -= anti_denormal; \
+ }
+
+#endif//_denormals_
+
+//ends
+