1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 BUG_COMPONENT = ("Core", "Graphics: ImageLib")
54 # These files enable support for writing JPEGs
74 if CONFIG['LIBJPEG_TURBO_HAVE_VLD1_S16_X3']:
75 DEFINES['HAVE_VLD1_S16_X3'] = True
77 if CONFIG['LIBJPEG_TURBO_HAVE_VLD1_U16_X2']:
78 DEFINES['HAVE_VLD1_U16_X2'] = True
80 if CONFIG['LIBJPEG_TURBO_HAVE_VLD1Q_U8_X4']:
81 DEFINES['HAVE_VLD1Q_U8_X4'] = True
83 if CONFIG['LIBJPEG_TURBO_NEON_INTRINSICS']:
84 DEFINES['NEON_INTRINSICS'] = True
86 if CONFIG['LIBJPEG_TURBO_USE_NASM']:
89 if CONFIG['LIBJPEG_TURBO_SIMD_FLAGS']:
90 if CONFIG['CPU_ARCH'] == 'arm':
92 '/media/libjpeg/simd/arm',
93 '/media/libjpeg/simd/arm/aarch32',
96 'simd/arm/aarch32/jsimd.c',
100 'simd/arm/aarch32/jchuff-neon.c',
101 'simd/arm/jcgray-neon.c',
102 'simd/arm/jcphuff-neon.c',
103 'simd/arm/jcsample-neon.c',
104 'simd/arm/jdcolor-neon.c',
105 'simd/arm/jdmerge-neon.c',
106 'simd/arm/jdsample-neon.c',
107 'simd/arm/jfdctfst-neon.c',
108 'simd/arm/jfdctint-neon.c',
109 'simd/arm/jidctred-neon.c',
110 'simd/arm/jquanti-neon.c',
112 SOURCES += simd_sources
114 if CONFIG['LIBJPEG_TURBO_NEON_INTRINSICS']:
115 simd_sources_intrinsics = [
116 'simd/arm/jccolor-neon.c',
117 'simd/arm/jidctfst-neon.c',
118 'simd/arm/jidctint-neon.c',
120 SOURCES += simd_sources_intrinsics
121 simd_sources += simd_sources_intrinsics
124 'simd/arm/aarch32/jsimd_neon.S',
127 for srcfile in simd_sources:
128 SOURCES[srcfile].flags += CONFIG['LIBJPEG_TURBO_SIMD_FLAGS']
129 elif CONFIG['CPU_ARCH'] == 'aarch64':
131 '/media/libjpeg/simd/arm',
132 '/media/libjpeg/simd/arm/aarch64',
135 'simd/arm/aarch64/jsimd.c',
139 'simd/arm/jcgray-neon.c',
140 'simd/arm/jcphuff-neon.c',
141 'simd/arm/jcsample-neon.c',
142 'simd/arm/jdmerge-neon.c',
143 'simd/arm/jdsample-neon.c',
144 'simd/arm/jfdctfst-neon.c',
145 'simd/arm/jidctfst-neon.c',
146 'simd/arm/jidctred-neon.c',
147 'simd/arm/jquanti-neon.c',
149 SOURCES += simd_sources
151 if CONFIG['LIBJPEG_TURBO_NEON_INTRINSICS']:
152 simd_sources_intrinsics = [
153 'simd/arm/aarch64/jchuff-neon.c',
154 'simd/arm/jccolor-neon.c',
155 'simd/arm/jdcolor-neon.c',
156 'simd/arm/jfdctint-neon.c',
157 'simd/arm/jidctint-neon.c',
159 SOURCES += simd_sources_intrinsics
160 simd_sources += simd_sources_intrinsics
163 'simd/arm/aarch64/jsimd_neon.S',
166 for srcfile in simd_sources:
167 SOURCES[srcfile].flags += CONFIG['LIBJPEG_TURBO_SIMD_FLAGS']
168 elif CONFIG['CPU_ARCH'] == 'mips32':
171 'simd/mips/jsimd_dspr2.S',
173 if CONFIG['CC_TYPE'] == 'clang':
174 SOURCES['simd/mips/jsimd_dspr2.S'].flags += [
175 '-fno-integrated-as',
177 elif CONFIG['CPU_ARCH'] == 'mips64':
178 LOCAL_INCLUDES += ['/media/libjpeg/simd/mips64']
180 'simd/mips64/jccolor-mmi.c',
181 'simd/mips64/jcgray-mmi.c',
182 'simd/mips64/jcsample-mmi.c',
183 'simd/mips64/jdcolor-mmi.c',
184 'simd/mips64/jdmerge-mmi.c',
185 'simd/mips64/jdsample-mmi.c',
186 'simd/mips64/jfdctfst-mmi.c',
187 'simd/mips64/jfdctint-mmi.c',
188 'simd/mips64/jidctfst-mmi.c',
189 'simd/mips64/jidctint-mmi.c',
190 'simd/mips64/jquanti-mmi.c',
192 SOURCES += simd_sources
194 'simd/mips64/jsimd.c'
196 for srcfile in simd_sources:
197 SOURCES[srcfile].flags += CONFIG['LIBJPEG_TURBO_SIMD_FLAGS']
198 elif CONFIG['CPU_ARCH'] == 'x86_64':
200 'simd/x86_64/jccolor-avx2.asm',
201 'simd/x86_64/jccolor-sse2.asm',
202 'simd/x86_64/jcgray-avx2.asm',
203 'simd/x86_64/jcgray-sse2.asm',
204 'simd/x86_64/jchuff-sse2.asm',
205 'simd/x86_64/jcphuff-sse2.asm',
206 'simd/x86_64/jcsample-avx2.asm',
207 'simd/x86_64/jcsample-sse2.asm',
208 'simd/x86_64/jdcolor-avx2.asm',
209 'simd/x86_64/jdcolor-sse2.asm',
210 'simd/x86_64/jdmerge-avx2.asm',
211 'simd/x86_64/jdmerge-sse2.asm',
212 'simd/x86_64/jdsample-avx2.asm',
213 'simd/x86_64/jdsample-sse2.asm',
214 'simd/x86_64/jfdctflt-sse.asm',
215 'simd/x86_64/jfdctfst-sse2.asm',
216 'simd/x86_64/jfdctint-avx2.asm',
217 'simd/x86_64/jfdctint-sse2.asm',
218 'simd/x86_64/jidctflt-sse2.asm',
219 'simd/x86_64/jidctfst-sse2.asm',
220 'simd/x86_64/jidctint-avx2.asm',
221 'simd/x86_64/jidctint-sse2.asm',
222 'simd/x86_64/jidctred-sse2.asm',
223 'simd/x86_64/jquantf-sse2.asm',
224 'simd/x86_64/jquanti-avx2.asm',
225 'simd/x86_64/jquanti-sse2.asm',
226 'simd/x86_64/jsimd.c',
227 'simd/x86_64/jsimdcpu.asm',
229 elif CONFIG['CPU_ARCH'] == 'x86':
231 'simd/i386/jccolor-avx2.asm',
232 'simd/i386/jccolor-mmx.asm',
233 'simd/i386/jccolor-sse2.asm',
234 'simd/i386/jcgray-avx2.asm',
235 'simd/i386/jcgray-mmx.asm',
236 'simd/i386/jcgray-sse2.asm',
237 'simd/i386/jchuff-sse2.asm',
238 'simd/i386/jcphuff-sse2.asm',
239 'simd/i386/jcsample-avx2.asm',
240 'simd/i386/jcsample-mmx.asm',
241 'simd/i386/jcsample-sse2.asm',
242 'simd/i386/jdcolor-avx2.asm',
243 'simd/i386/jdcolor-mmx.asm',
244 'simd/i386/jdcolor-sse2.asm',
245 'simd/i386/jdmerge-avx2.asm',
246 'simd/i386/jdmerge-mmx.asm',
247 'simd/i386/jdmerge-sse2.asm',
248 'simd/i386/jdsample-avx2.asm',
249 'simd/i386/jdsample-mmx.asm',
250 'simd/i386/jdsample-sse2.asm',
251 'simd/i386/jfdctflt-3dn.asm',
252 'simd/i386/jfdctflt-sse.asm',
253 'simd/i386/jfdctfst-mmx.asm',
254 'simd/i386/jfdctfst-sse2.asm',
255 'simd/i386/jfdctint-avx2.asm',
256 'simd/i386/jfdctint-mmx.asm',
257 'simd/i386/jfdctint-sse2.asm',
258 'simd/i386/jidctflt-3dn.asm',
259 'simd/i386/jidctflt-sse.asm',
260 'simd/i386/jidctflt-sse2.asm',
261 'simd/i386/jidctfst-mmx.asm',
262 'simd/i386/jidctfst-sse2.asm',
263 'simd/i386/jidctint-avx2.asm',
264 'simd/i386/jidctint-mmx.asm',
265 'simd/i386/jidctint-sse2.asm',
266 'simd/i386/jidctred-mmx.asm',
267 'simd/i386/jidctred-sse2.asm',
268 'simd/i386/jquant-3dn.asm',
269 'simd/i386/jquant-mmx.asm',
270 'simd/i386/jquant-sse.asm',
271 'simd/i386/jquantf-sse2.asm',
272 'simd/i386/jquanti-avx2.asm',
273 'simd/i386/jquanti-sse2.asm',
275 'simd/i386/jsimdcpu.asm',
277 elif CONFIG['CPU_ARCH'].startswith('ppc'):
278 # PowerPC has no assembly files, but still needs its own headers.
279 LOCAL_INCLUDES += ['/media/libjpeg/simd/powerpc']
281 # For libjpeg's internal runtime detection to work, jsimd.c must NOT
282 # be compiled with -maltivec (otherwise it gets statically set),
283 # but everything else should be. If -maltivec was already
284 # specified in .mozconfig, though, then this won't harm anything.
286 'simd/powerpc/jccolor-altivec.c',
287 'simd/powerpc/jcgray-altivec.c',
288 'simd/powerpc/jcsample-altivec.c',
289 'simd/powerpc/jdcolor-altivec.c',
290 'simd/powerpc/jdmerge-altivec.c',
291 'simd/powerpc/jdsample-altivec.c',
292 'simd/powerpc/jfdctfst-altivec.c',
293 'simd/powerpc/jfdctint-altivec.c',
294 'simd/powerpc/jidctfst-altivec.c',
295 'simd/powerpc/jidctint-altivec.c',
296 'simd/powerpc/jquanti-altivec.c',
298 SOURCES += ppc_vmx_sources
300 'simd/powerpc/jsimd.c',
302 for srcfile in ppc_vmx_sources:
303 SOURCES[srcfile].flags += CONFIG['PPC_VMX_FLAGS']
304 else: # No SIMD support?
309 ASFLAGS += CONFIG['LIBJPEG_TURBO_SIMD_FLAGS']
311 # Make sure the x86 & x86-64 ASM files can see the necessary includes.
312 if CONFIG['CPU_ARCH'] == 'x86':
313 ASFLAGS += ['-I%s/media/libjpeg/simd/nasm/' % TOPSRCDIR]
314 ASFLAGS += ['-I%s/media/libjpeg/simd/i386/' % TOPSRCDIR]
315 if CONFIG['CPU_ARCH'] == 'x86_64':
316 ASFLAGS += ['-I%s/media/libjpeg/simd/nasm/' % TOPSRCDIR]
317 ASFLAGS += ['-I%s/media/libjpeg/simd/x86_64/' % TOPSRCDIR]
319 # We allow warnings for third-party code that can be updated from upstream.
320 AllowCompilerWarnings()
322 FINAL_LIBRARY = 'gkmedias'