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

Git pushed a commit to branch master
in repository ffmpeg.

commit 1a0747633c25eed7592e36a94ce1b12ea7e067b1
Author:     Zuxy Meng <[email protected]>
AuthorDate: Sat May 30 23:48:38 2026 -0700
Commit:     Zuxy Meng <[email protected]>
CommitDate: Fri Jul 24 19:16:45 2026 -0700

    avcodec/x86/h264_intrapred: Deprecate MMX from pred8x8l_horizontal_down_8
    
    Convert use of MMX to SSE2, also fix checkasm test.
    
    Before:
     pred8x8l_horizontal_down_8_sse2:                        33.2 ( 2.53x)
     pred8x8l_horizontal_down_8_ssse3:                       27.8 ( 3.02x)
    
    After:
     pred8x8l_horizontal_down_8_sse2:                        24.3 ( 3.45x)
     pred8x8l_horizontal_down_8_ssse3:                       22.6 ( 3.71x)
    
    Signed-off-by: Zuxy Meng <[email protected]>
---
 libavcodec/x86/h264_intrapred.asm | 169 ++++++++++++++++++--------------------
 tests/checkasm/h264pred.c         |   2 +-
 2 files changed, 83 insertions(+), 88 deletions(-)

diff --git a/libavcodec/x86/h264_intrapred.asm 
b/libavcodec/x86/h264_intrapred.asm
index 8b3b33dced..8009eabe1b 100644
--- a/libavcodec/x86/h264_intrapred.asm
+++ b/libavcodec/x86/h264_intrapred.asm
@@ -1527,110 +1527,100 @@ cglobal pred8x8l_horizontal_up_8, 4,4,6
 ;-----------------------------------------------------------------------------
 
 %macro PRED8x8L_HORIZONTAL_DOWN 0
-cglobal pred8x8l_horizontal_down_8, 4,5
+cglobal pred8x8l_horizontal_down_8, 4,5,8
     sub          r0, r3
     lea          r4, [r0+r3*2]
-    movq        mm0, [r0+r3*1-8]
-    punpckhbw   mm0, [r0+r3*0-8]
-    movq        mm1, [r4+r3*1-8]
-    punpckhbw   mm1, [r0+r3*2-8]
+    movd       xmm0, [r0+r3*1-4]
+    movd       xmm1, [r0+r3*0-4]
+    punpcklbw  xmm0, xmm1
+    movd       xmm1, [r4+r3*1-4]
+    movd       xmm2, [r0+r3*2-4]
+    punpcklbw  xmm1, xmm2
     mov          r4, r0
-    punpckhwd   mm1, mm0
+    punpcklwd  xmm1, xmm0
     lea          r0, [r0+r3*4]
-    movq        mm2, [r0+r3*1-8]
-    punpckhbw   mm2, [r0+r3*0-8]
+    movd       xmm2, [r0+r3*1-4]
+    movd       xmm3, [r0+r3*0-4]
+    punpcklbw  xmm2, xmm3
     lea          r0, [r0+r3*2]
-    movq        mm3, [r0+r3*1-8]
-    punpckhbw   mm3, [r0+r3*0-8]
-    punpckhwd   mm3, mm2
-    punpckhdq   mm3, mm1
+    movd       xmm3, [r0+r3*1-4]
+    movd       xmm4, [r0+r3*0-4]
+    punpcklbw  xmm3, xmm4
+    punpcklwd  xmm3, xmm2
+    punpckhdq  xmm3, xmm1
+    pshufd     xmm3, xmm3, 0xee
     lea          r0, [r0+r3*2]
-    movq        mm0, [r0+r3*0-8]
-    movq        mm1, [r4]
+    movq       xmm0, [r0+r3*0-8]
+    movq       xmm1, [r4]
     mov          r0, r4
-    movq        mm4, mm3
-    movq        mm2, mm3
-    PALIGNR     mm4, mm0, 7, mm0
-    PALIGNR     mm1, mm2, 1, mm2
+    mova       xmm2, xmm3
+    punpcklqdq xmm0, xmm3
+    psrldq     xmm0, 7
+    mova       xmm4, xmm0
+    punpcklqdq xmm2, xmm1
+    psrldq     xmm2, 1
+    mova       xmm1, xmm2
     test        r1d, r1d
     jnz .do_left
 .fix_lt_1:
-    movq        mm5, mm3
-    pxor        mm5, mm4
-    psrlq       mm5, 56
-    psllq       mm5, 48
-    pxor        mm1, mm5
-    jmp .do_left
-.fix_lt_2:
-    movq        mm5, mm3
-    pxor        mm5, mm2
-    psllq       mm5, 56
-    psrlq       mm5, 56
-    pxor        mm2, mm5
-    test        r2d, r2d
-    jnz .do_top
-.fix_tr_1:
-    movq        mm5, mm3
-    pxor        mm5, mm1
-    psrlq       mm5, 56
-    psllq       mm5, 56
-    pxor        mm1, mm5
-    jmp .do_top
-.fix_tr_2:
-    punpckhbw   mm3, mm3
-    pshufw      mm1, mm3, 0xFF
-    jmp .do_topright
+    pxor       xmm5, xmm3, xmm4
+    psrlq      xmm5, 56
+    psllq      xmm5, 48
+    pxor       xmm1, xmm5
 .do_left:
-    movq        mm0, mm4
-    PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5
-    movq2dq    xmm0, mm2
-    pslldq     xmm0, 8
-    movq        mm1, mm0
-    PRED4x4_LOWPASS mm1, mm3, mm0, mm1, mm5
-    movq2dq    xmm2, mm1
-    pslldq     xmm2, 15
+    PRED4x4_LOWPASS xmm2, xmm1, xmm4, xmm3, xmm5
+    movq       xmm6, xmm2
+    pslldq     xmm6, 8
+    mova       xmm4, xmm0
+    PRED4x4_LOWPASS xmm1, xmm3, xmm0, xmm4, xmm5
+    pslldq     xmm2, xmm1, 15
     psrldq     xmm2, 8
-    por        xmm0, xmm2
-    movq        mm0, [r0-8]
-    movq        mm3, [r0]
-    movq        mm1, [r0+8]
-    movq        mm2, mm3
-    movq        mm4, mm3
-    PALIGNR     mm2, mm0, 7, mm0
-    PALIGNR     mm1, mm4, 1, mm4
+    por        xmm6, xmm2
+    movdqu     xmm2, [r0-8]
+    movdqu     xmm1, [r0]
+    mova       xmm3, xmm1
+    psrldq     xmm2, 7
+    psrldq     xmm1, 1
     test        r1d, r1d
-    jz .fix_lt_2
+    jnz .check_r2
+.fix_lt_2:
+    pxor       xmm5, xmm3, xmm2
+    psllq      xmm5, 56
+    psrlq      xmm5, 56
+    pxor       xmm2, xmm5
+.check_r2:
     test        r2d, r2d
-    jz .fix_tr_1
+    jnz .do_top
+.fix_tr_1:
+    pxor       xmm5, xmm3, xmm1
+    psrlq      xmm5, 56
+    psllq      xmm5, 56
+    pxor       xmm1, xmm5
 .do_top:
-    PRED4x4_LOWPASS mm4, mm2, mm1, mm3, mm5
-    movq2dq    xmm1, mm4
+    PRED4x4_LOWPASS xmm7, xmm2, xmm1, xmm3, xmm5
     test        r2d, r2d
     jz .fix_tr_2
-    movq        mm1, [r0+8]
-    movq        mm5, mm1
-    movq        mm2, mm1
-    movq        mm4, mm1
-    psrlq       mm5, 56
-    PALIGNR     mm2, mm3, 7, mm3
-    PALIGNR     mm5, mm4, 1, mm4
-    PRED4x4_LOWPASS mm1, mm2, mm5, mm1, mm4
+    movq       xmm0, [r0+8]
+    psrlq      xmm5, xmm0, 56
+    punpcklqdq xmm3, xmm0
+    psrldq     xmm3, 7
+    punpcklqdq xmm4, xmm0, xmm5
+    psrldq     xmm4, 1
+    PRED4x4_LOWPASS xmm1, xmm3, xmm4, xmm0, xmm4
 .do_topright:
-    movq2dq    xmm5, mm1
-    pslldq     xmm5, 8
-    por        xmm1, xmm5
-INIT_XMM cpuname
+    movq       xmm0, xmm1
+    pslldq     xmm0, 8
+    por        xmm7, xmm0
     lea         r2, [r4+r3*2]
-    movdqa    xmm2, xmm1
-    movdqa    xmm3, xmm1
-    PALIGNR   xmm1, xmm0, 7, xmm4
-    PALIGNR   xmm2, xmm0, 9, xmm5
-    lea         r1, [r2+r3*2]
-    PALIGNR   xmm3, xmm0, 8, xmm0
-    movdqa    xmm4, xmm1
-    pavgb     xmm4, xmm3
-    lea         r0, [r1+r3*2]
-    PRED4x4_LOWPASS xmm3, xmm1, xmm2, xmm3, xmm5
+    movdqa    xmm2, xmm7
+    movdqa    xmm3, xmm7
+    PALIGNR   xmm7, xmm6, 7, xmm4
+    PALIGNR   xmm2, xmm6, 9, xmm0
+    lea         r1, [r4+r3*4]
+    PALIGNR   xmm3, xmm6, 8, xmm6
+    pavgb     xmm4, xmm7, xmm3
+    lea         r0, [r2+r3*4]
+    PRED4x4_LOWPASS xmm3, xmm7, xmm2, xmm3, xmm5
     punpcklbw xmm4, xmm3
     movhlps   xmm3, xmm4
     movq   [r0+r3*2], xmm4
@@ -1648,11 +1638,16 @@ INIT_XMM cpuname
     movq   [r1+r3*1], xmm4
     movq   [r4+r3*1], xmm3
     RET
+.fix_tr_2:
+    punpcklbw  xmm3, xmm3
+    pshufd     xmm3, xmm3, 0xEE
+    pshuflw    xmm1, xmm3, 0xFF
+    jmp .do_topright
 %endmacro
 
-INIT_MMX sse2
+INIT_XMM sse2
 PRED8x8L_HORIZONTAL_DOWN
-INIT_MMX ssse3
+INIT_XMM ssse3
 PRED8x8L_HORIZONTAL_DOWN
 
 
;-------------------------------------------------------------------------------
diff --git a/tests/checkasm/h264pred.c b/tests/checkasm/h264pred.c
index f4538a3562..21ce7f4c35 100644
--- a/tests/checkasm/h264pred.c
+++ b/tests/checkasm/h264pred.c
@@ -37,7 +37,7 @@ static const char * const pred4x4_modes[4][15] = {
         [DIAG_DOWN_LEFT_PRED ] = "down_left",
         [DIAG_DOWN_RIGHT_PRED] = "down_right",
         [VERT_RIGHT_PRED     ] = "vertical_right",
-        [HOR_DOWN_PRED       ] = "horizontal_right",
+        [HOR_DOWN_PRED       ] = "horizontal_down",
         [VERT_LEFT_PRED      ] = "vertical_left",
         [HOR_UP_PRED         ] = "horizontal_up",
         [LEFT_DC_PRED        ] = "left_dc",

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

Reply via email to