diff --git a/build/mktargets.py b/build/mktargets.py index 1b9054cf..7be453c0 100755 --- a/build/mktargets.py +++ b/build/mktargets.py @@ -112,6 +112,14 @@ cpp = sorted(cpp, key=lambda s: s.lower()) asm = sorted(asm, key=lambda s: s.lower()) cfiles = sorted(cfiles, key=lambda s: s.lower()) sfiles = sorted(sfiles, key=lambda s: s.lower()) +armfiles = [] +arm64files = [] +for file in sfiles: + c = file.split('/') + if 'arm64' in c: + arm64files.append(file) + elif 'arm' in c: + armfiles.append(file) @@ -140,13 +148,22 @@ if len(asm) > 0: f.write("%s_OBJS += $(%s_ASM_SRCS:.asm=.$(OBJ))\n"%(PREFIX, PREFIX)) f.write("endif\n\n") -if len(sfiles) > 0: +if len(armfiles) > 0: f.write("ifeq ($(ASM_ARCH), arm)\n") - f.write("%s_ASM_S_SRCS=\\\n"%(PREFIX)) - for c in sfiles: + f.write("%s_ASM_ARM_SRCS=\\\n"%(PREFIX)) + for c in armfiles: f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c)) f.write("\n") - f.write("%s_OBJS += $(%s_ASM_S_SRCS:.S=.$(OBJ))\n"%(PREFIX, PREFIX)) + f.write("%s_OBJS += $(%s_ASM_ARM_SRCS:.S=.$(OBJ))\n"%(PREFIX, PREFIX)) + f.write("endif\n\n") + +if len(arm64files) > 0: + f.write("ifeq ($(ASM_ARCH), arm64)\n") + f.write("%s_ASM_ARM64_SRCS=\\\n"%(PREFIX)) + for c in arm64files: + f.write("\t$(%s_SRCDIR)/%s\\\n"%(PREFIX, c)) + f.write("\n") + f.write("%s_OBJS += $(%s_ASM_ARM64_SRCS:.S=.$(OBJ))\n"%(PREFIX, PREFIX)) f.write("endif\n\n") f.write("OBJS += $(%s_OBJS)\n"%PREFIX) diff --git a/build/mktargets.sh b/build/mktargets.sh index 6514b2be..e2e9de9f 100755 --- a/build/mktargets.sh +++ b/build/mktargets.sh @@ -2,7 +2,7 @@ cd "$(git rev-parse --show-toplevel 2>/dev/null)" >/dev/null 2>&1 python build/mktargets.py --directory codec/decoder --library decoder python build/mktargets.py --directory codec/encoder --library encoder --exclude DllEntry.cpp -python build/mktargets.py --directory codec/common --library common --exclude asm_inc.asm --exclude arm_arch_common_macro.S +python build/mktargets.py --directory codec/common --library common --exclude asm_inc.asm --exclude arm_arch_common_macro.S --exclude arm_arch64_common_macro.S python build/mktargets.py --directory codec/processing --library processing python build/mktargets.py --directory codec/console/dec --binary h264dec diff --git a/build/platform-arch.mk b/build/platform-arch.mk index 82dc0d33..185abc24 100644 --- a/build/platform-arch.mk +++ b/build/platform-arch.mk @@ -8,3 +8,10 @@ ASMFLAGS += -Icodec/common/arm/ CFLAGS += -DHAVE_NEON endif endif +ifneq ($(filter arm64 aarch64, $(ARCH)),) +ifeq ($(USE_ASM), Yes) +ASM_ARCH = arm64 +ASMFLAGS += -Icodec/common/arm64/ +CFLAGS += -DHAVE_NEON_AARCH64 +endif +endif diff --git a/codec/common/targets.mk b/codec/common/targets.mk index 3dfb45bd..1e17bb2f 100644 --- a/codec/common/targets.mk +++ b/codec/common/targets.mk @@ -25,13 +25,21 @@ COMMON_OBJS += $(COMMON_ASM_SRCS:.asm=.$(OBJ)) endif ifeq ($(ASM_ARCH), arm) -COMMON_ASM_S_SRCS=\ +COMMON_ASM_ARM_SRCS=\ $(COMMON_SRCDIR)/arm/copy_mb_neon.S\ $(COMMON_SRCDIR)/arm/deblocking_neon.S\ $(COMMON_SRCDIR)/arm/expand_picture_neon.S\ $(COMMON_SRCDIR)/arm/mc_neon.S\ -COMMON_OBJS += $(COMMON_ASM_S_SRCS:.S=.$(OBJ)) +COMMON_OBJS += $(COMMON_ASM_ARM_SRCS:.S=.$(OBJ)) +endif + +ifeq ($(ASM_ARCH), arm64) +COMMON_ASM_ARM64_SRCS=\ + $(COMMON_SRCDIR)/arm64/expand_picture_aarch64_neon.S\ + $(COMMON_SRCDIR)/arm64/mc_aarch64_neon.S\ + +COMMON_OBJS += $(COMMON_ASM_ARM64_SRCS:.S=.$(OBJ)) endif OBJS += $(COMMON_OBJS) diff --git a/codec/decoder/targets.mk b/codec/decoder/targets.mk index c7aa029c..d6953b92 100644 --- a/codec/decoder/targets.mk +++ b/codec/decoder/targets.mk @@ -35,11 +35,11 @@ DECODER_OBJS += $(DECODER_ASM_SRCS:.asm=.$(OBJ)) endif ifeq ($(ASM_ARCH), arm) -DECODER_ASM_S_SRCS=\ +DECODER_ASM_ARM_SRCS=\ $(DECODER_SRCDIR)/core/arm/block_add_neon.S\ $(DECODER_SRCDIR)/core/arm/intra_pred_neon.S\ -DECODER_OBJS += $(DECODER_ASM_S_SRCS:.S=.$(OBJ)) +DECODER_OBJS += $(DECODER_ASM_ARM_SRCS:.S=.$(OBJ)) endif OBJS += $(DECODER_OBJS) diff --git a/codec/encoder/targets.mk b/codec/encoder/targets.mk index 028b0d0b..52d3324a 100644 --- a/codec/encoder/targets.mk +++ b/codec/encoder/targets.mk @@ -50,14 +50,14 @@ ENCODER_OBJS += $(ENCODER_ASM_SRCS:.asm=.$(OBJ)) endif ifeq ($(ASM_ARCH), arm) -ENCODER_ASM_S_SRCS=\ +ENCODER_ASM_ARM_SRCS=\ $(ENCODER_SRCDIR)/core/arm/intra_pred_neon.S\ $(ENCODER_SRCDIR)/core/arm/intra_pred_sad_3_opt_neon.S\ $(ENCODER_SRCDIR)/core/arm/memory_neon.S\ $(ENCODER_SRCDIR)/core/arm/pixel_neon.S\ $(ENCODER_SRCDIR)/core/arm/reconstruct_neon.S\ -ENCODER_OBJS += $(ENCODER_ASM_S_SRCS:.S=.$(OBJ)) +ENCODER_OBJS += $(ENCODER_ASM_ARM_SRCS:.S=.$(OBJ)) endif OBJS += $(ENCODER_OBJS) diff --git a/codec/processing/targets.mk b/codec/processing/targets.mk index fc3fbc10..c107d54c 100644 --- a/codec/processing/targets.mk +++ b/codec/processing/targets.mk @@ -31,13 +31,13 @@ PROCESSING_OBJS += $(PROCESSING_ASM_SRCS:.asm=.$(OBJ)) endif ifeq ($(ASM_ARCH), arm) -PROCESSING_ASM_S_SRCS=\ +PROCESSING_ASM_ARM_SRCS=\ $(PROCESSING_SRCDIR)/src/arm/adaptive_quantization.S\ $(PROCESSING_SRCDIR)/src/arm/down_sample_neon.S\ $(PROCESSING_SRCDIR)/src/arm/pixel_sad_neon.S\ $(PROCESSING_SRCDIR)/src/arm/vaa_calc_neon.S\ -PROCESSING_OBJS += $(PROCESSING_ASM_S_SRCS:.S=.$(OBJ)) +PROCESSING_OBJS += $(PROCESSING_ASM_ARM_SRCS:.S=.$(OBJ)) endif OBJS += $(PROCESSING_OBJS) diff --git a/test/encoder/targets.mk b/test/encoder/targets.mk index fb513129..eed9dc08 100644 --- a/test/encoder/targets.mk +++ b/test/encoder/targets.mk @@ -8,7 +8,7 @@ ENCODER_UNITTEST_CPP_SRCS=\ $(ENCODER_UNITTEST_SRCDIR)/EncUT_GetIntraPredictor.cpp\ $(ENCODER_UNITTEST_SRCDIR)/EncUT_MemoryAlloc.cpp\ $(ENCODER_UNITTEST_SRCDIR)/EncUT_MotionEstimate.cpp\ - $(ENCODER_UNITTEST_SRCDIR)/EncUT_Sample.cpp\ + $(ENCODER_UNITTEST_SRCDIR)/EncUT_Sample.cpp\ ENCODER_UNITTEST_OBJS += $(ENCODER_UNITTEST_CPP_SRCS:.cpp=.$(OBJ))