[FFmpeg-devel] [PATCH 40/41] avfilter/x86/vf_eq_init: Disable overridden functions on x64
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Fri Jun 10 02:55:22 EEST 2022
x64 always has MMX, MMXEXT, SSE and SSE2 and this means
that some functions for MMX, MMXEXT, SSE and 3dnow are always
overridden by other functions (unless one e.g. explicitly
disables SSE2). This commit therefore disables
process_mmxext (overridden by process_sse2) at compile-time for x64.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
libavfilter/x86/vf_eq.asm | 2 ++
libavfilter/x86/vf_eq_init.c | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/libavfilter/x86/vf_eq.asm b/libavfilter/x86/vf_eq.asm
index a30a287029..0b55d28c6b 100644
--- a/libavfilter/x86/vf_eq.asm
+++ b/libavfilter/x86/vf_eq.asm
@@ -83,8 +83,10 @@ cglobal process_one_line, 5, 7, 5, src, dst, contrast, brightness, w
%endmacro
+%if ARCH_X86_32
INIT_MMX mmxext
PROCESS_ONE_LINE 3
+%endif
INIT_XMM sse2
PROCESS_ONE_LINE 4
diff --git a/libavfilter/x86/vf_eq_init.c b/libavfilter/x86/vf_eq_init.c
index 113056e76b..0ca341e07d 100644
--- a/libavfilter/x86/vf_eq_init.c
+++ b/libavfilter/x86/vf_eq_init.c
@@ -31,6 +31,7 @@ extern void ff_process_one_line_sse2(const uint8_t *src, uint8_t *dst, short con
short brightness, int w);
#if HAVE_X86ASM
+#if ARCH_X86_32
static void process_mmxext(EQParameters *param, uint8_t *dst, int dst_stride,
const uint8_t *src, int src_stride, int w, int h)
{
@@ -45,6 +46,7 @@ static void process_mmxext(EQParameters *param, uint8_t *dst, int dst_stride,
}
emms_c();
}
+#endif
static void process_sse2(EQParameters *param, uint8_t *dst, int dst_stride,
const uint8_t *src, int src_stride, int w, int h)
@@ -65,9 +67,11 @@ av_cold void ff_eq_init_x86(EQContext *eq)
{
#if HAVE_X86ASM
int cpu_flags = av_get_cpu_flags();
+#if ARCH_X86_32
if (EXTERNAL_MMXEXT(cpu_flags)) {
eq->process = process_mmxext;
}
+#endif
if (EXTERNAL_SSE2(cpu_flags)) {
eq->process = process_sse2;
}
--
2.34.1
More information about the ffmpeg-devel
mailing list