PR #24849 opened by Niklas Haas (haasn)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24849
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24849.patch

According to Fairy, this improves speed on some platforms/CPUs. I was not able
to verify any performance difference (below the noise floor) on my own machine.

I omit the loop inside sws_process* because that function calls into othe
functions anyways.

Signed-off-by: Niklas Haas <[email protected]>

# Summary of changes

Briefly describe what this PR does and why.

<!--
If this PR requires new FATE test samples, attach them to the PR and
list their target paths below (relative to the fate-suite root).

Attached filenames must match the sample's filename:

```fate-samples
# e.g. vorbis/new-sample.ogg
```
-->



>From 2c6f0ef8f37cec210c73971d4dfdb50bd1a9cce0 Mon Sep 17 00:00:00 2001
From: Niklas Haas <[email protected]>
Date: Fri, 2 Oct 2026 14:32:48 +0200
Subject: [PATCH] swscale/x86/ops: align inner loops to 32-byte boundaries

According to Fairy, this improves speed on some platforms/CPUs. I was not able
to verify any performance difference (below the noise floor) on my own machine.

I omit the loop inside sws_process* because that function calls into othe
functions anyways.

Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/x86/ops_common.asm | 1 +
 libswscale/x86/ops_float.asm  | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/libswscale/x86/ops_common.asm b/libswscale/x86/ops_common.asm
index e1f658b0e6..712dcb4f40 100644
--- a/libswscale/x86/ops_common.asm
+++ b/libswscale/x86/ops_common.asm
@@ -219,6 +219,7 @@ cglobal NAME, 6, 10, 3, exec, shuffle, bx, y, bxend, yend, 
src, dst, src_stride,
             sub srcq, srcidxq
             sub dstq, dstidxq
 
+align 32
 .loop:
             READ m1, [srcq + srcidxq]
     %if LANE_ALIGNED || mmsize == 16
diff --git a/libswscale/x86/ops_float.asm b/libswscale/x86/ops_float.asm
index 2c1858c14a..e2cdffa3ee 100644
--- a/libswscale/x86/ops_float.asm
+++ b/libswscale/x86/ops_float.asm
@@ -106,6 +106,7 @@ IF X,   push in0q
 IF Y,   push in1q
 IF Z,   push in2q
 IF W,   push in3q
+align 32
 .loop:
 IF X,   add in0q, [execq + SwsOpExec.in_stride0]
 IF Y,   add in1q, [execq + SwsOpExec.in_stride1]
@@ -238,6 +239,7 @@ IF X,   push in0q
 IF Y,   push in1q
 IF Z,   push in2q
 IF W,   push in3q
+align 32
 .loop:
 IF X,   add in0q, 4
 IF Y,   add in1q, 4
@@ -329,6 +331,7 @@ IF W,   mulps mw2, m12
         jz %%done
         push weights
         push %2
+align 32
 %%loop:
         add weights, 64
         add %2, (16 / SIZEOF_WEIGHT) * BYTES ; pixels per xmm reg
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to