diff mbox series

[FFmpeg-devel,3/3] swscale/swscale: Disable x86-specific code for other arches

Message ID AM7PR03MB6660DD5190FE3A39758CD4628FDE9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 044a7c08dc7ef565786fdc87a35298033bb0ef02
Headers show
Series [FFmpeg-devel,1/3] libswscale/options: Add parent_log_context_offset to AVClass
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 18, 2021, 3:43 a.m. UTC
SSE2 is x86 specific, yet due to the call to av_get_cpu_flags()
compilers were unable to optimize the checks (and the call) away
on other arches.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
This is not really tested. But what is there to test?

 libswscale/swscale.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 040172752f..c7069ae7b2 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -321,6 +321,7 @@  static int swscale(SwsContext *c, const uint8_t *src[],
         }
     }
 
+#if ARCH_X86
     if (   (uintptr_t)dst[0]&15 || (uintptr_t)dst[1]&15 || (uintptr_t)dst[2]&15
         || (uintptr_t)src[0]&15 || (uintptr_t)src[1]&15 || (uintptr_t)src[2]&15
         || dstStride[0]&15 || dstStride[1]&15 || dstStride[2]&15 || dstStride[3]&15
@@ -333,6 +334,7 @@  static int swscale(SwsContext *c, const uint8_t *src[],
             av_log(c, AV_LOG_WARNING, "Warning: data is not aligned! This can lead to a speed loss\n");
         }
     }
+#endif
 
     if (scale_dst) {
         dstY         = dstSliceY;