This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new 74cfcd1c69 aarch64/vvc: Fix DCE undefined references with MSVC
74cfcd1c69 is described below
commit 74cfcd1c6912f3cdd74d0ba58c316b04a11691f0
Author: Martin Storsjö <[email protected]>
AuthorDate: Thu Mar 5 11:52:03 2026 +0200
Commit: Martin Storsjö <[email protected]>
CommitDate: Thu Mar 5 11:57:40 2026 +0200
aarch64/vvc: Fix DCE undefined references with MSVC
This fixes compiling with MSVC for aarch64 after
510999f6b07b6996983c7ef24c3cf41a06241261.
While MSVC does do dead code elimintation for function references
within e.g. "if (0)", it doesn't do that for functions referenced
within a static function, even if that static function itself ends
up not used.
A reproduction example:
void missing(void);
void (*func_ptr)(void);
static void wrapper(void) {
missing();
}
void init(int cpu_flags) {
if (0) {
func_ptr = wrapper;
}
}
If "wrapper" is entirely unreferenced, then MSVC doesn't produce
any reference to the symbol "missing". Also, if we do
"func_ptr = missing;" then the reference to missing also is
eliminated. But for the case of referencing the function in a
static function, even if the reference to the static function can
be eliminated, then MSVC does keep the reference to the symbol.
---
libavcodec/aarch64/vvc/alf_template.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavcodec/aarch64/vvc/alf_template.c
b/libavcodec/aarch64/vvc/alf_template.c
index 0b63879c1f..03bf9056bb 100644
--- a/libavcodec/aarch64/vvc/alf_template.c
+++ b/libavcodec/aarch64/vvc/alf_template.c
@@ -259,10 +259,15 @@ static void FUNC2(alf_filter_luma, BIT_DEPTH,
_sme2)(uint8_t *_dst,
const int vb_pos)
{
if ((width >= 16) && (height >= 16)) {
+ // If compiled without support for SME2 or SME-I16I64, we never assign
+ // the function pointer anyway, but make sure we don't produce a
+ // reference to the function which does not exist.
+#if HAVE_SME2 && HAVE_SME_I16I64
int aligned_width = ALF_ALIGN_BY_4(width); // align width by 4
uint64_t dims = ((uint64_t)height << 32u) | (uint64_t)aligned_width;
uint64_t strides = ((uint64_t)src_stride << 32u) |
(uint64_t)dst_stride;
FUNC2(ff_vvc_alf_filter_luma, BIT_DEPTH, _sme2)(_dst, _src, strides,
dims, filter, clip, vb_pos);
+#endif
} else {
FUNC2(alf_filter_luma, BIT_DEPTH, _neon)(_dst, dst_stride, _src,
src_stride, width, height, filter, clip, vb_pos);
}
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]