summaryrefslogtreecommitdiffstats
path: root/src/resample_defs.h
blob: ccaf3ee051f10a4bea27f92862850a1106d50fa4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/**********************************************************************

  resample_defs.h

  Real-time library interface by Dominic Mazzoni

  Based on resample-1.7:
    http://www-ccrma.stanford.edu/~jos/resample/

  License: LGPL - see the file LICENSE.txt for more information

**********************************************************************/

#ifndef __RESAMPLE_DEFS__
#define __RESAMPLE_DEFS__

#if !defined(WIN32) && !defined(__CYGWIN__)
#include "config.h"
#endif

#ifndef TRUE
#define TRUE  1
#endif

#ifndef FALSE
#define FALSE 0
#endif

#ifndef PI
#define PI (3.14159265358979232846)
#endif

#ifndef PI2
#define PI2 (6.28318530717958465692)
#endif

#define D2R (0.01745329348)          /* (2*pi)/360 */
#define R2D (57.29577951)            /* 360/(2*pi) */

#ifndef MAX
#define MAX(x,y) ((x)>(y) ?(x):(y))
#endif
#ifndef MIN
#define MIN(x,y) ((x)<(y) ?(x):(y))
#endif

#ifndef ABS
#define ABS(x)   ((x)<0   ?(-(x)):(x))
#endif

#ifndef SGN
#define SGN(x)   ((x)<0   ?(-1):((x)==0?(0):(1)))
#endif

#ifdef HAVE_INTTYPES_H
  #include <inttypes.h>
  typedef char           BOOL;
  typedef int32_t        WORD;
  typedef uint32_t       UWORD;
#else
  typedef char           BOOL;
  typedef int            WORD;
  typedef unsigned int   UWORD;
#endif

#ifdef DEBUG
#define INLINE
#else
#define INLINE inline
#endif

/* Accuracy */

#define Npc 4096

/* Function prototypes */

int lrsSrcUp(float X[], float Y[], double factor, double *Time,
             UWORD Nx, UWORD Nwing, float LpScl,
             float Imp[], float ImpD[], BOOL Interp);

int lrsSrcUD(float X[], float Y[], double factor, double *Time,
             UWORD Nx, UWORD Nwing, float LpScl,
             float Imp[], float ImpD[], BOOL Interp);

#endif