comparison fft.c @ 10407:57acce8b1380 libavcodec

Move/add COSTABLE/SINTABLE macros to dsputil to add extern definitions for ff_cos_* and ff_sin_* without introducing too much code duplication.
author reimar
date Thu, 15 Oct 2009 17:55:51 +0000
parents 866dffa620d1
children 63910f7ba293
comparison
equal deleted inserted replaced
10406:825c7f57cfac 10407:57acce8b1380
26 * FFT/IFFT transforms. 26 * FFT/IFFT transforms.
27 */ 27 */
28 28
29 #include "dsputil.h" 29 #include "dsputil.h"
30 30
31 #if CONFIG_HARDCODED_TABLES 31 /* cos(2*pi*x/n) for 0<=x<=n/4, followed by its reverse */
32 #define COSTABLE(size) \ 32 #if !CONFIG_HARDCODED_TABLES
33 extern const DECLARE_ALIGNED_16(FFTSample, ff_cos_##size[size/2]); 33 COSTABLE(16);
34 #else 34 COSTABLE(32);
35 #define COSTABLE(size) \ 35 COSTABLE(64);
36 DECLARE_ALIGNED_16(FFTSample, ff_cos_##size[size/2]); 36 COSTABLE(128);
37 COSTABLE(256);
38 COSTABLE(512);
39 COSTABLE(1024);
40 COSTABLE(2048);
41 COSTABLE(4096);
42 COSTABLE(8192);
43 COSTABLE(16384);
44 COSTABLE(32768);
45 COSTABLE(65536);
37 #endif 46 #endif
38 47 COSTABLE_CONST FFTSample * const ff_cos_tabs[] = {
39 /* cos(2*pi*x/n) for 0<=x<=n/4, followed by its reverse */
40 COSTABLE(16)
41 COSTABLE(32)
42 COSTABLE(64)
43 COSTABLE(128)
44 COSTABLE(256)
45 COSTABLE(512)
46 COSTABLE(1024)
47 COSTABLE(2048)
48 COSTABLE(4096)
49 COSTABLE(8192)
50 COSTABLE(16384)
51 COSTABLE(32768)
52 COSTABLE(65536)
53 #if CONFIG_HARDCODED_TABLES
54 const
55 #endif
56 FFTSample * const ff_cos_tabs[] = {
57 ff_cos_16, ff_cos_32, ff_cos_64, ff_cos_128, ff_cos_256, ff_cos_512, ff_cos_1024, 48 ff_cos_16, ff_cos_32, ff_cos_64, ff_cos_128, ff_cos_256, ff_cos_512, ff_cos_1024,
58 ff_cos_2048, ff_cos_4096, ff_cos_8192, ff_cos_16384, ff_cos_32768, ff_cos_65536, 49 ff_cos_2048, ff_cos_4096, ff_cos_8192, ff_cos_16384, ff_cos_32768, ff_cos_65536,
59 }; 50 };
60 51
61 static int split_radix_permutation(int i, int n, int inverse) 52 static int split_radix_permutation(int i, int n, int inverse)