35#ifndef __SAF_UTILITIES_H_INCLUDED__
36#define __SAF_UTILITIES_H_INCLUDED__
55#define SAF_MIN(a,b) (( (a) < (b) ) ? (a) : (b))
58#define SAF_MAX(a,b) (( (a) > (b) ) ? (a) : (b))
61#define SAF_CLAMP(a,min,max) (SAF_MAX(min, SAF_MIN(max, a)))
67#define SAF_FALSE ( 0 )
70# define SAF_PI ( 3.14159265358979323846264338327950288f )
73# define SAF_PId ( 3.14159265358979323846264338327950288 )
76#define SAF_ISPOW2(x) (((x & ~(x-1))==x) ? x : 0)
80# define ISEVEN(n) ((n%2 == 0) ? 1 : 0)
85# define ISODD(n) ((n%2 != 0) ? 1 : 0)
89#define SQRT4PI ( 3.544907701811032f )
92#define FOURPI ( 12.566370614359172f )
95#define ELEV2INCL(E) ( (SAF_PI/2.0f - E) )
99# define DEG2RAD(x) (x * SAF_PI / 180.0f)
104# define RAD2DEG(x) (x * 180.0f / SAF_PI)
109# define MKSTRING_(s) #s
114# define MKSTRING(s) MKSTRING_(s)
118#define SAF_UNUSED(x) (void)(x)
122# define saf_print_warning(message) {fprintf(stdout, \
123 "SAF WARNING: %s [%s LINE %u] \n", message,\
124 __FILE__, __LINE__);}
127# define saf_print_error(message) {fprintf(stderr, \
128 "SAF ERROR: %s [%s LINE %u] \n", message, \
129 __FILE__, __LINE__); \
133# define saf_assert(x, message) if (!(x)) \
134 {printf("SAF ASSERTION FAILED: (%s), %s [%s LINE %u].\n", \
135 MKSTRING(x), message, __FILE__, __LINE__); \
136 exit(EXIT_FAILURE); }
139# define saf_print_warning(message)
140# define saf_print_error(message) exit(EXIT_FAILURE)
141# define saf_assert(x, message) assert(x)
179#include "../../resources/zlib/zlib.h"
A modified version of afSTFTlib.
An implementation of the 3-D quickhull algorithm [1].
The default complex <-> complex FFT.
The default real <-> half-complex FFT.
Contiguous memory allocation functions for multi-dimensional arrays.
A collection of routines for computing spherical and cylindrical Bessel and Hankel functions,...
Contains wrappers for handling complex numbers across both C99-compliant compilers and Microsoft Visu...
A collection of signal decorrelators.
Distance variation function filter coefficient data [1].
Wrappers for optimised discrete/fast Fourier transform (FFT) routines.
A collection of IIR/FIR filter and filterbank designs.
A collection of computational geometry related functions.
A collection of loudspeaker array directions and (nearly) uniform spherical grids.
Matrix and multi-channel convolvers.
A collection of miscellaneous functions.
A collection of pitch shifting algorithms.
An implementation of the complex Quadrature Mirror Filterbank (QMF) described in [1].
A collection of microphone array sensor directions.
A collection of useful sorting functions.
Wrappers for optimised linear algebra routines, utilising CBLAS and LAPACK, and/or SIMD intrinsics.
Main header file for the Speex resampler.