common: prevent buffer overflow
[supercollider.git] / include / common / dfftlib.h
blob409267e7a6fe36fc955e11c8039d7dec25e7e37c
1 long dFFTInit(long *fftMptr, long fftN, double *Utbl);
2 /* Compute cosine table and check size for complex ffts */
3 /* INPUTS */
4 /* fftN = size of fft */
5 /* OUTPUTS */
6 /* *fftMptr = log2 of fft size */
7 /* *Utbl = cosine table with fftN/4 + 1 entries (angles = 0 to pi/2 inclusive) */
8 /* RETURNS */
9 /* 1 if fftN is invalid, 0 otherwise */
11 long drFFTInit(long *fftMptr, long fftN, double *Utbl);
12 /* Compute cosine table and check size for a real input fft */
13 /* INPUTS */
14 /* fftN = size of fft */
15 /* OUTPUTS */
16 /* *fftMptr = log2 of fft size */
17 /* *Utbl = cosine table with fftN/4 + 1 entries (angles = 0 to pi/2 inclusive) */
18 /* RETURNS */
19 /* 1 if fftN is invalid, 0 otherwise */
21 void dffts(double *ioptr, long M, long Rows, double *Utbl);
22 /* Compute in-place complex fft on the rows of the input array */
23 /* INPUTS */
24 /* M = log2 of fft size */
25 /* *ioptr = input data array */
26 /* *Utbl = cosine table */
27 /* Rows = number of rows in ioptr array (use Rows of 1 if ioptr is a 1 dimensional array) */
28 /* OUTPUTS */
29 /* *ioptr = output data array */
31 void diffts(double *ioptr, long M, long Rows, double *Utbl);
32 /* Compute in-place inverse complex fft on the rows of the input array */
33 /* INPUTS */
34 /* M = log2 of fft size */
35 /* *ioptr = input data array */
36 /* *Utbl = cosine table */
37 /* Rows = number of rows in ioptr array (use Rows of 1 if ioptr is a 1 dimensional array) */
38 /* OUTPUTS */
39 /* *ioptr = output data array */
41 void drffts(double *ioptr, long M, long Rows, double *Utbl);
42 /* Compute in-place real fft on the rows of the input array */
43 /* INPUTS */
44 /* M = log2 of fft size */
45 /* *ioptr = real input data array */
46 /* *Utbl = cosine table */
47 /* Rows = number of rows in ioptr array (use Rows of 1 if ioptr is a 1 dimensional array) */
48 /* OUTPUTS */
49 /* *ioptr = output data array in the following order */
50 /* Re(x[0]), Re(x[N/2]), Re(x[1]), Im(x[1]), Re(x[2]), Im(x[2]), ... Re(x[N/2-1]), Im(x[N/2-1]). */
53 void driffts(double *ioptr, long M, long Rows, double *Utbl);
54 /* Compute in-place real ifft on the rows of the input array */
55 /* INPUTS */
56 /* M = log2 of fft size */
57 /* *ioptr = input data array in the following order */
58 /* Re(x[0]), Re(x[N/2]), Re(x[1]), Im(x[1]), Re(x[2]), Im(x[2]), ... Re(x[N/2-1]), Im(x[N/2-1]). */
59 /* *Utbl = cosine table */
60 /* Rows = number of rows in ioptr array (use Rows of 1 if ioptr is a 1 dimensional array) */
61 /* OUTPUTS */
62 /* *ioptr = real output data array */