7 #define fix1 18 /* (18) number of bits after comma */
10 #define fixfac ((float)(1<<fix1)) /* float factor (for scaling ftofix ..) */
13 /* fixed point multiplication and division */
15 #define mult(a,b) (long long)(((long long) (a) * (long long) (b))>>fix1)
16 #define idiv(a,b) ((((long long) (a) )<<fix1)/(long long) (b) )
18 /* conversion macros */
20 #define itofix(a) ((a) << fix1)
21 #define ftofix(a) ((t_fixed)( (a) *(double)fixfac + 0.5))
23 #define fixtof(a) ((double) (a) * 1./(fixfac-0.5))
24 #define fixtoi(a) ((a) >>fix1)
29 #define fnum(a) ( (a) >>(fix1-16))
33 /* mapping of fft functions */
36 #define mayer_realifft imayer_realifft
37 #define mayer_realfft imayer_realfft
38 #define mayer_fft imayer_fft
39 #define mayer_ifft imayer_ifft
43 #define SCALE16(x) (x>>(fix1-15))
44 #define SCALE32(x) (x<<(32-fix1))
45 #define INVSCALE16(x) (x<<8)
47 #define SCALE16(x) (32767.*x)
48 #define SCALE32(x) (2147483648.*x)
49 #define INVSCALE16(x) ((float)3.051850e-05*x)
62 #define fix1 18 /* (18) number of bits after comma */
65 #define fixfac ((float)(1<<fix1)) /* float factor (for scaling ftofix ..) */
68 /* fixed point multiplication and division */
70 #define mult(a,b) (long long)(((long long) (a) * (long long) (b))>>fix1)
71 #define idiv(a,b) ((((long long) (a) )<<fix1)/(long long) (b) )
73 /* conversion macros */
75 #define itofix(a) ((a) << fix1)
76 #define ftofix(a) ((t_fixed)( (a) *(double)fixfac + 0.5))
78 #define fixtof(a) ((double) (a) * 1./(fixfac-0.5))
79 #define fixtoi(a) ((a) >>fix1)
84 #define fnum(a) ( (a) >>(fix1-16))
88 /* mapping of fft functions */
91 #define mayer_realifft imayer_realifft
92 #define mayer_realfft imayer_realfft
93 #define mayer_fft imayer_fft
94 #define mayer_ifft imayer_ifft
98 #define SCALE16(x) (x>>(fix1-15))
99 #define SCALE32(x) (x<<(32-fix1))
100 #define INVSCALE16(x) (x<<8)
102 #define SCALE16(x) (32767.*x)
103 #define SCALE32(x) (2147483648.*x)
104 #define INVSCALE16(x) ((float)3.051850e-05*x)