diff options
author | Robert Jonsson <spamatica@gmail.com> | 2009-12-27 11:30:35 +0000 |
---|---|---|
committer | Robert Jonsson <spamatica@gmail.com> | 2009-12-27 11:30:35 +0000 |
commit | b703eab295330e6f81564fbb39a10a1a2fdd2f54 (patch) | |
tree | e46b5c9a6bc22fd661c15d1d2123f5bf631cef80 /muse_qt4_evolution/plugins/freeverb/denormals.h | |
parent | 5d5fa0fdf913907edbc3d2d29a7548f0cb658c94 (diff) |
moved old qt4 branch
Diffstat (limited to 'muse_qt4_evolution/plugins/freeverb/denormals.h')
-rw-r--r-- | muse_qt4_evolution/plugins/freeverb/denormals.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/muse_qt4_evolution/plugins/freeverb/denormals.h b/muse_qt4_evolution/plugins/freeverb/denormals.h new file mode 100644 index 00000000..37d3ed27 --- /dev/null +++ b/muse_qt4_evolution/plugins/freeverb/denormals.h @@ -0,0 +1,38 @@ +// 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) + +#if 0 +#define undenormalise(sample) \ + { \ + float anti_denormal = 1e-18; \ + sample += anti_denormal; \ + sample -= anti_denormal; \ + } +#endif + +// from beast-0.7.2 (Tim Janik/Stefan Westerfeld): + +#define undenormalise(sample) \ + do { \ + volatile float __forced_float = 1e-29 + sample; \ + sample = __forced_float - 1e-29; \ + } while (0) + +#endif//_denormals_ + +//ends + |