[FFmpeg-devel] [PATCH 1/3] swscale/x86/swscale: Process yuv2yuvX tails using next largest register size

Alan Kelly alankelly at google.com
Fri Jul 14 13:08:17 EEST 2023


---
 libswscale/x86/swscale.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
index ff16398988..8c67bf4fab 100644
--- a/libswscale/x86/swscale.c
+++ b/libswscale/x86/swscale.c
@@ -194,7 +194,7 @@ static void yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, \
     return; \
 }
 
-#define YUV2YUVX_FUNC(opt, step)  \
+#define YUV2YUVX_FUNC(opt, step, tail)  \
 void ff_yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, int srcOffset, \
                            uint8_t *dest, int dstW,  \
                            const uint8_t *dither, int offset); \
@@ -211,7 +211,7 @@ static void yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, \
     if(pixelsProcessed > 0) \
         ff_yuv2yuvX_ ##opt(filter, filterSize - 1, 0, dest - offset, pixelsProcessed + offset, dither, offset); \
     if(remainder > 0){ \
-      ff_yuv2yuvX_mmxext(filter, filterSize - 1, pixelsProcessed, dest - offset, pixelsProcessed + remainder + offset, dither, offset); \
+      yuv2yuvX_ ##tail(filter, filterSize, src, dest, dstW, dither, offset); \
     } \
     return; \
 }
@@ -220,10 +220,10 @@ static void yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, \
 YUV2YUVX_FUNC_MMX(mmxext, 16)
 #endif
 #if HAVE_SSE3_EXTERNAL
-YUV2YUVX_FUNC(sse3, 32)
+YUV2YUVX_FUNC(sse3, 32, mmxext)
 #endif
 #if HAVE_AVX2_EXTERNAL
-YUV2YUVX_FUNC(avx2, 64)
+YUV2YUVX_FUNC(avx2, 64, sse3)
 #endif
 
 #define SCALE_FUNC(filter_n, from_bpc, to_bpc, opt) \
-- 
2.41.0.255.g8b1d071c50-goog



More information about the ffmpeg-devel mailing list