OLD | NEW |
---|---|
(Empty) | |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 declare_args() { | |
6 # Override this value to build with small float FFT tables | |
7 big_float_fft = true | |
brettw
2014/09/15 02:25:46
Can you prefix this with "openmax_" (since all dec
cjhopman
2014/09/16 01:40:32
Done.
| |
8 } | |
9 | |
10 config("dl_config") { | |
11 include_dirs = [ "../" ] | |
brettw
2014/09/15 02:25:46
You can delete the slash in here.
cjhopman
2014/09/16 01:40:32
Done.
| |
12 } | |
13 | |
14 # GYP: third_party/openmax_dl/dl/dl.gyp:openmax_dl | |
15 source_set("dl") { | |
16 direct_dependent_configs = [ ":dl_config" ] | |
17 sources = [ | |
18 "api/omxtypes.h", | |
19 "sp/api/omxSP.h", | |
20 "sp/src/armSP_FFT_F32TwiddleTable.c", | |
21 ] | |
22 | |
23 cflags = [] | |
24 deps = [] | |
25 defines = [] | |
26 | |
27 if (big_float_fft) { | |
28 defines += [ | |
29 "BIG_FFT_TABLE", | |
30 ] | |
31 } | |
32 | |
33 if (cpu_arch == "arm" || cpu_arch == "arm64") { | |
34 sources += [ | |
35 # Common files that are used by both arm and arm64 code. | |
36 "api/arm/armOMX.h", | |
37 "api/arm/omxtypes_s.h", | |
38 "sp/api/armSP.h", | |
39 "sp/src/arm/armSP_FFT_S32TwiddleTable.c", | |
40 "sp/src/arm/omxSP_FFTGetBufSize_C_FC32.c", | |
41 "sp/src/arm/omxSP_FFTGetBufSize_C_SC32.c", | |
42 "sp/src/arm/omxSP_FFTGetBufSize_R_F32.c", | |
43 "sp/src/arm/omxSP_FFTGetBufSize_R_S32.c", | |
44 "sp/src/arm/omxSP_FFTInit_C_FC32.c", | |
45 "sp/src/arm/omxSP_FFTInit_R_F32.c", | |
46 ] | |
47 } | |
48 | |
49 if (cpu_arch == "arm") { | |
50 configs -= [ "//build/config/compiler:compiler_arm_fpu" ] | |
51 cflags += [ | |
52 "-mfpu=neon" | |
53 ] | |
54 | |
55 deps += [ | |
56 ":openmax_dl_armv7" | |
57 ] | |
58 | |
59 sources += [ | |
60 # Common files that are used by both the NEON and non-NEON code. | |
61 "api/armCOMM_s.h", | |
62 "sp/src/arm/omxSP_FFTGetBufSize_C_SC16.c", | |
63 "sp/src/arm/omxSP_FFTGetBufSize_R_S16.c", | |
64 "sp/src/arm/omxSP_FFTGetBufSize_R_S16S32.c", | |
65 "sp/src/arm/omxSP_FFTInit_C_SC16.c", | |
66 "sp/src/arm/omxSP_FFTInit_C_SC32.c", | |
67 "sp/src/arm/omxSP_FFTInit_R_S16.c", | |
68 "sp/src/arm/omxSP_FFTInit_R_S16S32.c", | |
69 "sp/src/arm/omxSP_FFTInit_R_S32.c", | |
70 | |
71 # Complex 32-bit fixed-point FFT. | |
72 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_fs_unsafe_s.S", | |
73 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_ls_unsafe_s.S", | |
74 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_unsafe_s.S", | |
75 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_fs_unsafe_s.S", | |
76 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_ls_unsafe_s.S", | |
77 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_unsafe_s.S", | |
78 "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix8_fs_unsafe_s.S", | |
79 "sp/src/arm/neon/omxSP_FFTFwd_CToC_SC32_Sfs_s.S", | |
80 "sp/src/arm/neon/omxSP_FFTInv_CToC_SC32_Sfs_s.S", | |
81 # Real 32-bit fixed-point FFT | |
82 "sp/src/arm/neon/armSP_FFTInv_CCSToR_S32_preTwiddleRadix2_unsafe_s.S", | |
83 "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S32_Sfs_s.S", | |
84 "sp/src/arm/neon/omxSP_FFTInv_CCSToR_S32_Sfs_s.S", | |
85 # Complex 16-bit fixed-point FFT | |
86 "sp/src/arm/neon/armSP_FFTInv_CCSToR_S16_preTwiddleRadix2_unsafe_s.S", | |
87 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_fs_unsafe_s.S", | |
88 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_ls_unsafe_s.S", | |
89 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_ps_unsafe_s.S", | |
90 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_unsafe_s.S", | |
91 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_fs_unsafe_s.S", | |
92 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_ls_unsafe_s.S", | |
93 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_unsafe_s.S", | |
94 "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix8_fs_unsafe_s.S", | |
95 "sp/src/arm/neon/omxSP_FFTFwd_CToC_SC16_Sfs_s.S", | |
96 "sp/src/arm/neon/omxSP_FFTInv_CToC_SC16_Sfs_s.S", | |
97 # Real 16-bit fixed-point FFT | |
98 "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S16_Sfs_s.S", | |
99 "sp/src/arm/neon/omxSP_FFTInv_CCSToR_S16_Sfs_s.S", | |
100 "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S16S32_Sfs_s.S", | |
101 "sp/src/arm/neon/omxSP_FFTInv_CCSToR_S32S16_Sfs_s.S", | |
102 # Complex floating-point FFT | |
103 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_fs_unsafe_s.S", | |
104 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_ls_unsafe_s.S", | |
105 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_unsafe_s.S", | |
106 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_fs_unsafe_s.S", | |
107 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_ls_unsafe_s.S", | |
108 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_unsafe_s.S", | |
109 "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix8_fs_unsafe_s.S", | |
110 "sp/src/arm/neon/omxSP_FFTFwd_CToC_FC32_Sfs_s.S", | |
111 "sp/src/arm/neon/omxSP_FFTInv_CToC_FC32_Sfs_s.S", | |
112 # Real floating-point FFT | |
113 "sp/src/arm/neon/armSP_FFTInv_CCSToR_F32_preTwiddleRadix2_unsafe_s.S", | |
114 "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S", | |
115 "sp/src/arm/neon/omxSP_FFTInv_CCSToR_F32_Sfs_s.S", | |
116 ] | |
117 } | |
118 | |
119 if (cpu_arch == "ia32" || cpu_arch == "x64") { | |
120 cflags += [ | |
121 "-msse2" | |
122 ] | |
123 | |
124 sources += [ | |
125 # Real 32-bit floating-point FFT. | |
126 "sp/api/x86SP.h", | |
127 "sp/src/x86/omxSP_FFTFwd_RToCCS_F32_Sfs.c", | |
128 "sp/src/x86/omxSP_FFTGetBufSize_R_F32.c", | |
129 "sp/src/x86/omxSP_FFTInit_R_F32.c", | |
130 "sp/src/x86/omxSP_FFTInv_CCSToR_F32_Sfs.c", | |
131 "sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix2_fs.c", | |
132 "sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix2_ls.c", | |
133 "sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix2_ls_sse.c", | |
134 "sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix2_ms.c", | |
135 "sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix4_fs.c", | |
136 "sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix4_fs_sse.c", | |
137 "sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix4_ls.c", | |
138 "sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix4_ls_sse.c", | |
139 "sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix4_ms.c", | |
140 "sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix4_ms_sse.c", | |
141 "sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix2_fs.c", | |
142 "sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix2_ls.c", | |
143 "sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix2_ls_sse.c", | |
144 "sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix2_ms.c", | |
145 "sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix4_fs.c", | |
146 "sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix4_fs_sse.c", | |
147 "sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix4_ls.c", | |
148 "sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix4_ls_sse.c", | |
149 "sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix4_ms.c", | |
150 "sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix4_ms_sse.c", | |
151 "sp/src/x86/x86SP_FFT_F32_radix2_kernel.c", | |
152 "sp/src/x86/x86SP_FFT_F32_radix4_kernel.c", | |
153 "sp/src/x86/x86SP_SSE_Math.h", | |
154 ] | |
155 } | |
156 if (cpu_arch == "arm64") { | |
157 sources += [ | |
158 "api/arm/arm64COMM_s.h", | |
159 | |
160 # Complex floating-point FFT | |
161 "sp/src/arm/arm64/armSP_FFT_CToC_FC32_Radix2_fs_s.S", | |
162 "sp/src/arm/arm64/armSP_FFT_CToC_FC32_Radix2_ls_s.S", | |
163 "sp/src/arm/arm64/armSP_FFT_CToC_FC32_Radix2_s.S", | |
164 "sp/src/arm/arm64/armSP_FFT_CToC_FC32_Radix4_fs_s.S", | |
165 "sp/src/arm/arm64/armSP_FFT_CToC_FC32_Radix4_ls_s.S", | |
166 "sp/src/arm/arm64/armSP_FFT_CToC_FC32_Radix4_s.S", | |
167 "sp/src/arm/arm64/armSP_FFT_CToC_FC32_Radix8_fs_s.S", | |
168 "sp/src/arm/arm64/omxSP_FFTInv_CToC_FC32.c", | |
169 "sp/src/arm/arm64/omxSP_FFTFwd_CToC_FC32.c", | |
170 # Real floating-point FFT | |
171 "sp/src/arm/arm64/armSP_FFTInv_CCSToR_F32_preTwiddleRadix2_s.S", | |
172 "sp/src/arm/arm64/omxSP_FFTFwd_RToCCS_F32.c", | |
173 "sp/src/arm/arm64/ComplexToRealFixup.S", | |
174 "sp/src/arm/arm64/omxSP_FFTInv_CCSToR_F32.c", | |
175 ] | |
176 } | |
177 if (cpu_arch == "mipsel") { | |
178 cflags += [ | |
179 "-std=c99", | |
180 ] | |
181 sources -= [ | |
182 "sp/src/armSP_FFT_F32TwiddleTable.c", | |
183 ] | |
184 | |
185 sources += [ | |
186 "sp/api/mipsSP.h", | |
187 "sp/src/mips/mips_FFTFwd_RToCCS_F32_complex.c", | |
188 "sp/src/mips/mips_FFTFwd_RToCCS_F32_real.c", | |
189 "sp/src/mips/mips_FFTInv_CCSToR_F32_complex.c", | |
190 "sp/src/mips/mips_FFTInv_CCSToR_F32_real.c", | |
191 "sp/src/mips/omxSP_FFT_F32TwiddleTable.c", | |
192 "sp/src/mips/omxSP_FFTFwd_RToCCS_F32_Sfs.c", | |
193 "sp/src/mips/omxSP_FFTGetBufSize_R_F32.c", | |
194 "sp/src/mips/omxSP_FFTInit_R_F32.c", | |
195 "sp/src/mips/omxSP_FFTInv_CCSToR_F32_Sfs.c", | |
196 ] | |
197 } | |
198 } | |
199 | |
200 if (cpu_arch == "arm") { | |
201 # GYP: third_party/openmax_dl/dl/dl.gyp:openmax_dl | |
202 # Non-NEON implementation of FFT. This library is NOT | |
203 # standalone. Applications must link with openmax_dl. | |
204 source_set("openmax_dl_armv7") { | |
205 configs += [ ":dl_config" ] | |
206 deps = [ "//third_party/android_tools:cpu_features" ] | |
207 visibility = [ ":*" ] | |
208 | |
209 #TODO(GYP): | |
210 #'cflags!': [ | |
211 #'-mfpu=neon', | |
212 #], | |
213 | |
214 libs = [ "log" ] | |
215 | |
216 sources = [ | |
217 # Detection routine | |
218 "sp/src/arm/detect.c", | |
219 # Complex floating-point FFT | |
220 "sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix2_fs_unsafe_s.S", | |
221 "sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix4_fs_unsafe_s.S", | |
222 "sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix4_unsafe_s.S", | |
223 "sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix8_fs_unsafe_s.S", | |
224 "sp/src/arm/armv7/omxSP_FFTInv_CToC_FC32_Sfs_s.S", | |
225 "sp/src/arm/armv7/omxSP_FFTFwd_CToC_FC32_Sfs_s.S", | |
226 # Real floating-point FFT | |
227 "sp/src/arm/armv7/armSP_FFTInv_CCSToR_F32_preTwiddleRadix2_unsafe_s.S", | |
228 "sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S", | |
229 "sp/src/arm/armv7/omxSP_FFTInv_CCSToR_F32_Sfs_s.S", | |
230 ] | |
231 } | |
232 } | |
OLD | NEW |