This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 96f82f4fbbdc8f7525672bafbf37616ea5fd76ca
Author:     Niklas Haas <[email protected]>
AuthorDate: Tue Mar 31 16:24:05 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Thu Apr 16 23:25:17 2026 +0200

    swscale/x86/ops: simplify SWS_OP_CLEAR patterns
    
    Mark the components to be cleared, not the components to be preserved.
    
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/x86/ops.c       | 34 +++++++++++++++---------------
 libswscale/x86/ops_int.asm | 52 ++++++++++++++++++++++------------------------
 2 files changed, 42 insertions(+), 44 deletions(-)

diff --git a/libswscale/x86/ops.c b/libswscale/x86/ops.c
index fa18c17104..4ae5a14d27 100644
--- a/libswscale/x86/ops.c
+++ b/libswscale/x86/ops.c
@@ -141,7 +141,7 @@ static int setup_clear(const SwsImplParams *params, 
SwsImplResult *out)
     DECL_ASM(U8, SWS_COMP_ALL, p##X##Y##Z##W##_clear##EXT,                     
 \
         .op = SWS_OP_CLEAR,                                                    
 \
         .setup = setup_clear,                                                  
 \
-        .clear.mask = SWS_COMP_MASK(!X, !Y, !Z, !W),                           
 \
+        .clear.mask = SWS_COMP_MASK(X, Y, Z, W),                               
 \
     );
 
 #define DECL_SWIZZLE(EXT, X, Y, Z, W)                                          
 \
@@ -589,16 +589,16 @@ static int setup_filter_4x4_h(const SwsImplParams 
*params, SwsImplResult *out)
     DECL_CLEAR_ZERO(EXT, 0)                                                    
 \
     DECL_CLEAR_ZERO(EXT, 1)                                                    
 \
     DECL_CLEAR_ZERO(EXT, 3)                                                    
 \
-    DECL_CLEAR(EXT, 1, 1, 1, 0)                                                
 \
-    DECL_CLEAR(EXT, 0, 1, 1, 1)                                                
 \
-    DECL_CLEAR(EXT, 0, 0, 1, 1)                                                
 \
-    DECL_CLEAR(EXT, 1, 0, 0, 1)                                                
 \
+    DECL_CLEAR(EXT, 0, 0, 0, 1)                                                
 \
+    DECL_CLEAR(EXT, 1, 0, 0, 0)                                                
 \
     DECL_CLEAR(EXT, 1, 1, 0, 0)                                                
 \
-    DECL_CLEAR(EXT, 0, 1, 0, 1)                                                
 \
+    DECL_CLEAR(EXT, 0, 1, 1, 0)                                                
 \
+    DECL_CLEAR(EXT, 0, 0, 1, 1)                                                
 \
     DECL_CLEAR(EXT, 1, 0, 1, 0)                                                
 \
-    DECL_CLEAR(EXT, 1, 0, 0, 0)                                                
 \
-    DECL_CLEAR(EXT, 0, 1, 0, 0)                                                
 \
-    DECL_CLEAR(EXT, 0, 0, 1, 0)                                                
 \
+    DECL_CLEAR(EXT, 0, 1, 0, 1)                                                
 \
+    DECL_CLEAR(EXT, 0, 1, 1, 1)                                                
 \
+    DECL_CLEAR(EXT, 1, 0, 1, 1)                                                
 \
+    DECL_CLEAR(EXT, 1, 1, 0, 1)                                                
 \
                                                                                
 \
 static const SwsOpTable ops8##EXT = {                                          
 \
     .cpu_flags = AV_CPU_FLAG_##FLAG,                                           
 \
@@ -656,16 +656,16 @@ static const SwsOpTable ops8##EXT = {
         &op_clear_zero0##EXT,                                                  
 \
         &op_clear_zero1##EXT,                                                  
 \
         &op_clear_zero3##EXT,                                                  
 \
-        REF_PATTERN(clear##EXT, 1, 1, 1, 0),                                   
 \
-        REF_PATTERN(clear##EXT, 0, 1, 1, 1),                                   
 \
-        REF_PATTERN(clear##EXT, 0, 0, 1, 1),                                   
 \
-        REF_PATTERN(clear##EXT, 1, 0, 0, 1),                                   
 \
+        REF_PATTERN(clear##EXT, 0, 0, 0, 1),                                   
 \
+        REF_PATTERN(clear##EXT, 1, 0, 0, 0),                                   
 \
         REF_PATTERN(clear##EXT, 1, 1, 0, 0),                                   
 \
-        REF_PATTERN(clear##EXT, 0, 1, 0, 1),                                   
 \
+        REF_PATTERN(clear##EXT, 0, 1, 1, 0),                                   
 \
+        REF_PATTERN(clear##EXT, 0, 0, 1, 1),                                   
 \
         REF_PATTERN(clear##EXT, 1, 0, 1, 0),                                   
 \
-        REF_PATTERN(clear##EXT, 1, 0, 0, 0),                                   
 \
-        REF_PATTERN(clear##EXT, 0, 1, 0, 0),                                   
 \
-        REF_PATTERN(clear##EXT, 0, 0, 1, 0),                                   
 \
+        REF_PATTERN(clear##EXT, 0, 1, 0, 1),                                   
 \
+        REF_PATTERN(clear##EXT, 0, 1, 1, 1),                                   
 \
+        REF_PATTERN(clear##EXT, 1, 0, 1, 1),                                   
 \
+        REF_PATTERN(clear##EXT, 1, 1, 0, 1),                                   
 \
         NULL                                                                   
 \
     },                                                                         
 \
 };
diff --git a/libswscale/x86/ops_int.asm b/libswscale/x86/ops_int.asm
index 15e0918083..55534d4f4b 100644
--- a/libswscale/x86/ops_int.asm
+++ b/libswscale/x86/ops_int.asm
@@ -602,47 +602,45 @@ IF V2,  mova %3, %2
         CONTINUE tmp0q
 %endmacro
 
-; note: the pattern is inverted for these functions; i.e. X=1 implies that we
-; *keep* the X component, not that we clear it
 %macro clear_generic 0
 op clear
             LOAD_CONT tmp0q
 %if cpuflag(avx2)
-    IF !X,  vpbroadcastd mx, [implq + SwsOpImpl.priv + 0]
-    IF !Y,  vpbroadcastd my, [implq + SwsOpImpl.priv + 4]
-    IF !Z,  vpbroadcastd mz, [implq + SwsOpImpl.priv + 8]
-    IF !W,  vpbroadcastd mw, [implq + SwsOpImpl.priv + 12]
+    IF X,   vpbroadcastd mx, [implq + SwsOpImpl.priv + 0]
+    IF Y,   vpbroadcastd my, [implq + SwsOpImpl.priv + 4]
+    IF Z,   vpbroadcastd mz, [implq + SwsOpImpl.priv + 8]
+    IF W,   vpbroadcastd mw, [implq + SwsOpImpl.priv + 12]
 %else ; !cpuflag(avx2)
-    IF !X,  movd mx, [implq + SwsOpImpl.priv + 0]
-    IF !Y,  movd my, [implq + SwsOpImpl.priv + 4]
-    IF !Z,  movd mz, [implq + SwsOpImpl.priv + 8]
-    IF !W,  movd mw, [implq + SwsOpImpl.priv + 12]
-    IF !X,  pshufd mx, mx, 0
-    IF !Y,  pshufd my, my, 0
-    IF !Z,  pshufd mz, mz, 0
-    IF !W,  pshufd mw, mw, 0
+    IF X,   movd mx, [implq + SwsOpImpl.priv + 0]
+    IF Y,   movd my, [implq + SwsOpImpl.priv + 4]
+    IF Z,   movd mz, [implq + SwsOpImpl.priv + 8]
+    IF W,   movd mw, [implq + SwsOpImpl.priv + 12]
+    IF X,   pshufd mx, mx, 0
+    IF Y,   pshufd my, my, 0
+    IF Z,   pshufd mz, mz, 0
+    IF W,   pshufd mw, mw, 0
 %endif
 %if V2
-    IF !X,  mova mx2, mx
-    IF !Y,  mova my2, my
-    IF !Z,  mova mz2, mz
-    IF !W,  mova mw2, mw
+    IF X,   mova mx2, mx
+    IF Y,   mova my2, my
+    IF Z,   mova mz2, mz
+    IF W,   mova mw2, mw
 %endif
             CONTINUE tmp0q
 %endmacro
 
 %macro clear_funcs 0
-        decl_pattern 1, 1, 1, 0, clear_generic
-        decl_pattern 0, 1, 1, 1, clear_generic
-        decl_pattern 0, 0, 1, 1, clear_generic
-        decl_pattern 1, 0, 1, 1, clear_generic
-        decl_pattern 1, 0, 0, 1, clear_generic
-        decl_pattern 1, 1, 0, 0, clear_generic
-        decl_pattern 0, 1, 0, 1, clear_generic
-        decl_pattern 1, 0, 1, 0, clear_generic
+        decl_pattern 0, 0, 0, 1, clear_generic
         decl_pattern 1, 0, 0, 0, clear_generic
+        decl_pattern 1, 1, 0, 0, clear_generic
         decl_pattern 0, 1, 0, 0, clear_generic
-        decl_pattern 0, 0, 1, 0, clear_generic
+        decl_pattern 0, 1, 1, 0, clear_generic
+        decl_pattern 0, 0, 1, 1, clear_generic
+        decl_pattern 1, 0, 1, 0, clear_generic
+        decl_pattern 0, 1, 0, 1, clear_generic
+        decl_pattern 0, 1, 1, 1, clear_generic
+        decl_pattern 1, 0, 1, 1, clear_generic
+        decl_pattern 1, 1, 0, 1, clear_generic
 %endmacro
 
 ;---------------------------------------------------------

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

Reply via email to