a4644f14bfdb7f77cbc8162433f3cbecc80326bc
[platform/framework/web/crosswalk.git] / src / third_party / openmax_dl / dl / dl.gyp
1 #  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
2 #
3 #  Use of this source code is governed by a BSD-style license
4 #  that can be found in the LICENSE file in the root of the source
5 #  tree. An additional intellectual property rights grant can be found
6 #  in the file PATENTS.  All contributing project authors may
7 #  be found in the AUTHORS file in the root of the source tree.
8
9 {
10   'variables' : {
11     # Override this value to build with small float FFT tables
12     'big_float_fft%' : 1,
13   },
14   'target_defaults': {
15     'include_dirs': [
16       '../',
17     ],
18     'conditions' : [
19       ['target_arch=="arm"', {
20         'conditions' : [
21           ['arm_neon==1', {
22             # Enable build-time NEON selection.
23             'defines': ['DL_ARM_NEON',],
24             'direct_dependent_settings': {
25               'defines': ['DL_ARM_NEON',],
26             },
27           }],
28           ['arm_neon==0 and OS=="android"', {
29             # Enable run-time NEON selection.
30             'defines': ['DL_ARM_NEON_OPTIONAL',],
31             'direct_dependent_settings': {
32               'defines': ['DL_ARM_NEON_OPTIONAL',],
33             },
34           }],
35         ],
36       }],
37       ['target_arch=="arm64"', {
38         # Enable build-time NEON selection.
39         'defines': ['DL_ARM_NEON',],
40         'direct_dependent_settings': {
41           'defines': ['DL_ARM_NEON',],
42         },
43       }],
44     ],
45   },
46   'targets': [
47     {
48       'target_name': 'openmax_dl',
49       'type': 'static_library',
50       'direct_dependent_settings': {
51         'include_dirs': [
52           '../',
53         ],
54       },
55       'sources': [
56         'api/omxtypes.h',
57         'sp/api/omxSP.h',
58         'sp/src/armSP_FFT_F32TwiddleTable.c',
59       ],
60       'conditions' : [
61         ['big_float_fft==1', {
62           'defines': [
63             'BIG_FFT_TABLE',
64           ],
65         }],
66         ['target_arch=="arm" or target_arch=="arm64"', {
67           'sources':[
68             # Common files that are used by both arm and arm64 code.
69             'api/arm/armOMX.h',
70             'api/arm/omxtypes_s.h',
71             'sp/api/armSP.h',
72             'sp/src/arm/armSP_FFT_S32TwiddleTable.c',
73             'sp/src/arm/omxSP_FFTGetBufSize_C_FC32.c',
74             'sp/src/arm/omxSP_FFTGetBufSize_C_SC32.c',
75             'sp/src/arm/omxSP_FFTGetBufSize_R_F32.c',
76             'sp/src/arm/omxSP_FFTGetBufSize_R_S32.c',
77             'sp/src/arm/omxSP_FFTInit_C_FC32.c',
78             'sp/src/arm/omxSP_FFTInit_R_F32.c',
79           ],
80         }],
81         ['target_arch=="arm"', {
82           'conditions': [
83             ['arm_neon==0 or OS=="android"', {
84               'dependencies': [
85                 'openmax_dl_armv7',
86               ],
87             }],
88             ['arm_neon==1 or OS=="android"', {
89               'cflags!': [
90                 '-mfpu=vfpv3-d16',
91               ],
92               'cflags': [
93                 '-mfpu=neon',
94               ],
95               'sources': [
96                 # Common files that are used by both the NEON and non-NEON code.
97                 'api/armCOMM_s.h',
98                 'sp/src/arm/omxSP_FFTGetBufSize_C_SC16.c',
99                 'sp/src/arm/omxSP_FFTGetBufSize_R_S16.c',
100                 'sp/src/arm/omxSP_FFTGetBufSize_R_S16S32.c',
101                 'sp/src/arm/omxSP_FFTInit_C_SC16.c',
102                 'sp/src/arm/omxSP_FFTInit_C_SC32.c',
103                 'sp/src/arm/omxSP_FFTInit_R_S16.c',
104                 'sp/src/arm/omxSP_FFTInit_R_S16S32.c',
105                 'sp/src/arm/omxSP_FFTInit_R_S32.c',
106
107                 # Complex 32-bit fixed-point FFT.
108                 'sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_fs_unsafe_s.S',
109                 'sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_ls_unsafe_s.S',
110                 'sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_fs_unsafe_s.S',
111                 'sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_fs_unsafe_s.S',
112                 'sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_ls_unsafe_s.S',
113                 'sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_unsafe_s.S',
114                 'sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_unsafe_s.S',
115                 'sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix8_fs_unsafe_s.S',
116                 'sp/src/arm/neon/omxSP_FFTInv_CToC_SC32_Sfs_s.S',
117                 'sp/src/arm/neon/omxSP_FFTFwd_CToC_SC32_Sfs_s.S',
118                 # Real 32-bit fixed-point FFT
119                 'sp/src/arm/neon/armSP_FFTInv_CCSToR_S32_preTwiddleRadix2_unsafe_s.S',
120                 'sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S32_Sfs_s.S',
121                 'sp/src/arm/neon/omxSP_FFTInv_CCSToR_S32_Sfs_s.S',
122                 # Complex 16-bit fixed-point FFT
123                 'sp/src/arm/neon/armSP_FFTInv_CCSToR_S16_preTwiddleRadix2_unsafe_s.S',
124                 'sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_fs_unsafe_s.S',
125                 'sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_ls_unsafe_s.S',
126                 'sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_ps_unsafe_s.S',
127                 'sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_unsafe_s.S',
128                 'sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_fs_unsafe_s.S',
129                 'sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_ls_unsafe_s.S',
130                 'sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_unsafe_s.S',
131                 'sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix8_fs_unsafe_s.S',
132                 'sp/src/arm/neon/omxSP_FFTFwd_CToC_SC16_Sfs_s.S',
133                 'sp/src/arm/neon/omxSP_FFTInv_CToC_SC16_Sfs_s.S',
134                 # Real 16-bit fixed-point FFT
135                 'sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S16_Sfs_s.S',
136                 'sp/src/arm/neon/omxSP_FFTInv_CCSToR_S16_Sfs_s.S',
137                 'sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S16S32_Sfs_s.S',
138                 'sp/src/arm/neon/omxSP_FFTInv_CCSToR_S32S16_Sfs_s.S',
139                 # Complex floating-point FFT
140                 'sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_fs_unsafe_s.S',
141                 'sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_ls_unsafe_s.S',
142                 'sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_fs_unsafe_s.S',
143                 'sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_fs_unsafe_s.S',
144                 'sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_ls_unsafe_s.S',
145                 'sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_unsafe_s.S',
146                 'sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_unsafe_s.S',
147                 'sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix8_fs_unsafe_s.S',
148                 'sp/src/arm/neon/omxSP_FFTInv_CToC_FC32_Sfs_s.S',
149                 'sp/src/arm/neon/omxSP_FFTFwd_CToC_FC32_Sfs_s.S',
150                 # Real floating-point FFT
151                 'sp/src/arm/neon/armSP_FFTInv_CCSToR_F32_preTwiddleRadix2_unsafe_s.S',
152                 'sp/src/arm/neon/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S',
153                 'sp/src/arm/neon/omxSP_FFTInv_CCSToR_F32_Sfs_s.S',
154               ],
155             }],
156           ],
157         }],
158         ['target_arch=="ia32" or target_arch=="x64"', {
159           'cflags': [
160             '-msse2',
161           ],
162           'sources': [
163             # Real 32-bit floating-point FFT.
164             'sp/api/x86SP.h',
165             'sp/src/x86/omxSP_FFTFwd_RToCCS_F32_Sfs.c',
166             'sp/src/x86/omxSP_FFTGetBufSize_R_F32.c',
167             'sp/src/x86/omxSP_FFTInit_R_F32.c',
168             'sp/src/x86/omxSP_FFTInv_CCSToR_F32_Sfs.c',
169             'sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix2_fs.c',
170             'sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix2_ls.c',
171             'sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix2_ls_sse.c',
172             'sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix2_ms.c',
173             'sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix4_fs.c',
174             'sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix4_fs_sse.c',
175             'sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix4_ls.c',
176             'sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix4_ls_sse.c',
177             'sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix4_ms.c',
178             'sp/src/x86/x86SP_FFT_CToC_FC32_Fwd_Radix4_ms_sse.c',
179             'sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix2_fs.c',
180             'sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix2_ls.c',
181             'sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix2_ls_sse.c',
182             'sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix2_ms.c',
183             'sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix4_fs.c',
184             'sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix4_fs_sse.c',
185             'sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix4_ls.c',
186             'sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix4_ls_sse.c',
187             'sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix4_ms.c',
188             'sp/src/x86/x86SP_FFT_CToC_FC32_Inv_Radix4_ms_sse.c',
189             'sp/src/x86/x86SP_FFT_F32_radix2_kernel.c',
190             'sp/src/x86/x86SP_FFT_F32_radix4_kernel.c',
191             'sp/src/x86/x86SP_SSE_Math.h',
192           ],
193         }],
194         ['target_arch=="arm64"', {
195           'sources':[
196             'api/arm/arm64COMM_s.h',
197
198             # Complex floating-point FFT
199             'sp/src/arm/arm64/armSP_FFT_CToC_FC32_Radix2_fs_s.S',
200             'sp/src/arm/arm64/armSP_FFT_CToC_FC32_Radix2_ls_s.S',
201             'sp/src/arm/arm64/armSP_FFT_CToC_FC32_Radix2_s.S',
202             'sp/src/arm/arm64/armSP_FFT_CToC_FC32_Radix4_fs_s.S',
203             'sp/src/arm/arm64/armSP_FFT_CToC_FC32_Radix4_ls_s.S',
204             'sp/src/arm/arm64/armSP_FFT_CToC_FC32_Radix4_s.S',
205             'sp/src/arm/arm64/armSP_FFT_CToC_FC32_Radix8_fs_s.S',
206             'sp/src/arm/arm64/omxSP_FFTInv_CToC_FC32.c',
207             'sp/src/arm/arm64/omxSP_FFTFwd_CToC_FC32.c',
208             # Real floating-point FFT
209             'sp/src/arm/arm64/armSP_FFTInv_CCSToR_F32_preTwiddleRadix2_s.S',
210             'sp/src/arm/arm64/omxSP_FFTFwd_RToCCS_F32.c',
211             'sp/src/arm/arm64/ComplexToRealFixup.S',
212             'sp/src/arm/arm64/omxSP_FFTInv_CCSToR_F32.c',
213           ],
214         }],
215         ['target_arch=="mipsel"', {
216           'cflags': [
217             '-std=c99',
218           ],
219           'sources!': [
220             'sp/src/armSP_FFT_F32TwiddleTable.c',
221           ],
222           'sources': [
223             'sp/api/mipsSP.h',
224             'sp/src/mips/mips_FFTFwd_RToCCS_F32_complex.c',
225             'sp/src/mips/mips_FFTFwd_RToCCS_F32_real.c',
226             'sp/src/mips/mips_FFTInv_CCSToR_F32_complex.c',
227             'sp/src/mips/mips_FFTInv_CCSToR_F32_real.c',
228             'sp/src/mips/omxSP_FFT_F32TwiddleTable.c',
229             'sp/src/mips/omxSP_FFTFwd_RToCCS_F32_Sfs.c',
230             'sp/src/mips/omxSP_FFTGetBufSize_R_F32.c',
231             'sp/src/mips/omxSP_FFTInit_R_F32.c',
232             'sp/src/mips/omxSP_FFTInv_CCSToR_F32_Sfs.c',
233           ],
234         }],
235       ],
236     },
237   ],
238   'conditions': [
239     ['target_arch=="arm"', {
240       'targets': [
241         {
242           # Non-NEON implementation of FFT. This library is NOT
243           # standalone. Applications must link with openmax_dl.
244           'target_name': 'openmax_dl_armv7',
245           'type': 'static_library',
246           'cflags!': [
247             '-mfpu=neon',
248           ],
249           'sources': [
250             # Complex floating-point FFT
251             'sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix2_fs_unsafe_s.S',
252             'sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix2_fs_unsafe_s.S',
253             'sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix4_fs_unsafe_s.S',
254             'sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix4_unsafe_s.S',
255             'sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix8_fs_unsafe_s.S',
256             'sp/src/arm/armv7/omxSP_FFTInv_CToC_FC32_Sfs_s.S',
257             'sp/src/arm/armv7/omxSP_FFTFwd_CToC_FC32_Sfs_s.S',
258             # Real floating-point FFT
259             'sp/src/arm/armv7/armSP_FFTInv_CCSToR_F32_preTwiddleRadix2_unsafe_s.S',
260             'sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S',
261             'sp/src/arm/armv7/omxSP_FFTInv_CCSToR_F32_Sfs_s.S',
262           ],
263           'conditions': [
264             ['OS=="android"', {
265               # We only do run-time NEON detection on Android.
266               'includes': [
267                 '../../../build/android/cpufeatures.gypi',
268               ],
269               'link_settings' : {
270                 'libraries': [
271                   # To get the __android_log_print routine
272                   '-llog',
273                 ],
274               },
275               'sources': [
276                 # Detection routine
277                 'sp/src/arm/detect.c',
278               ],
279             }],
280           ],
281         },
282       ],
283     }],
284   ],
285 }