From 2831837182fe26f0a19a4d366f3f0553311f1291 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Sat, 11 Jun 2022 01:13:22 +0200 Subject: swscale/x86/yuv2rgb: Remove obsolete MMX functions x64 always has MMX, MMXEXT, SSE and SSE2 and this means that some functions for MMX, MMXEXT and 3dnow are always overridden by other functions (unless one e.g. explicitly disables SSE2) for x64. So given that the only systems that benefit from these functions are truely ancient 32bit x86s they are removed. Signed-off-by: Andreas Rheinhardt --- libswscale/x86/yuv2rgb.c | 15 +++++---------- libswscale/x86/yuv2rgb_template.c | 5 +++-- libswscale/x86/yuv_2_rgb.asm | 5 +++-- 3 files changed, 11 insertions(+), 14 deletions(-) (limited to 'libswscale') diff --git a/libswscale/x86/yuv2rgb.c b/libswscale/x86/yuv2rgb.c index 47f45bd7c2..6754062245 100644 --- a/libswscale/x86/yuv2rgb.c +++ b/libswscale/x86/yuv2rgb.c @@ -44,23 +44,22 @@ //MMX versions #if HAVE_MMX #undef RENAME -#undef COMPILE_TEMPLATE_MMXEXT -#define COMPILE_TEMPLATE_MMXEXT 0 +#define COMPILE_TEMPLATE_MMX #define RENAME(a) a ## _mmx #include "yuv2rgb_template.c" +#undef COMPILE_TEMPLATE_MMX #endif /* HAVE_MMX */ // MMXEXT versions #undef RENAME -#undef COMPILE_TEMPLATE_MMXEXT -#define COMPILE_TEMPLATE_MMXEXT 1 +#define COMPILE_TEMPLATE_MMXEXT #define RENAME(a) a ## _mmxext #include "yuv2rgb_template.c" +#undef COMPILE_TEMPLATE_MMXEXT //SSSE3 versions #undef RENAME -#undef COMPILE_TEMPLATE_MMXEXT -#define COMPILE_TEMPLATE_MMXEXT 0 +#define COMPILE_TEMPLATE_SSSE3 #define RENAME(a) a ## _ssse3 #include "yuv2rgb_template.c" @@ -127,10 +126,6 @@ av_cold SwsFunc ff_yuv2rgb_init_x86(SwsContext *c) break; } else return yuv420_bgr32_mmx; - case AV_PIX_FMT_RGB24: - return yuv420_rgb24_mmx; - case AV_PIX_FMT_BGR24: - return yuv420_bgr24_mmx; case AV_PIX_FMT_RGB565: return yuv420_rgb16_mmx; case AV_PIX_FMT_RGB555: diff --git a/libswscale/x86/yuv2rgb_template.c b/libswscale/x86/yuv2rgb_template.c index d506f75e15..596943bb73 100644 --- a/libswscale/x86/yuv2rgb_template.c +++ b/libswscale/x86/yuv2rgb_template.c @@ -47,7 +47,7 @@ extern void RENAME(ff_yuv_420_bgr24)(x86_reg index, uint8_t *image, const uint8_ const uint8_t *pv_index, const uint64_t *pointer_c_dither, const uint8_t *py_2index); -#if !COMPILE_TEMPLATE_MMXEXT +#ifndef COMPILE_TEMPLATE_MMXEXT extern void RENAME(ff_yuv_420_rgb15)(x86_reg index, uint8_t *image, const uint8_t *pu_index, const uint8_t *pv_index, const uint64_t *pointer_c_dither, const uint8_t *py_2index); @@ -165,6 +165,7 @@ static inline int RENAME(yuva420_bgr32)(SwsContext *c, const uint8_t *src[], } #endif +#if !defined(COMPILE_TEMPLATE_MMX) static inline int RENAME(yuv420_rgb24)(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, @@ -192,4 +193,4 @@ static inline int RENAME(yuv420_bgr24)(SwsContext *c, const uint8_t *src[], } return srcSliceH; } - +#endif diff --git a/libswscale/x86/yuv_2_rgb.asm b/libswscale/x86/yuv_2_rgb.asm index f968b3a0a2..c5fa3ee690 100644 --- a/libswscale/x86/yuv_2_rgb.asm +++ b/libswscale/x86/yuv_2_rgb.asm @@ -69,6 +69,9 @@ SECTION .text %ifidn %1, yuva %define parameters index, image, pu_index, pv_index, pointer_c_dither, py_2index, pa_2index %define GPR_num 7 + %else + %define parameters index, image, pu_index, pv_index, pointer_c_dither, py_2index + %define GPR_num 6 %endif %else %define parameters index, image, pu_index, pv_index, pointer_c_dither, py_2index @@ -356,8 +359,6 @@ REP_RET %endmacro INIT_MMX mmx -yuv2rgb_fn yuv, rgb, 24 -yuv2rgb_fn yuv, bgr, 24 yuv2rgb_fn yuv, rgb, 32 yuv2rgb_fn yuv, bgr, 32 yuv2rgb_fn yuva, rgb, 32 -- cgit v1.2.3