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