src/resample_defs.h

00001 /**********************************************************************
00002 
00003   resample_defs.h
00004 
00005   Real-time library interface by Dominic Mazzoni
00006 
00007   Based on resample-1.7:
00008     http://www-ccrma.stanford.edu/~jos/resample/
00009 
00010   License: LGPL - see the file LICENSE.txt for more information
00011 
00012 **********************************************************************/
00013 
00014 #ifndef __RESAMPLE_DEFS__
00015 #define __RESAMPLE_DEFS__
00016 
00017 #if !defined(WIN32) && !defined(__CYGWIN__)
00018 #include "config.h"
00019 #endif
00020 
00021 #ifndef TRUE
00022 #define TRUE  1
00023 #endif
00024 
00025 #ifndef FALSE
00026 #define FALSE 0
00027 #endif
00028 
00029 #ifndef PI
00030 #define PI (3.14159265358979232846)
00031 #endif
00032 
00033 #ifndef PI2
00034 #define PI2 (6.28318530717958465692)
00035 #endif
00036 
00037 #define D2R (0.01745329348)          /* (2*pi)/360 */
00038 #define R2D (57.29577951)            /* 360/(2*pi) */
00039 
00040 #ifndef MAX
00041 #define MAX(x,y) ((x)>(y) ?(x):(y))
00042 #endif
00043 #ifndef MIN
00044 #define MIN(x,y) ((x)<(y) ?(x):(y))
00045 #endif
00046 
00047 #ifndef ABS
00048 #define ABS(x)   ((x)<0   ?(-(x)):(x))
00049 #endif
00050 
00051 #ifndef SGN
00052 #define SGN(x)   ((x)<0   ?(-1):((x)==0?(0):(1)))
00053 #endif
00054 
00055 #ifdef HAVE_INTTYPES_H
00056   #include <inttypes.h>
00057   typedef char           BOOL;
00058   typedef int32_t        WORD;
00059   typedef uint32_t       UWORD;
00060 #else
00061   typedef char           BOOL;
00062   typedef int            WORD;
00063   typedef unsigned int   UWORD;
00064 #endif
00065 
00066 #ifdef DEBUG
00067 #define INLINE
00068 #else
00069 #define INLINE inline
00070 #endif
00071 
00072 /* Accuracy */
00073 
00074 #define Npc 4096
00075 
00076 /* Function prototypes */
00077 
00078 int lrsSrcUp(float X[], float Y[], double factor, double *Time,
00079              UWORD Nx, UWORD Nwing, float LpScl,
00080              float Imp[], float ImpD[], BOOL Interp);
00081 
00082 int lrsSrcUD(float X[], float Y[], double factor, double *Time,
00083              UWORD Nx, UWORD Nwing, float LpScl,
00084              float Imp[], float ImpD[], BOOL Interp);
00085 
00086 #endif

Generated on Wed Oct 15 18:15:26 2008 for libresample by  doxygen 1.4.7