Changeset 8a1f9a4


Ignore:
Timestamp:
Sep 29, 2006, 3:58:29 PM (18 years ago)
Author:
Paul Brossier <piem@altern.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:
17db1cd
Parents:
9ec7876
Message:

move libc aliases from mathutils.h to to aubio_priv.h
move libc aliases from mathutils.h to to aubio_priv.h

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/aubio_priv.h

    r9ec7876 r8a1f9a4  
    118118#define AUBIO_SPRINTF                sprintf
    119119
     120/* Libc shortcuts */
     121#define PI         (M_PI)
     122#define TWO_PI     (PI*2.)
     123
     124/* aliases to math.h functions */
     125#define EXP        expf
     126#define COS        cosf
     127#define SIN        sinf
     128#define ABS        fabsf
     129#define POW        powf
     130#define SQRT       sqrtf
     131#define LOG10      log10f
     132#define LOG        logf
     133#define FLOOR      floorf
     134#define TRUNC      truncf
     135
     136/* aliases to complex.h functions */
     137#if !defined(HAVE_COMPLEX_H) || defined(WIN32)
     138/* mingw32 does not know about c*f functions */
     139#define EXPC      cexp
     140/** complex = CEXPC(complex) */
     141#define CEXPC     cexp
     142/** sample = ARGC(complex) */
     143#define ARGC      carg
     144/** sample = ABSC(complex) norm */
     145#define ABSC      cabs
     146/** sample = REAL(complex) */
     147#define REAL      creal
     148/** sample = IMAG(complex) */
     149#define IMAG      cimag
     150#else
     151/** sample = EXPC(complex) */
     152#define EXPC      cexpf
     153/** complex = CEXPC(complex) */
     154#define CEXPC     cexp
     155/** sample = ARGC(complex) */
     156#define ARGC      cargf
     157/** sample = ABSC(complex) norm */
     158#define ABSC      cabsf
     159/** sample = REAL(complex) */
     160#define REAL      crealf
     161/** sample = IMAG(complex) */
     162#define IMAG      cimagf
     163#endif
     164
     165/* handy shortcuts */
     166#define DB2LIN(g) (POW(10.0f,(g)*0.05f))
     167#define LIN2DB(v) (20.0f*LOG10(v))
     168#define SQR(_a)   (_a*_a)
     169
     170#define ELEM_SWAP(a,b) { register smpl_t t=(a);(a)=(b);(b)=t; }
     171
    120172#endif/*_AUBIO_PRIV_H*/
  • src/mathutils.h

    r9ec7876 r8a1f9a4  
    2929#ifndef MATHUTILS_H
    3030#define MATHUTILS_H
    31 
    32 #define PI                              (M_PI)
    33 #define TWO_PI          (PI*2.)
    34 
    35 /* aliases to math.h functions */
    36 #define EXP                             expf
    37 #define COS                             cosf
    38 #define SIN                             sinf
    39 #define ABS                             fabsf
    40 #define POW                             powf
    41 #define SQRT                    sqrtf
    42 #define LOG10                   log10f
    43 #define LOG                       logf
    44 #define FLOOR                   floorf
    45 #define TRUNC                   truncf
    46 
    47 /* aliases to complex.h functions */
    48 #if defined(WIN32)
    49 /* mingw32 does not know about c*f functions */
    50 #define EXPC                    cexp
    51 /** complex = CEXPC(complex) */
    52 #define CEXPC                   cexp
    53 /** sample = ARGC(complex) */
    54 #define ARGC                    carg
    55 /** sample = ABSC(complex) norm */
    56 #define ABSC                    cabs
    57 /** sample = REAL(complex) */
    58 #define REAL                    creal
    59 /** sample = IMAG(complex) */
    60 #define IMAG                    cimag
    61 #else
    62 /** sample = EXPC(complex) */
    63 #define EXPC                    cexpf
    64 /** complex = CEXPC(complex) */
    65 #define CEXPC                   cexp
    66 /** sample = ARGC(complex) */
    67 #define ARGC                    cargf
    68 /** sample = ABSC(complex) norm */
    69 #define ABSC                    cabsf
    70 /** sample = REAL(complex) */
    71 #define REAL                    crealf
    72 /** sample = IMAG(complex) */
    73 #define IMAG                    cimagf
    74 #endif
    75 
    76 /* handy shortcuts */
    77 #define DB2LIN(g) (POW(10.0f,(g)*0.05f))
    78 #define LIN2DB(v) (20.0f*LOG10(v))
    79 #define SQR(_a)         (_a*_a)
    80 
    81 #define ELEM_SWAP(a,b) { register smpl_t t=(a);(a)=(b);(b)=t; }
    8231
    8332/** Window types
Note: See TracChangeset for help on using the changeset viewer.