2013-10-04 11:26:37 +02:00
|
|
|
LOCAL_PATH := $(call my-dir)
|
|
|
|
|
|
|
|
WEBP_CFLAGS := -Wall -DANDROID -DHAVE_MALLOC_H -DHAVE_PTHREAD -DWEBP_USE_THREAD
|
2016-11-19 04:19:13 +01:00
|
|
|
WEBP_CFLAGS += -fvisibility=hidden
|
2013-10-04 11:26:37 +02:00
|
|
|
|
|
|
|
ifeq ($(APP_OPTIM),release)
|
2014-02-08 05:31:44 +01:00
|
|
|
WEBP_CFLAGS += -finline-functions -ffast-math \
|
2013-11-14 02:04:31 +01:00
|
|
|
-ffunction-sections -fdata-sections
|
2014-02-08 05:31:44 +01:00
|
|
|
ifeq ($(findstring clang,$(NDK_TOOLCHAIN_VERSION)),)
|
|
|
|
WEBP_CFLAGS += -frename-registers -s
|
|
|
|
endif
|
2013-10-04 11:26:37 +02:00
|
|
|
endif
|
2010-09-30 15:34:38 +02:00
|
|
|
|
2017-06-03 21:53:22 +02:00
|
|
|
# mips32 fails to build with clang from r14b
|
|
|
|
# https://bugs.chromium.org/p/webp/issues/detail?id=343
|
|
|
|
ifeq ($(findstring clang,$(NDK_TOOLCHAIN_VERSION)),clang)
|
|
|
|
ifeq ($(TARGET_ARCH),mips)
|
|
|
|
WEBP_CFLAGS += -no-integrated-as
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2014-05-14 08:32:43 +02:00
|
|
|
ifneq ($(findstring armeabi-v7a, $(TARGET_ARCH_ABI)),)
|
|
|
|
# Setting LOCAL_ARM_NEON will enable -mfpu=neon which may cause illegal
|
|
|
|
# instructions to be generated for armv7a code. Instead target the neon code
|
|
|
|
# specifically.
|
|
|
|
NEON := c.neon
|
2015-08-20 03:25:37 +02:00
|
|
|
USE_CPUFEATURES := yes
|
2014-05-14 08:32:43 +02:00
|
|
|
else
|
|
|
|
NEON := c
|
|
|
|
endif
|
|
|
|
|
2015-02-25 02:26:07 +01:00
|
|
|
dec_srcs := \
|
2017-01-19 09:21:40 +01:00
|
|
|
src/dec/alpha_dec.c \
|
|
|
|
src/dec/buffer_dec.c \
|
|
|
|
src/dec/frame_dec.c \
|
|
|
|
src/dec/idec_dec.c \
|
|
|
|
src/dec/io_dec.c \
|
|
|
|
src/dec/quant_dec.c \
|
|
|
|
src/dec/tree_dec.c \
|
|
|
|
src/dec/vp8_dec.c \
|
|
|
|
src/dec/vp8l_dec.c \
|
|
|
|
src/dec/webp_dec.c \
|
2015-02-25 02:26:07 +01:00
|
|
|
|
2015-02-25 03:38:58 +01:00
|
|
|
demux_srcs := \
|
2015-09-03 01:20:24 +02:00
|
|
|
src/demux/anim_decode.c \
|
2015-02-25 03:38:58 +01:00
|
|
|
src/demux/demux.c \
|
|
|
|
|
2015-02-25 02:26:07 +01:00
|
|
|
dsp_dec_srcs := \
|
2014-05-26 18:05:03 +02:00
|
|
|
src/dsp/alpha_processing.c \
|
2014-08-21 19:26:18 +02:00
|
|
|
src/dsp/alpha_processing_mips_dsp_r2.c \
|
2017-01-11 17:39:29 +01:00
|
|
|
src/dsp/alpha_processing_neon.$(NEON) \
|
2014-08-26 05:55:28 +02:00
|
|
|
src/dsp/alpha_processing_sse2.c \
|
2015-06-19 14:23:38 +02:00
|
|
|
src/dsp/alpha_processing_sse41.c \
|
2012-04-12 21:00:43 +02:00
|
|
|
src/dsp/cpu.c \
|
|
|
|
src/dsp/dec.c \
|
2014-02-14 04:32:21 +01:00
|
|
|
src/dsp/dec_clip_tables.c \
|
2013-12-25 12:16:01 +01:00
|
|
|
src/dsp/dec_mips32.c \
|
2014-09-02 14:03:13 +02:00
|
|
|
src/dsp/dec_mips_dsp_r2.c \
|
2016-06-09 15:47:09 +02:00
|
|
|
src/dsp/dec_msa.c \
|
2014-05-14 08:32:43 +02:00
|
|
|
src/dsp/dec_neon.$(NEON) \
|
2012-04-20 21:07:03 +02:00
|
|
|
src/dsp/dec_sse2.c \
|
2015-03-19 21:18:59 +01:00
|
|
|
src/dsp/dec_sse41.c \
|
2015-01-28 08:02:41 +01:00
|
|
|
src/dsp/filters.c \
|
2014-08-04 16:22:10 +02:00
|
|
|
src/dsp/filters_mips_dsp_r2.c \
|
2016-07-01 15:56:00 +02:00
|
|
|
src/dsp/filters_msa.c \
|
2017-01-16 16:11:41 +01:00
|
|
|
src/dsp/filters_neon.$(NEON) \
|
2015-01-29 08:06:29 +01:00
|
|
|
src/dsp/filters_sse2.c \
|
2012-04-12 21:00:43 +02:00
|
|
|
src/dsp/lossless.c \
|
2014-09-02 16:34:52 +02:00
|
|
|
src/dsp/lossless_mips_dsp_r2.c \
|
2016-07-01 15:56:00 +02:00
|
|
|
src/dsp/lossless_msa.c \
|
2014-05-14 08:32:43 +02:00
|
|
|
src/dsp/lossless_neon.$(NEON) \
|
2014-03-27 21:43:21 +01:00
|
|
|
src/dsp/lossless_sse2.c \
|
2015-01-09 12:05:53 +01:00
|
|
|
src/dsp/rescaler.c \
|
|
|
|
src/dsp/rescaler_mips32.c \
|
|
|
|
src/dsp/rescaler_mips_dsp_r2.c \
|
2016-07-19 16:47:54 +02:00
|
|
|
src/dsp/rescaler_msa.c \
|
2015-10-05 11:26:52 +02:00
|
|
|
src/dsp/rescaler_neon.$(NEON) \
|
2015-09-25 14:34:02 +02:00
|
|
|
src/dsp/rescaler_sse2.c \
|
2012-04-12 21:00:43 +02:00
|
|
|
src/dsp/upsampling.c \
|
2014-08-15 11:00:32 +02:00
|
|
|
src/dsp/upsampling_mips_dsp_r2.c \
|
2016-07-21 16:30:44 +02:00
|
|
|
src/dsp/upsampling_msa.c \
|
2014-05-14 08:32:43 +02:00
|
|
|
src/dsp/upsampling_neon.$(NEON) \
|
2012-04-20 21:07:03 +02:00
|
|
|
src/dsp/upsampling_sse2.c \
|
2012-04-12 21:00:43 +02:00
|
|
|
src/dsp/yuv.c \
|
2014-06-07 21:35:47 +02:00
|
|
|
src/dsp/yuv_mips32.c \
|
2014-08-12 11:47:36 +02:00
|
|
|
src/dsp/yuv_mips_dsp_r2.c \
|
2017-04-18 18:22:30 +02:00
|
|
|
src/dsp/yuv_neon.$(NEON) \
|
2014-06-06 08:49:59 +02:00
|
|
|
src/dsp/yuv_sse2.c \
|
2015-02-25 02:26:07 +01:00
|
|
|
|
|
|
|
dsp_enc_srcs := \
|
|
|
|
src/dsp/cost.c \
|
|
|
|
src/dsp/cost_mips32.c \
|
|
|
|
src/dsp/cost_mips_dsp_r2.c \
|
|
|
|
src/dsp/cost_sse2.c \
|
|
|
|
src/dsp/enc.c \
|
|
|
|
src/dsp/enc_avx2.c \
|
|
|
|
src/dsp/enc_mips32.c \
|
|
|
|
src/dsp/enc_mips_dsp_r2.c \
|
2016-07-05 16:30:43 +02:00
|
|
|
src/dsp/enc_msa.c \
|
2015-02-25 02:26:07 +01:00
|
|
|
src/dsp/enc_neon.$(NEON) \
|
|
|
|
src/dsp/enc_sse2.c \
|
2015-03-25 12:12:44 +01:00
|
|
|
src/dsp/enc_sse41.c \
|
2015-03-21 03:09:49 +01:00
|
|
|
src/dsp/lossless_enc.c \
|
|
|
|
src/dsp/lossless_enc_mips32.c \
|
|
|
|
src/dsp/lossless_enc_mips_dsp_r2.c \
|
2016-07-18 13:02:36 +02:00
|
|
|
src/dsp/lossless_enc_msa.c \
|
2015-03-21 03:09:49 +01:00
|
|
|
src/dsp/lossless_enc_neon.$(NEON) \
|
|
|
|
src/dsp/lossless_enc_sse2.c \
|
2015-06-23 08:46:57 +02:00
|
|
|
src/dsp/lossless_enc_sse41.c \
|
2017-02-20 17:27:15 +01:00
|
|
|
src/dsp/ssim.c \
|
|
|
|
src/dsp/ssim_sse2.c \
|
2015-02-25 02:26:07 +01:00
|
|
|
|
|
|
|
enc_srcs := \
|
2017-01-19 09:21:40 +01:00
|
|
|
src/enc/alpha_enc.c \
|
|
|
|
src/enc/analysis_enc.c \
|
2017-06-01 15:07:28 +02:00
|
|
|
src/enc/backward_references_cost_enc.c \
|
2017-01-19 09:21:40 +01:00
|
|
|
src/enc/backward_references_enc.c \
|
|
|
|
src/enc/config_enc.c \
|
|
|
|
src/enc/cost_enc.c \
|
|
|
|
src/enc/delta_palettization_enc.c \
|
|
|
|
src/enc/filter_enc.c \
|
|
|
|
src/enc/frame_enc.c \
|
|
|
|
src/enc/histogram_enc.c \
|
|
|
|
src/enc/iterator_enc.c \
|
|
|
|
src/enc/near_lossless_enc.c \
|
|
|
|
src/enc/picture_enc.c \
|
|
|
|
src/enc/picture_csp_enc.c \
|
|
|
|
src/enc/picture_psnr_enc.c \
|
|
|
|
src/enc/picture_rescale_enc.c \
|
|
|
|
src/enc/picture_tools_enc.c \
|
|
|
|
src/enc/predictor_enc.c \
|
|
|
|
src/enc/quant_enc.c \
|
|
|
|
src/enc/syntax_enc.c \
|
|
|
|
src/enc/token_enc.c \
|
|
|
|
src/enc/tree_enc.c \
|
|
|
|
src/enc/vp8l_enc.c \
|
|
|
|
src/enc/webp_enc.c \
|
2015-02-25 02:26:07 +01:00
|
|
|
|
2015-02-25 03:49:31 +01:00
|
|
|
mux_srcs := \
|
|
|
|
src/mux/anim_encode.c \
|
|
|
|
src/mux/muxedit.c \
|
|
|
|
src/mux/muxinternal.c \
|
|
|
|
src/mux/muxread.c \
|
|
|
|
|
2015-02-25 02:26:07 +01:00
|
|
|
utils_dec_srcs := \
|
2017-01-19 09:21:40 +01:00
|
|
|
src/utils/bit_reader_utils.c \
|
|
|
|
src/utils/color_cache_utils.c \
|
|
|
|
src/utils/filters_utils.c \
|
|
|
|
src/utils/huffman_utils.c \
|
|
|
|
src/utils/quant_levels_dec_utils.c \
|
|
|
|
src/utils/random_utils.c \
|
|
|
|
src/utils/rescaler_utils.c \
|
|
|
|
src/utils/thread_utils.c \
|
2012-08-01 01:56:39 +02:00
|
|
|
src/utils/utils.c \
|
2010-09-30 15:34:38 +02:00
|
|
|
|
2015-02-25 02:26:07 +01:00
|
|
|
utils_enc_srcs := \
|
2017-01-19 09:21:40 +01:00
|
|
|
src/utils/bit_writer_utils.c \
|
|
|
|
src/utils/huffman_encode_utils.c \
|
|
|
|
src/utils/quant_levels_utils.c \
|
2015-02-25 02:26:07 +01:00
|
|
|
|
|
|
|
################################################################################
|
2015-02-25 03:25:06 +01:00
|
|
|
# libwebpdecoder
|
2015-02-25 02:26:07 +01:00
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_SRC_FILES := \
|
|
|
|
$(dec_srcs) \
|
2015-02-25 03:25:06 +01:00
|
|
|
$(dsp_dec_srcs) \
|
|
|
|
$(utils_dec_srcs) \
|
2015-02-25 02:26:07 +01:00
|
|
|
|
2013-10-04 11:26:37 +02:00
|
|
|
LOCAL_CFLAGS := $(WEBP_CFLAGS)
|
2010-09-30 15:34:38 +02:00
|
|
|
LOCAL_C_INCLUDES += $(LOCAL_PATH)/src
|
|
|
|
|
2013-10-04 11:06:33 +02:00
|
|
|
# prefer arm over thumb mode for performance gains
|
|
|
|
LOCAL_ARM_MODE := arm
|
|
|
|
|
2015-08-20 03:25:37 +02:00
|
|
|
ifeq ($(USE_CPUFEATURES),yes)
|
|
|
|
LOCAL_STATIC_LIBRARIES := cpufeatures
|
|
|
|
endif
|
2012-04-20 21:07:03 +02:00
|
|
|
|
2015-02-25 03:25:06 +01:00
|
|
|
LOCAL_MODULE := webpdecoder_static
|
|
|
|
|
|
|
|
include $(BUILD_STATIC_LIBRARY)
|
|
|
|
|
|
|
|
ifeq ($(ENABLE_SHARED),1)
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_WHOLE_STATIC_LIBRARIES := webpdecoder_static
|
|
|
|
|
|
|
|
LOCAL_MODULE := webpdecoder
|
|
|
|
|
|
|
|
include $(BUILD_SHARED_LIBRARY)
|
|
|
|
endif # ENABLE_SHARED=1
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# libwebp
|
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_SRC_FILES := \
|
|
|
|
$(dsp_enc_srcs) \
|
|
|
|
$(enc_srcs) \
|
|
|
|
$(utils_enc_srcs) \
|
|
|
|
|
|
|
|
LOCAL_CFLAGS := $(WEBP_CFLAGS)
|
|
|
|
LOCAL_C_INCLUDES += $(LOCAL_PATH)/src
|
|
|
|
|
|
|
|
# prefer arm over thumb mode for performance gains
|
|
|
|
LOCAL_ARM_MODE := arm
|
|
|
|
|
|
|
|
LOCAL_WHOLE_STATIC_LIBRARIES := webpdecoder_static
|
|
|
|
|
2013-10-04 11:06:33 +02:00
|
|
|
LOCAL_MODULE := webp
|
2010-09-30 15:34:38 +02:00
|
|
|
|
2014-06-18 08:30:20 +02:00
|
|
|
ifeq ($(ENABLE_SHARED),1)
|
|
|
|
include $(BUILD_SHARED_LIBRARY)
|
|
|
|
else
|
|
|
|
include $(BUILD_STATIC_LIBRARY)
|
|
|
|
endif
|
2012-05-04 21:34:53 +02:00
|
|
|
|
2015-02-25 03:38:58 +01:00
|
|
|
################################################################################
|
|
|
|
# libwebpdemux
|
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_SRC_FILES := $(demux_srcs)
|
|
|
|
|
|
|
|
LOCAL_CFLAGS := $(WEBP_CFLAGS)
|
|
|
|
LOCAL_C_INCLUDES += $(LOCAL_PATH)/src
|
|
|
|
|
|
|
|
# prefer arm over thumb mode for performance gains
|
|
|
|
LOCAL_ARM_MODE := arm
|
|
|
|
|
|
|
|
LOCAL_MODULE := webpdemux
|
|
|
|
|
|
|
|
ifeq ($(ENABLE_SHARED),1)
|
|
|
|
LOCAL_SHARED_LIBRARIES := webp
|
|
|
|
include $(BUILD_SHARED_LIBRARY)
|
|
|
|
else
|
|
|
|
LOCAL_STATIC_LIBRARIES := webp
|
|
|
|
include $(BUILD_STATIC_LIBRARY)
|
|
|
|
endif
|
|
|
|
|
2015-02-25 03:49:31 +01:00
|
|
|
################################################################################
|
|
|
|
# libwebpmux
|
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_SRC_FILES := $(mux_srcs)
|
|
|
|
|
|
|
|
LOCAL_CFLAGS := $(WEBP_CFLAGS)
|
|
|
|
LOCAL_C_INCLUDES += $(LOCAL_PATH)/src
|
|
|
|
|
|
|
|
# prefer arm over thumb mode for performance gains
|
|
|
|
LOCAL_ARM_MODE := arm
|
|
|
|
|
|
|
|
LOCAL_MODULE := webpmux
|
|
|
|
|
|
|
|
ifeq ($(ENABLE_SHARED),1)
|
|
|
|
LOCAL_SHARED_LIBRARIES := webp
|
|
|
|
include $(BUILD_SHARED_LIBRARY)
|
|
|
|
else
|
|
|
|
LOCAL_STATIC_LIBRARIES := webp
|
|
|
|
include $(BUILD_STATIC_LIBRARY)
|
|
|
|
endif
|
|
|
|
|
2015-02-25 02:26:07 +01:00
|
|
|
################################################################################
|
|
|
|
|
2016-07-20 01:02:55 +02:00
|
|
|
WEBP_SRC_PATH := $(LOCAL_PATH)
|
|
|
|
include $(WEBP_SRC_PATH)/imageio/Android.mk
|
|
|
|
include $(WEBP_SRC_PATH)/examples/Android.mk
|
2013-10-04 11:26:37 +02:00
|
|
|
|
2015-08-20 03:25:37 +02:00
|
|
|
ifeq ($(USE_CPUFEATURES),yes)
|
|
|
|
$(call import-module,android/cpufeatures)
|
|
|
|
endif
|