OLD | NEW |
1 /*Copyright (c) 2003-2004, Mark Borgerding | 1 /*Copyright (c) 2003-2004, Mark Borgerding |
2 Lots of modifications by Jean-Marc Valin | 2 Lots of modifications by Jean-Marc Valin |
3 Copyright (c) 2005-2007, Xiph.Org Foundation | 3 Copyright (c) 2005-2007, Xiph.Org Foundation |
4 Copyright (c) 2008, Xiph.Org Foundation, CSIRO | 4 Copyright (c) 2008, Xiph.Org Foundation, CSIRO |
5 | 5 |
6 All rights reserved. | 6 All rights reserved. |
7 | 7 |
8 Redistribution and use in source and binary forms, with or without | 8 Redistribution and use in source and binary forms, with or without |
9 modification, are permitted provided that the following conditions are met: | 9 modification, are permitted provided that the following conditions are met: |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 }kiss_twiddle_cpx; | 72 }kiss_twiddle_cpx; |
73 | 73 |
74 #define MAXFACTORS 8 | 74 #define MAXFACTORS 8 |
75 /* e.g. an fft of length 128 has 4 factors | 75 /* e.g. an fft of length 128 has 4 factors |
76 as far as kissfft is concerned | 76 as far as kissfft is concerned |
77 4*4*4*2 | 77 4*4*4*2 |
78 */ | 78 */ |
79 | 79 |
80 typedef struct kiss_fft_state{ | 80 typedef struct kiss_fft_state{ |
81 int nfft; | 81 int nfft; |
82 #ifndef FIXED_POINT | 82 opus_val16 scale; |
83 kiss_fft_scalar scale; | 83 #ifdef FIXED_POINT |
| 84 int scale_shift; |
84 #endif | 85 #endif |
85 int shift; | 86 int shift; |
86 opus_int16 factors[2*MAXFACTORS]; | 87 opus_int16 factors[2*MAXFACTORS]; |
87 const opus_int16 *bitrev; | 88 const opus_int16 *bitrev; |
88 const kiss_twiddle_cpx *twiddles; | 89 const kiss_twiddle_cpx *twiddles; |
89 } kiss_fft_state; | 90 } kiss_fft_state; |
90 | 91 |
91 /*typedef struct kiss_fft_state* kiss_fft_cfg;*/ | 92 /*typedef struct kiss_fft_state* kiss_fft_cfg;*/ |
92 | 93 |
93 /** | 94 /** |
(...skipping 29 matching lines...) Expand all Loading... |
123 * Perform an FFT on a complex input buffer. | 124 * Perform an FFT on a complex input buffer. |
124 * for a forward FFT, | 125 * for a forward FFT, |
125 * fin should be f[0] , f[1] , ... ,f[nfft-1] | 126 * fin should be f[0] , f[1] , ... ,f[nfft-1] |
126 * fout will be F[0] , F[1] , ... ,F[nfft-1] | 127 * fout will be F[0] , F[1] , ... ,F[nfft-1] |
127 * Note that each element is complex and can be accessed like | 128 * Note that each element is complex and can be accessed like |
128 f[k].r and f[k].i | 129 f[k].r and f[k].i |
129 * */ | 130 * */ |
130 void opus_fft(const kiss_fft_state *cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fo
ut); | 131 void opus_fft(const kiss_fft_state *cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fo
ut); |
131 void opus_ifft(const kiss_fft_state *cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *f
out); | 132 void opus_ifft(const kiss_fft_state *cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *f
out); |
132 | 133 |
| 134 void opus_fft_impl(const kiss_fft_state *st,kiss_fft_cpx *fout); |
| 135 void opus_ifft_impl(const kiss_fft_state *st,kiss_fft_cpx *fout); |
| 136 |
133 void opus_fft_free(const kiss_fft_state *cfg); | 137 void opus_fft_free(const kiss_fft_state *cfg); |
134 | 138 |
135 #ifdef __cplusplus | 139 #ifdef __cplusplus |
136 } | 140 } |
137 #endif | 141 #endif |
138 | 142 |
139 #endif | 143 #endif |
OLD | NEW |