diff --git a/modules/Makefile.am b/modules/Makefile.am index 9bb9e7756c..333acb0586 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -31,6 +31,7 @@ include hw/d3d11/Makefile.am include hw/vaapi/Makefile.am include hw/vdpau/Makefile.am include hw/mmal/Makefile.am +include isa/aarch64/Makefile.am include isa/arm/Makefile.am include isa/riscv/Makefile.am include keystore/Makefile.am diff --git a/modules/isa/aarch64/Makefile.am b/modules/isa/aarch64/Makefile.am new file mode 100644 index 0000000000..a9e41e601e --- /dev/null +++ b/modules/isa/aarch64/Makefile.am @@ -0,0 +1,10 @@ +aarch64dir = $(pluginsdir)/aarch64 +aarch64_LTLIBRARIES = + +libdeinterlace_aarch64_plugin_la_SOURCES = \ + isa/aarch64/simd/deinterlace.c isa/aarch64/simd/merge.S + +if HAVE_ARM64 +aarch64_LTLIBRARIES += \ + libdeinterlace_aarch64_plugin.la +endif diff --git a/modules/isa/aarch64/simd/deinterlace.c b/modules/isa/aarch64/simd/deinterlace.c new file mode 100644 index 0000000000..6fc5340dae --- /dev/null +++ b/modules/isa/aarch64/simd/deinterlace.c @@ -0,0 +1,46 @@ +/***************************************************************************** + * deinterlace.c: AArch64 AdvSIMD deinterlacing functions + ***************************************************************************** + * Copyright (C) 2022 Rémi Denis-Courmont + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include "../../../video_filter/deinterlace/merge.h" + +void merge8_arm64(void *, const void *, const void *, size_t); +void merge16_arm64(void *, const void *, const void *, size_t); + +static void Probe(void *data) +{ + if (vlc_CPU_ARM_NEON()) { + struct deinterlace_functions *const f = data; + + f->merges[0] = merge8_arm64; + f->merges[1] = merge16_arm64; + } +} + +vlc_module_begin() + set_description("AArch64 AvdSIMD optimisation for deinterlacing") + set_cpu_funcs("deinterlace functions", Probe, 10) +vlc_module_end() diff --git a/modules/video_filter/deinterlace/merge_arm64.S b/modules/isa/aarch64/simd/merge.S similarity index 95% rename from modules/video_filter/deinterlace/merge_arm64.S rename to modules/isa/aarch64/simd/merge.S index 354d0a3ace..db513f5e36 100644 --- a/modules/video_filter/deinterlace/merge_arm64.S +++ b/modules/isa/aarch64/simd/merge.S @@ -1,5 +1,5 @@ //***************************************************************************** - // merge_arm64.S : ARM64 NEON mean + // merge.S : AArch64 Advanced SIMD mean //***************************************************************************** // Copyright (C) 2009-2012 Rémi Denis-Courmont // Copyright (C) 2016- Janne Grunau @@ -19,7 +19,7 @@ // Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. //****************************************************************************/ -#include "../../isa/arm/asm.S" +#include "../../arm/asm.S" .arch armv8-a+simd .text @@ -32,7 +32,7 @@ .align 2 // NOTE: Offset and pitch must be multiple of 16-bytes in VLC. -function merge8_arm64_neon +function merge8_arm64 bti c ands x5, SIZE, #~63 b.eq 2f @@ -69,7 +69,7 @@ function merge8_arm64_neon ret .align 2 -function merge16_arm64_neon +function merge16_arm64 bti c ands x5, SIZE, #~63 b.eq 2f diff --git a/modules/video_filter/Makefile.am b/modules/video_filter/Makefile.am index a4051907f2..9635a74da0 100644 --- a/modules/video_filter/Makefile.am +++ b/modules/video_filter/Makefile.am @@ -183,10 +183,6 @@ if HAVE_NEON libdeinterlace_plugin_la_SOURCES += video_filter/deinterlace/merge_arm.S libdeinterlace_plugin_la_CPPFLAGS += -DCAN_COMPILE_ARM endif -if HAVE_ARM64 -libdeinterlace_plugin_la_SOURCES += video_filter/deinterlace/merge_arm64.S -libdeinterlace_plugin_la_CPPFLAGS += -DCAN_COMPILE_ARM64 -endif if HAVE_SVE libdeinterlace_plugin_la_SOURCES += video_filter/deinterlace/merge_sve.S libdeinterlace_plugin_la_CPPFLAGS += -DCAN_COMPILE_SVE diff --git a/modules/video_filter/deinterlace/deinterlace.c b/modules/video_filter/deinterlace/deinterlace.c index 2fe3bd57fd..444494e5a0 100644 --- a/modules/video_filter/deinterlace/deinterlace.c +++ b/modules/video_filter/deinterlace/deinterlace.c @@ -577,11 +577,6 @@ notsupp: if( vlc_CPU_ARM_SVE() ) p_sys->pf_merge = pixel_size == 1 ? merge8_arm_sve : merge16_arm_sve; else -#endif -#if defined(CAN_COMPILE_ARM64) - if( vlc_CPU_ARM_NEON() ) - p_sys->pf_merge = pixel_size == 1 ? merge8_arm64_neon : merge16_arm64_neon; - else #endif { vlc_CPU_functions_init_once("deinterlace functions", &funcs); diff --git a/modules/video_filter/deinterlace/merge.h b/modules/video_filter/deinterlace/merge.h index 3b744240c7..377c3c98d2 100644 --- a/modules/video_filter/deinterlace/merge.h +++ b/modules/video_filter/deinterlace/merge.h @@ -176,15 +176,6 @@ void merge8_armv6 (void *, const void *, const void *, size_t); void merge16_armv6 (void *, const void *, const void *, size_t); #endif -#if defined(CAN_COMPILE_ARM64) -/** - * ARM64 NEON routine to blend pixels from two picture lines. - */ -void merge8_arm64_neon (void *, const void *, const void *, size_t); -void merge16_arm64_neon (void *, const void *, const void *, size_t); - -#endif - void merge8_arm_sve(void *, const void *, const void *, size_t); void merge16_arm_sve(void *, const void *, const void *, size_t);