root/modules/audio_filter/spatializer/denormals.h
| Revision 8a486daed7bf38d6b336869685e49c0bbfa133db, 423 bytes (checked in by Jean-Baptiste Kempf <jb@videolan.org>, 3 months ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | // Macro for killing denormalled numbers |
| 2 | // |
| 3 | // Written by Jezar at Dreampoint, June 2000 |
| 4 | // http://www.dreampoint.co.uk |
| 5 | // Based on IS_DENORMAL macro by Jon Watte |
| 6 | // This code is public domain |
| 7 | |
| 8 | #ifndef _denormals_ |
| 9 | #define _denormals_ |
| 10 | |
| 11 | #include <stdint.h> |
| 12 | |
| 13 | #include <math.h> |
| 14 | |
| 15 | static inline float undenormalise( float f ) |
| 16 | { |
| 17 | if( fpclassify( f ) == FP_SUBNORMAL ) |
| 18 | return 0.0; |
| 19 | return f; |
| 20 | } |
| 21 | |
| 22 | #endif//_denormals_ |
| 23 |
Note: See TracBrowser for help on using the browser.
