Changeset 258195f for src/aubio_priv.h


Ignore:
Timestamp:
Sep 28, 2009, 8:58:03 PM (15 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
916f8983
Parents:
17b7d66
Message:

src/aubio_priv.h: define VERY_SMALL_NUMBER here, add KILL_DENORMAL and CEIL_DENORMAL macros, SAFE_LOG10 and SAFE_LOG

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/aubio_priv.h

    r17b7d66 r258195f  
    190190#define ELEM_SWAP(a,b) { register smpl_t t=(a);(a)=(b);(b)=t; }
    191191
    192 #define ISDENORMAL(f) f < 1.e-37
     192#define VERY_SMALL_NUMBER 2.e-42 //1.e-37
     193
     194#define IS_DENORMAL(f) f < VERY_SMALL_NUMBER
     195
     196#define KILL_DENORMAL(f)  IS_DENORMAL(f) ? 0. : f
     197#define CEIL_DENORMAL(f)  IS_DENORMAL(f) ? VERY_SMALL_NUMBER : f
     198
     199#define SAFE_LOG10(f) LOG10(CEIL_DENORMAL(f))
     200#define SAFE_LOG(f)   LOG(CEIL_DENORMAL(f))
    193201
    194202#define UNUSED __attribute__((unused))
Note: See TracChangeset for help on using the changeset viewer.