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

Git pushed a commit to branch master
in repository ffmpeg.

commit 30fe4f148f08c8be9063d6b8cfcf0f64bcf3a78b
Author:     Andreas Rheinhardt <[email protected]>
AuthorDate: Tue Jun 23 21:37:46 2026 +0200
Commit:     Andreas Rheinhardt <[email protected]>
CommitDate: Sat Jun 27 00:06:08 2026 +0200

    avcodec/x86/hevc/mc: Use pmaddwd in biweight functions
    
    Improves performance and saves 384B of .text here;
    also avoids using nonvolatile registers on Win64.
    
    Old benchmarks (just a selection):
      put_hevc_qpel_bi_w_v16_8_c:           1158.1
      put_hevc_qpel_bi_w_v16_8_sse4:         214.4 ( 5.40x)
      put_hevc_qpel_bi_w_v16_10_c:          2193.3
      put_hevc_qpel_bi_w_v16_10_sse4:        318.5 ( 6.89x)
      put_hevc_qpel_bi_w_v16_12_c:          2188.5
      put_hevc_qpel_bi_w_v16_12_sse4:        317.8 ( 6.89x)
      put_hevc_qpel_bi_w_v24_8_c:           2940.5
      put_hevc_qpel_bi_w_v24_8_sse4:         502.9 ( 5.85x)
      put_hevc_qpel_bi_w_v24_10_c:          4557.1
      put_hevc_qpel_bi_w_v24_10_sse4:        686.0 ( 6.64x)
      put_hevc_qpel_bi_w_v24_12_c:          4557.1
      put_hevc_qpel_bi_w_v24_12_sse4:        688.4 ( 6.62x)
      put_hevc_qpel_bi_w_v32_8_c:           3753.0
      put_hevc_qpel_bi_w_v32_8_sse4:         817.8 ( 4.59x)
      put_hevc_qpel_bi_w_v32_10_c:          6504.2
      put_hevc_qpel_bi_w_v32_10_sse4:       1227.7 ( 5.30x)
      put_hevc_qpel_bi_w_v32_12_c:          6502.0
      put_hevc_qpel_bi_w_v32_12_sse4:       1230.8 ( 5.28x)
      put_hevc_qpel_bi_w_v48_8_c:           7756.0
      put_hevc_qpel_bi_w_v48_8_sse4:        1805.9 ( 4.29x)
      put_hevc_qpel_bi_w_v48_10_c:         12938.4
      put_hevc_qpel_bi_w_v48_10_sse4:       2690.5 ( 4.81x)
      put_hevc_qpel_bi_w_v48_12_c:         12934.1
      put_hevc_qpel_bi_w_v48_12_sse4:       2691.2 ( 4.81x)
      put_hevc_qpel_bi_w_v64_8_c:          13212.5
      put_hevc_qpel_bi_w_v64_8_sse4:        3183.9 ( 4.15x)
      put_hevc_qpel_bi_w_v64_10_c:         21520.0
      put_hevc_qpel_bi_w_v64_10_sse4:       4854.9 ( 4.43x)
      put_hevc_qpel_bi_w_v64_12_c:         21529.5
      put_hevc_qpel_bi_w_v64_12_sse4:       4860.9 ( 4.43x)
    
    New benchmarks:
      put_hevc_qpel_bi_w_v16_8_c:           1159.1
      put_hevc_qpel_bi_w_v16_8_sse4:         176.7 ( 6.56x)
      put_hevc_qpel_bi_w_v16_10_c:          2196.5
      put_hevc_qpel_bi_w_v16_10_sse4:        279.9 ( 7.85x)
      put_hevc_qpel_bi_w_v16_12_c:          2189.3
      put_hevc_qpel_bi_w_v16_12_sse4:        280.5 ( 7.80x)
      put_hevc_qpel_bi_w_v24_8_c:           2940.4
      put_hevc_qpel_bi_w_v24_8_sse4:         417.5 ( 7.04x)
      put_hevc_qpel_bi_w_v24_10_c:          4553.1
      put_hevc_qpel_bi_w_v24_10_sse4:        605.9 ( 7.51x)
      put_hevc_qpel_bi_w_v24_12_c:          4573.9
      put_hevc_qpel_bi_w_v24_12_sse4:        605.6 ( 7.55x)
      put_hevc_qpel_bi_w_v32_8_c:           3752.2
      put_hevc_qpel_bi_w_v32_8_sse4:         668.2 ( 5.61x)
      put_hevc_qpel_bi_w_v32_10_c:          6482.2
      put_hevc_qpel_bi_w_v32_10_sse4:       1077.4 ( 6.02x)
      put_hevc_qpel_bi_w_v32_12_c:          6484.9
      put_hevc_qpel_bi_w_v32_12_sse4:       1088.0 ( 5.96x)
      put_hevc_qpel_bi_w_v48_8_c:           7765.1
      put_hevc_qpel_bi_w_v48_8_sse4:        1467.8 ( 5.29x)
      put_hevc_qpel_bi_w_v48_10_c:         12902.8
      put_hevc_qpel_bi_w_v48_10_sse4:       2356.6 ( 5.47x)
      put_hevc_qpel_bi_w_v48_12_c:         12931.1
      put_hevc_qpel_bi_w_v48_12_sse4:       2356.6 ( 5.49x)
      put_hevc_qpel_bi_w_v64_8_c:          13207.2
      put_hevc_qpel_bi_w_v64_8_sse4:        2624.9 ( 5.03x)
      put_hevc_qpel_bi_w_v64_10_c:         21542.3
      put_hevc_qpel_bi_w_v64_10_sse4:       4438.8 ( 4.85x)
      put_hevc_qpel_bi_w_v64_12_c:         21537.4
      put_hevc_qpel_bi_w_v64_12_sse4:       4359.5 ( 4.94x)
    
    Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 libavcodec/x86/hevc/mc.asm | 38 +++++++++-----------------------------
 1 file changed, 9 insertions(+), 29 deletions(-)

diff --git a/libavcodec/x86/hevc/mc.asm b/libavcodec/x86/hevc/mc.asm
index 550f7a0e23..66ed406c26 100644
--- a/libavcodec/x86/hevc/mc.asm
+++ b/libavcodec/x86/hevc/mc.asm
@@ -1090,27 +1090,17 @@ cglobal hevc_put_uni_w%1_%2, 6, 6, 7, dst, dststride, 
src, height, denom, wx, ox
     jnz               .loop                      ; height loop
     RET
 
-cglobal hevc_put_bi_w%1_%2, 4, 6, 10, dst, dststride, src, src2, height, 
denom, wx0, wx1, ox0, ox1
+cglobal hevc_put_bi_w%1_%2, 4, 6, 6, dst, dststride, src, src2, height, denom, 
wx0, wx1, ox0, ox1
     movifnidn        r5d, denomm
-%if %1 <= 4
-    pxor              m1, m1
-%endif
-    movd              m2, wx0m         ; WX0
+    movd              m3, wx0m         ; WX0
     lea              r5d, [r5d+14-%2]  ; shift = 14 - bitd + denom
-    movd              m3, wx1m         ; WX1
+    movd              m2, wx1m         ; WX1
     movd              m0, r5d          ; shift
-%if %1 <= 4
-    punpcklwd         m2, m1
-    punpcklwd         m3, m1
-%else
-    punpcklwd         m2, m2
-    punpcklwd         m3, m3
-%endif
+    punpcklwd         m2, m3
     inc              r5d
     movd              m5, r5d          ; shift+1
     pshufd            m2, m2, 0
     mov              r5d, ox0m
-    pshufd            m3, m3, 0
     add              r5d, ox1m
 %if %2 != 8
     shl              r5d, %2-8         ; ox << (bitd - 8)
@@ -1128,26 +1118,16 @@ cglobal hevc_put_bi_w%1_%2, 4, 6, 10, dst, dststride, 
src, src2, height, denom,
 
 .loop:
    SIMPLE_LOAD        %1, 10, srcq,  m0
-   SIMPLE_LOAD        %1, 10, src2q, m8
+   SIMPLE_LOAD        %1, 10, src2q, m1
 %if %1 <= 4
     punpcklwd         m0, m1
-    punpcklwd         m8, m1
-    pmaddwd           m0, m3
-    pmaddwd           m8, m2
+    pmaddwd           m0, m2
     paddd             m0, m4
-    paddd             m0, m8
     psrad             m0, m5
 %else
-    pmulhw            m6, m0, m3
-    pmullw            m0, m3
-    pmulhw            m7, m8, m2
-    pmullw            m8, m2
-    punpckhwd         m1, m0, m6
-    punpcklwd         m0, m6
-    punpckhwd         m9, m8, m7
-    punpcklwd         m8, m7
-    paddd             m0, m8
-    paddd             m1, m9
+    SBUTTERFLY        wd, 0, 1, 3
+    pmaddwd           m0, m2
+    pmaddwd           m1, m2
     paddd             m0, m4
     paddd             m1, m4
     psrad             m0, m5

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

Reply via email to