[FFmpeg-cvslog] swscale/x86/swscale: fix compilation with old yasm

James Almer git at videolan.org
Thu Feb 18 02:19:45 EET 2021


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Wed Feb 17 21:05:41 2021 -0300| [c2bf1dcace8d331e672b955f9cf5b59211749f00] | committer: James Almer

swscale/x86/swscale: fix compilation with old yasm

Where AVX2 may not be supported.

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c2bf1dcace8d331e672b955f9cf5b59211749f00
---

 libswscale/x86/swscale.c    | 15 +++++++++++----
 libswscale/x86/yuv2yuvX.asm |  2 ++
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
index 3df193a067..316a824e87 100644
--- a/libswscale/x86/swscale.c
+++ b/libswscale/x86/swscale.c
@@ -244,7 +244,9 @@ static void yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, \
 YUV2YUVX_FUNC_MMX(mmx, 16)
 YUV2YUVX_FUNC_MMX(mmxext, 16)
 YUV2YUVX_FUNC(sse3, 32)
+#if HAVE_AVX2_EXTERNAL
 YUV2YUVX_FUNC(avx2, 64)
+#endif
 
 #endif
 
@@ -376,13 +378,18 @@ av_cold void ff_sws_init_swscale_x86(SwsContext *c)
 #if HAVE_MMXEXT_INLINE
     if (INLINE_MMXEXT(cpu_flags))
         sws_init_swscale_mmxext(c);
-    if (cpu_flags & AV_CPU_FLAG_AVX2){
+#endif
+#if HAVE_SSSE3_EXTERNAL
+    if (EXTERNAL_SSSE3(cpu_flags)) {
         if(c->use_mmx_vfilter && !(c->flags & SWS_ACCURATE_RND)){
-            c->yuv2planeX = yuv2yuvX_avx2;
+            c->yuv2planeX = yuv2yuvX_sse3;
         }
-    } else if (cpu_flags & AV_CPU_FLAG_SSE3){
+    }
+#endif
+#if HAVE_AVX2_EXTERNAL
+    if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         if(c->use_mmx_vfilter && !(c->flags & SWS_ACCURATE_RND)){
-            c->yuv2planeX = yuv2yuvX_sse3;
+            c->yuv2planeX = yuv2yuvX_avx2;
         }
     }
 #endif
diff --git a/libswscale/x86/yuv2yuvX.asm b/libswscale/x86/yuv2yuvX.asm
index b8874cde8c..6d3ba96204 100644
--- a/libswscale/x86/yuv2yuvX.asm
+++ b/libswscale/x86/yuv2yuvX.asm
@@ -132,5 +132,7 @@ INIT_MMX mmxext
 YUV2YUVX_FUNC
 INIT_XMM sse3
 YUV2YUVX_FUNC
+%if HAVE_AVX2_EXTERNAL
 INIT_YMM avx2
 YUV2YUVX_FUNC
+%endif



More information about the ffmpeg-cvslog mailing list