[FFmpeg-devel] [PATCH 12/41] avcodec/x86/diracdsp_init: Disable overridden functions on x64

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Fri Jun 10 02:54:54 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 such diracdsp functions
at compile-time.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/x86/diracdsp_init.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/x86/diracdsp_init.c b/libavcodec/x86/diracdsp_init.c
index 8baacf3129..c9dca58f1b 100644
--- a/libavcodec/x86/diracdsp_init.c
+++ b/libavcodec/x86/diracdsp_init.c
@@ -87,9 +87,11 @@ static void OPNAME ## _dirac_pixels32_ ## EXT(uint8_t *dst, const uint8_t *src[5
     }\
 }
 
+#if !ARCH_X86_64
 DIRAC_PIXOP(put, mmx)
 DIRAC_PIXOP(avg, mmx)
 DIRAC_PIXOP(avg, mmxext)
+#endif
 
 DIRAC_PIXOP(put, sse2)
 DIRAC_PIXOP(avg, sse2)
@@ -114,13 +116,13 @@ void ff_diracdsp_init_x86(DiracDSPContext* c)
         c->dirac_hpel_filter = dirac_hpel_filter_mmx;
         c->add_rect_clamped = ff_add_rect_clamped_mmx;
         c->put_signed_rect_clamped[0] = (void *)ff_put_signed_rect_clamped_mmx;
-#endif
         PIXFUNC(put, 0, mmx);
         PIXFUNC(avg, 0, mmx);
     }
 
     if (EXTERNAL_MMXEXT(mm_flags)) {
         PIXFUNC(avg, 0, mmxext);
+#endif
     }
 
     if (EXTERNAL_SSE2(mm_flags)) {
-- 
2.34.1



More information about the ffmpeg-devel mailing list