diff options
Diffstat (limited to 'chromium/third_party/libvpx/source/libvpx/build/make/Android.mk')
-rw-r--r-- | chromium/third_party/libvpx/source/libvpx/build/make/Android.mk | 67 |
1 files changed, 51 insertions, 16 deletions
diff --git a/chromium/third_party/libvpx/source/libvpx/build/make/Android.mk b/chromium/third_party/libvpx/source/libvpx/build/make/Android.mk index 1ff0884fc1f..816334e040d 100644 --- a/chromium/third_party/libvpx/source/libvpx/build/make/Android.mk +++ b/chromium/third_party/libvpx/source/libvpx/build/make/Android.mk @@ -38,8 +38,9 @@ # For this we import the 'cpufeatures' module from the NDK sources. # libvpx can also be configured without this runtime detection method. # Configuring with --disable-runtime-cpu-detect will assume presence of NEON. -# Configuring with --disable-runtime-cpu-detect --disable-neon will remove any -# NEON dependency. +# Configuring with --disable-runtime-cpu-detect --disable-neon \ +# --disable-neon-asm +# will remove any NEON dependency. # To change to building armeabi, run ./libvpx/configure again, but with # --target=arm5te-android-gcc and modify the Application.mk file to @@ -53,12 +54,23 @@ LIBVPX_PATH := $(LOCAL_PATH)/libvpx ASM_CNV_PATH_LOCAL := $(TARGET_ARCH_ABI)/ads2gas ASM_CNV_PATH := $(LOCAL_PATH)/$(ASM_CNV_PATH_LOCAL) -# Makefiles created by the libvpx configure process -# This will need to be fixed to handle x86. +# Use the makefiles generated by upstream configure to determine which files to +# build. Also set any architecture-specific flags. ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) include $(CONFIG_DIR)libs-armv7-android-gcc.mk -else + LOCAL_ARM_MODE := arm +else ifeq ($(TARGET_ARCH_ABI),armeabi) include $(CONFIG_DIR)libs-armv5te-android-gcc.mk + LOCAL_ARM_MODE := arm +else ifeq ($(TARGET_ARCH_ABI),arm64-v8a) + include $(CONFIG_DIR)libs-armv8-android-gcc.mk + LOCAL_ARM_MODE := arm +else ifeq ($(TARGET_ARCH_ABI),x86) + include $(CONFIG_DIR)libs-x86-android-gcc.mk +else ifeq ($(TARGET_ARCH_ABI),mips) + include $(CONFIG_DIR)libs-mips-android-gcc.mk +else + $(error Not a supported TARGET_ARCH_ABI: $(TARGET_ARCH_ABI)) endif # Rule that is normally in Makefile created by libvpx @@ -72,10 +84,13 @@ SRC_PATH_BARE := $(LIBVPX_PATH) # Include the list of files to be built include $(LIBVPX_PATH)/libs.mk -# Want arm, not thumb, optimized -LOCAL_ARM_MODE := arm +# Optimise the code. May want to revisit this setting in the future. LOCAL_CFLAGS := -O3 +# For x86, include the source code in the search path so it will find files +# like x86inc.asm and x86_abi_support.asm +LOCAL_ASMFLAGS := -I$(LIBVPX_PATH) + # ----------------------------------------------------------------------------- # Template : asm_offsets_template # Arguments : 1: assembly offsets file to be created @@ -109,13 +124,13 @@ $(1) : $$(_OBJ) $(2) @grep $(OFFSET_PATTERN) $$< | tr -d '\#' | $(CONFIG_DIR)$(ASM_CONVERSION) > $$@ endef -# Use ads2gas script to convert from RVCT format to GAS format. This passes +# Use ads2gas script to convert from RVCT format to GAS format. This # puts the processed file under $(ASM_CNV_PATH). Local clean rule # to handle removing these ifeq ($(CONFIG_VP8_ENCODER), yes) ASM_CNV_OFFSETS_DEPEND += $(ASM_CNV_PATH)/vp8_asm_enc_offsets.asm endif -ifeq ($(HAVE_NEON), yes) +ifeq ($(HAVE_NEON_ASM), yes) ASM_CNV_OFFSETS_DEPEND += $(ASM_CNV_PATH)/vpx_scale_asm_offsets.asm endif @@ -135,25 +150,41 @@ CODEC_SRCS_UNIQUE = $(sort $(CODEC_SRCS)) # Pull out C files. vpx_config.c is in the immediate directory and # so it does not need libvpx/ prefixed like the rest of the source files. +# The neon files with intrinsics need to have .neon appended so the proper +# flags are applied. CODEC_SRCS_C = $(filter %.c, $(CODEC_SRCS_UNIQUE)) -LOCAL_CODEC_SRCS_C = $(filter-out vpx_config.c, $(CODEC_SRCS_C)) +LOCAL_NEON_SRCS_C = $(filter %_neon.c, $(CODEC_SRCS_C)) +LOCAL_CODEC_SRCS_C = $(filter-out vpx_config.c %_neon.c, $(CODEC_SRCS_C)) LOCAL_SRC_FILES += $(foreach file, $(LOCAL_CODEC_SRCS_C), libvpx/$(file)) +ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) + LOCAL_SRC_FILES += $(foreach file, $(LOCAL_NEON_SRCS_C), libvpx/$(file).neon) +else # If there are neon sources then we are building for arm64 and do not need to specify .neon + LOCAL_SRC_FILES += $(foreach file, $(LOCAL_NEON_SRCS_C), libvpx/$(file)) +endif # Pull out assembly files, splitting NEON from the rest. This is # done to specify that the NEON assembly files use NEON assembler flags. -CODEC_SRCS_ASM_ALL = $(filter %.asm.s, $(CODEC_SRCS_UNIQUE)) -CODEC_SRCS_ASM = $(foreach v, \ - $(CODEC_SRCS_ASM_ALL), \ - $(if $(findstring neon,$(v)),,$(v))) +# x86 assembly matches %.asm, arm matches %.asm.s + +# x86: + +CODEC_SRCS_ASM_X86 = $(filter %.asm, $(CODEC_SRCS_UNIQUE)) +LOCAL_SRC_FILES += $(foreach file, $(CODEC_SRCS_ASM_X86), libvpx/$(file)) + +# arm: +CODEC_SRCS_ASM_ARM_ALL = $(filter %.asm.s, $(CODEC_SRCS_UNIQUE)) +CODEC_SRCS_ASM_ARM = $(foreach v, \ + $(CODEC_SRCS_ASM_ARM_ALL), \ + $(if $(findstring neon,$(v)),,$(v))) CODEC_SRCS_ASM_ADS2GAS = $(patsubst %.s, \ $(ASM_CNV_PATH_LOCAL)/libvpx/%.s, \ - $(CODEC_SRCS_ASM)) + $(CODEC_SRCS_ASM_ARM)) LOCAL_SRC_FILES += $(CODEC_SRCS_ASM_ADS2GAS) ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) CODEC_SRCS_ASM_NEON = $(foreach v, \ - $(CODEC_SRCS_ASM_ALL),\ + $(CODEC_SRCS_ASM_ARM_ALL),\ $(if $(findstring neon,$(v)),$(v),)) CODEC_SRCS_ASM_NEON_ADS2GAS = $(patsubst %.s, \ $(ASM_CNV_PATH_LOCAL)/libvpx/%.s, \ @@ -185,6 +216,10 @@ $(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vp9_rtcd.h endif $(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vpx_scale_rtcd.h +ifeq ($(TARGET_ARCH_ABI),x86) +$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vpx_config.asm +endif + .PHONY: clean clean: @echo "Clean: ads2gas files [$(TARGET_ARCH_ABI)]" |