[FFmpeg-devel] [PATCH] Fix link errors when HAVE_X86ASM is not defined
James Almer
jamrial at gmail.com
Wed Nov 21 17:27:52 EET 2018
On 11/20/2018 11:47 PM, Haihao Xiang wrote:
> This fixes the link errors below:
>
> LD ffmpeg_g
> libavfilter/libavfilter.so: undefined reference to `ff_scene_sad_avx2'
> libavfilter/libavfilter.so: undefined reference to `ff_scene_sad_sse2'
> collect2: error: ld returned 1 exit status
> Makefile:108: recipe for target 'ffmpeg_g' failed
> make: *** [ffmpeg_g] Error 1
>
> Signed-off-by: Haihao Xiang <haihao.xiang at intel.com>
> ---
> libavfilter/x86/scene_sad_init.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/libavfilter/x86/scene_sad_init.c b/libavfilter/x86/scene_sad_init.c
> index 461fa406d9..7e93ef44d3 100644
> --- a/libavfilter/x86/scene_sad_init.c
> +++ b/libavfilter/x86/scene_sad_init.c
> @@ -20,6 +20,7 @@
> #include "libavutil/x86/cpu.h"
> #include "libavfilter/scene_sad.h"
>
> +#if HAVE_X86ASM
> #define SCENE_SAD_FUNC(FUNC_NAME, ASM_FUNC_NAME, MMSIZE) \
> void ASM_FUNC_NAME(SCENE_SAD_PARAMS); \
> \
> @@ -50,3 +51,12 @@ ff_scene_sad_fn ff_scene_sad_get_fn_x86(int depth)
> }
> return NULL;
> }
> +
> +#else
> +
> +ff_scene_sad_fn ff_scene_sad_get_fn_x86(int depth)
> +{
> + return NULL;
> +}
> +
> +#endif
> \ No newline at end of file
Can you test the attached patch? It's more in line with how other asm
modules with the same issue were fixed before, like synth_filter in
libavcodec.
-------------- next part --------------
From 41e5c18028a74b7fc9e42a2050ad7290a0074fd6 Mon Sep 17 00:00:00 2001
From: James Almer <jamrial at gmail.com>
Date: Wed, 21 Nov 2018 12:21:38 -0300
Subject: [PATCH] x86/scene_sad: fix link errors when HAVE_X86ASM is not
defined
Reported-by: Haihao Xiang <haihao.xiang at intel.com>
Signed-off-by: James Almer <jamrial at gmail.com>
---
libavfilter/x86/scene_sad_init.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libavfilter/x86/scene_sad_init.c b/libavfilter/x86/scene_sad_init.c
index 461fa406d9..f5331338af 100644
--- a/libavfilter/x86/scene_sad_init.c
+++ b/libavfilter/x86/scene_sad_init.c
@@ -36,11 +36,16 @@ static void FUNC_NAME(SCENE_SAD_PARAMS) { \
*sum += sad[0]; \
}
+#if HAVE_X86ASM
SCENE_SAD_FUNC(scene_sad_sse2, ff_scene_sad_sse2, 16);
+#if HAVE_AVX2_EXTERNAL
SCENE_SAD_FUNC(scene_sad_avx2, ff_scene_sad_avx2, 32);
+#endif
+#endif
ff_scene_sad_fn ff_scene_sad_get_fn_x86(int depth)
{
+#if HAVE_X86ASM
int cpu_flags = av_get_cpu_flags();
if (depth == 8) {
if (EXTERNAL_AVX2_FAST(cpu_flags))
@@ -48,5 +53,6 @@ ff_scene_sad_fn ff_scene_sad_get_fn_x86(int depth)
else if (EXTERNAL_SSE2(cpu_flags))
return scene_sad_sse2;
}
+#endif
return NULL;
}
--
2.19.1
More information about the ffmpeg-devel
mailing list