Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Gramner <gramner@twoorioles.com>2022-07-06 15:43:44 +0300
committerHenrik Gramner <henrik@gramner.com>2022-07-06 16:05:47 +0300
commitbd0466350d20e2c6aab4c47668cd5486dc7a3d94 (patch)
treea49202fdff9fe3f560aa4eadde6f54f4d033ed21 /src/itx_tmpl.c
parent820bf5156322ea6f9d1fc180ac579743347b9c5b (diff)
Eliminate unused C DSP functions at compile time
When compiling with asm enabled there's no point in compiling C versions of DSP functions that have asm implementations using instruction sets that the compiler can unconditionally use. E.g. when compiling with -mssse3 we can remove the C version of all functions with SSSE3 implementations. This is accomplished using the compiler's dead code elimination functionality. Can be configured using the new 'trim_dsp' meson option, which by default is enabled when compiling in release mode.
Diffstat (limited to 'src/itx_tmpl.c')
-rw-r--r--src/itx_tmpl.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/itx_tmpl.c b/src/itx_tmpl.c
index 2f97a9c..d385989 100644
--- a/src/itx_tmpl.c
+++ b/src/itx_tmpl.c
@@ -180,6 +180,14 @@ static void inv_txfm_add_wht_wht_4x4_c(pixel *dst, const ptrdiff_t stride,
dst[x] = iclip_pixel(dst[x] + *c++);
}
+#if HAVE_ASM
+#if ARCH_AARCH64 || ARCH_ARM
+#include "src/arm/itx.h"
+#elif ARCH_X86
+#include "src/x86/itx.h"
+#endif
+#endif
+
COLD void bitfn(dav1d_itx_dsp_init)(Dav1dInvTxfmDSPContext *const c, int bpc) {
#define assign_itx_all_fn64(w, h, pfx) \
c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT ] = \
@@ -247,10 +255,10 @@ COLD void bitfn(dav1d_itx_dsp_init)(Dav1dInvTxfmDSPContext *const c, int bpc) {
#if HAVE_ASM
#if ARCH_AARCH64 || ARCH_ARM
- bitfn(dav1d_itx_dsp_init_arm)(c, bpc);
+ itx_dsp_init_arm(c, bpc);
#endif
#if ARCH_X86
- bitfn(dav1d_itx_dsp_init_x86)(c, bpc);
+ itx_dsp_init_x86(c, bpc);
#endif
#endif
}