resample_defs.h (1739B)
1 /********************************************************************** 2 3 resample_defs.h 4 5 Real-time library interface by Dominic Mazzoni 6 7 Based on resample-1.7: 8 http://www-ccrma.stanford.edu/~jos/resample/ 9 10 Dual-licensed as LGPL and BSD; see README.md and LICENSE* files. 11 12 **********************************************************************/ 13 14 #ifndef __RESAMPLE_DEFS__ 15 #define __RESAMPLE_DEFS__ 16 17 //#if !defined(WIN32) && !defined(__CYGWIN__) 18 //#include "config.h" 19 //#endif 20 21 #ifndef TRUE 22 #define TRUE 1 23 #endif 24 25 #ifndef FALSE 26 #define FALSE 0 27 #endif 28 29 #ifndef PI 30 #define PI (3.14159265358979232846) 31 #endif 32 33 #ifndef PI2 34 #define PI2 (6.28318530717958465692) 35 #endif 36 37 #define D2R (0.01745329348) /* (2*pi)/360 */ 38 #define R2D (57.29577951) /* 360/(2*pi) */ 39 40 #ifndef MAX 41 #define MAX(x,y) ((x)>(y) ?(x):(y)) 42 #endif 43 #ifndef MIN 44 #define MIN(x,y) ((x)<(y) ?(x):(y)) 45 #endif 46 47 #ifndef ABS 48 #define ABS(x) ((x)<0 ?(-(x)):(x)) 49 #endif 50 51 #ifndef SGN 52 #define SGN(x) ((x)<0 ?(-1):((x)==0?(0):(1))) 53 #endif 54 55 #if HAVE_INTTYPES_H 56 #include <inttypes.h> 57 typedef char BOOL; 58 typedef int32_t WORD; 59 typedef uint32_t UWORD; 60 #else 61 typedef char BOOL; 62 typedef int WORD; 63 typedef unsigned int UWORD; 64 #endif 65 66 #ifdef DEBUG 67 #define INLINE 68 #else 69 #define INLINE inline 70 #endif 71 72 /* Accuracy */ 73 74 #define Npc 4096 75 76 /* Function prototypes */ 77 78 int lrsSrcUp(float X[], float Y[], double factor, double *Time, 79 UWORD Nx, UWORD Nwing, float LpScl, 80 float Imp[], float ImpD[], BOOL Interp); 81 82 int lrsSrcUD(float X[], float Y[], double factor, double *Time, 83 UWORD Nx, UWORD Nwing, float LpScl, 84 float Imp[], float ImpD[], BOOL Interp); 85 86 #endif