Mercurial > hg > peckfft
comparison peck_fft.c @ 9:8726585681f6
backup
author | Peter Meerwald <p.meerwald@bct-electronic.com> |
---|---|
date | Wed, 21 Sep 2011 12:18:40 +0200 |
parents | 707be088ccc3 |
children | 05f6ab0a17c0 |
comparison
equal
deleted
inserted
replaced
8:f2d3b39267ee | 9:8726585681f6 |
---|---|
10 * Neither the author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. | 10 * Neither the author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
11 | 11 |
12 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 12 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
13 */ | 13 */ |
14 | 14 |
15 | 15 #include "armv7_cycles.h" |
16 #include "_peck_fft_guts.h" | 16 #include "_peck_fft_guts.h" |
17 /* The guts header contains all the multiplication and addition macros that are defined for | 17 /* The guts header contains all the multiplication and addition macros that are defined for |
18 * fixed or floating point complex numbers. It also delares the kf_ internal functions. | 18 * fixed or floating point complex numbers. It also delares the kf_ internal functions. |
19 */ | 19 */ |
20 | 20 #if !BFLY2_ASM |
21 static void kf_bfly2( | 21 static void kf_bfly2( |
22 peck_fft_cpx *Fout, | 22 peck_fft_cpx *Fout, |
23 const size_t fstride, | 23 const size_t fstride, |
24 const peck_fft_cfg st, | 24 const peck_fft_cfg st, |
25 int m) { | 25 int m) { |
26 | 26 |
27 // printf("kf_bfly2, %d\n", fstride); | 27 // printf("kf_bfly2, %d\n", fstride); |
28 | 28 |
29 peck_fft_cpx *Fout2; | 29 peck_fft_cpx * __restrict tw1 = st->twiddles; |
30 peck_fft_cpx *tw1 = st->twiddles; | 30 peck_fft_cpx * __restrict Fout2 = Fout + m; |
31 peck_fft_cpx t; | |
32 Fout2 = Fout + m; | |
33 do { | 31 do { |
32 peck_fft_cpx t; | |
34 C_MUL(t, *Fout2, *tw1); | 33 C_MUL(t, *Fout2, *tw1); |
35 tw1 += fstride; | 34 tw1 += fstride; |
36 C_SUB(*Fout2, *Fout, t); | 35 C_SUB(*Fout2, *Fout, t); |
37 C_ADDTO(*Fout, t); | 36 C_ADDTO(*Fout, t); |
38 ++Fout2; | 37 ++Fout2; |
39 ++Fout; | 38 ++Fout; |
40 } while (--m); | 39 } while (--m); |
41 } | 40 } |
41 #endif | |
42 | 42 |
43 static void kf_bfly4( | 43 static void kf_bfly4( |
44 peck_fft_cpx * Fout, | 44 peck_fft_cpx * Fout, |
45 const size_t fstride, | 45 const size_t fstride, |
46 const peck_fft_cfg st, | 46 const peck_fft_cfg st, |
262 | 262 |
263 Fout = Fout_beg; | 263 Fout = Fout_beg; |
264 | 264 |
265 // recombine the p smaller DFTs | 265 // recombine the p smaller DFTs |
266 switch (p) { | 266 switch (p) { |
267 case 2: kf_bfly2(Fout, fstride, st, m); break; | 267 case 2: |
268 kf_bfly2(Fout, fstride, st, m); | |
269 break; | |
268 case 3: kf_bfly3(Fout, fstride, st, m); break; | 270 case 3: kf_bfly3(Fout, fstride, st, m); break; |
269 case 4: kf_bfly4(Fout, fstride, st, m); break; | 271 case 4: kf_bfly4(Fout, fstride, st, m); break; |
270 case 5: kf_bfly5(Fout, fstride, st, m); break; | 272 case 5: kf_bfly5(Fout, fstride, st, m); break; |
271 default: kf_bfly_generic(Fout, fstride, st, m, p); break; | 273 default: kf_bfly_generic(Fout, fstride, st, m, p); break; |
272 } | 274 } |