blob: 98b253958121709c9c081dfac042859990a631f4 [file] [log] [blame]
Dees_Troy51a0e822012-09-05 15:24:24 -04001LOCAL_PATH:= $(call my-dir)
2include $(CLEAR_VARS)
3
4LOCAL_ARM_MODE := arm
5
6# Set ANDROID_JPEG_USE_VENUM to true to enable VeNum optimizations
7ANDROID_JPEG_USE_VENUM := true
8
9# Disable VeNum optimizations if they are not supported on the build target
10ifneq ($(ARCH_ARM_HAVE_VFP),true)
11ANDROID_JPEG_USE_VENUM := false
12else
13ifneq ($(ARCH_ARM_HAVE_NEON),true)
14ANDROID_JPEG_USE_VENUM := false
15endif
16endif
17
18LOCAL_SRC_FILES := \
19 jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c \
20 jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c \
21 jcphuff.c jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c \
22 jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c \
23 jdinput.c jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c \
24 jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c \
25 jfdctint.c jidctflt.c jquant1.c \
26 jquant2.c jutils.c jmemmgr.c \
27
28# use ashmem as libjpeg decoder's backing store
29LOCAL_CFLAGS += -DUSE_ANDROID_ASHMEM
30LOCAL_SRC_FILES += \
31 jmem-ashmem.c
32
33# the original android memory manager.
34# use sdcard as libjpeg decoder's backing store
35#LOCAL_SRC_FILES += \
36# jmem-android.c
37
38
39# the assembler is only for the ARM version, don't break the Linux sim
40ifneq ($(TARGET_ARCH),arm)
41ANDROID_JPEG_NO_ASSEMBLER := true
42endif
43
44ifeq ($(strip $(ANDROID_JPEG_NO_ASSEMBLER)),true)
45LOCAL_SRC_FILES += jidctint.c jidctfst.c jidctred.c
46else
47ifeq ($(ANDROID_JPEG_USE_VENUM),true)
48LOCAL_SRC_FILES += jidctvenum.c
49LOCAL_SRC_FILES += asm/armv7/jdcolor-armv7.S
50LOCAL_SRC_FILES += asm/armv7/jdcolor-android-armv7.S
51LOCAL_SRC_FILES += asm/armv7/jdidct-armv7.S
52LOCAL_CFLAGS += -DANDROID_JPEG_USE_VENUM
53else # ANDROID_JPEG_USE_VENUM, false
54LOCAL_SRC_FILES += jidctint.c jidctred.c jidctfst.c armv6_idct.S
55LOCAL_CFLAGS += -DANDROID_ARMV6_IDCT
56endif # ANDROID_JPEG_USE_VENUM
57endif
58
59LOCAL_CFLAGS += -DAVOID_TABLES
60LOCAL_CFLAGS += -O3 -fstrict-aliasing -fprefetch-loop-arrays
61
62# enable tile based decode
63LOCAL_CFLAGS += -DANDROID_TILE_BASED_DECODE
64
65ifdef NEEDS_ARM_ERRATA_754319_754320
66asm_flags := \
67 --defsym NEEDS_ARM_ERRATA_754319_754320_ASM=1
68
69LOCAL_CFLAGS+= \
70 $(foreach f,$(asm_flags),-Wa,"$(f)")
71endif
Dees_Troy2673cec2013-04-02 20:22:16 +000072LOCAL_MODULE_TAGS := eng
73LOCAL_SHARED_LIBRARIES += libcutils
Dees_Troy51a0e822012-09-05 15:24:24 -040074LOCAL_MODULE:= libjpegtwrp
75
Dees_Troy51a0e822012-09-05 15:24:24 -040076include $(BUILD_STATIC_LIBRARY)
77