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

Git pushed a commit to branch master
in repository ffmpeg.

commit c7e532e81e44c5687270dfffa8c05e393bd94830
Author:     Zuxy Meng <[email protected]>
AuthorDate: Tue May 26 20:47:44 2026 -0700
Commit:     Zuxy Meng <[email protected]>
CommitDate: Fri Jul 24 19:16:45 2026 -0700

    avcodec/x86/h264_intrapred: SSE2 impl. of pred8x8l_horizontal_8
    
    Deprecate MMX. Remove the SSSE3 impl. since we no longer use palignr. No
    change in performance.
    
    pred8x8l_horizontal_8_mmxext:                           16.2 ( 1.44x)
    pred8x8l_horizontal_8_ssse3:                            15.6 ( 1.50x)
    pred8x8l_horizontal_8_sse2:                             15.8 ( 1.49x)
    
    Signed-off-by: Zuxy Meng <[email protected]>
---
 libavcodec/x86/h264_intrapred.asm    | 101 +++++++++++++++++------------------
 libavcodec/x86/h264_intrapred_init.c |   6 +--
 2 files changed, 51 insertions(+), 56 deletions(-)

diff --git a/libavcodec/x86/h264_intrapred.asm 
b/libavcodec/x86/h264_intrapred.asm
index 841ee9255e..599b147758 100644
--- a/libavcodec/x86/h264_intrapred.asm
+++ b/libavcodec/x86/h264_intrapred.asm
@@ -958,72 +958,69 @@ cglobal pred8x8l_dc_8, 4,5,6
 ;                               int has_topright, ptrdiff_t stride)
 ;-----------------------------------------------------------------------------
 
-%macro PRED8x8L_HORIZONTAL 0
-cglobal pred8x8l_horizontal_8, 4,4
+INIT_XMM sse2
+cglobal pred8x8l_horizontal_8, 4,4,6
     sub          r0, r3
     lea          r2, [r0+r3*2]
-    movq        mm0, [r0+r3*1-8]
+    movd         m0, [r0+r3*1-4]
     test        r1d, r1d
     lea          r1, [r0+r3]
     cmovnz       r1, r0
-    punpckhbw   mm0, [r1+r3*0-8]
-    movq        mm1, [r2+r3*1-8]
-    punpckhbw   mm1, [r0+r3*2-8]
+    movd         m4, [r1+r3*0-4]
+    punpcklbw    m0, m4
+    movd         m1, [r2+r3*1-4]
+    movd         m4, [r0+r3*2-4]
+    punpcklbw    m1, m4
     mov          r2, r0
-    punpckhwd   mm1, mm0
+    punpcklwd    m1, m0
     lea          r0, [r0+r3*4]
-    movq        mm2, [r0+r3*1-8]
-    punpckhbw   mm2, [r0+r3*0-8]
+    movd         m2, [r0+r3*1-4]
+    movd         m4, [r0+r3*0-4]
+    punpcklbw    m2, m4
     lea          r0, [r0+r3*2]
-    movq        mm3, [r0+r3*1-8]
-    punpckhbw   mm3, [r0+r3*0-8]
-    punpckhwd   mm3, mm2
-    punpckhdq   mm3, mm1
+    movd         m3, [r0+r3*1-4]
+    movd         m4, [r0+r3*0-4]
+    punpcklbw    m3, m4
+    punpcklwd    m3, m2
+    punpckhdq    m3, m1
+    pshufd       m3, m3, 0xee
     lea          r0, [r0+r3*2]
-    movq        mm0, [r0+r3*0-8]
-    movq        mm1, [r1+r3*0-8]
+    movq         m0, [r0+r3*0-8]
+    movq         m1, [r1+r3*0-8]
     mov          r0, r2
-    movq        mm4, mm3
-    movq        mm2, mm3
-    PALIGNR     mm4, mm0, 7, mm0
-    PALIGNR     mm1, mm2, 1, mm2
-    movq        mm0, mm4
-    PRED4x4_LOWPASS mm2, mm1, mm4, mm3, mm5
-    movq        mm4, mm0
-    movq        mm7, mm2
-    PRED4x4_LOWPASS mm4, mm3, mm0, mm4, mm5
-    psllq       mm4, 56
-    PALIGNR     mm7, mm4, 7, mm3
-    movq        mm3, mm7
+    mova         m2, m3
+    punpcklqdq   m0, m3
+    psrldq       m0, 7
+    mova         m4, m0
+    punpcklqdq   m2, m1
+    psrldq       m2, 1
+    PRED4x4_LOWPASS m1, m2, m4, m3, m5
+    mova        m4, m0
+    PRED4x4_LOWPASS m2, m3, m0, m4, m5
+    psllq       m2, 56
+    punpcklqdq  m2, m1
+    psrldq      m2, 7
     lea         r1, [r0+r3*2]
-    movq       mm7, mm3
-    punpckhbw  mm3, mm3
-    punpcklbw  mm7, mm7
-    pshufw     mm0, mm3, 0xff
-    pshufw     mm1, mm3, 0xaa
+    punpcklbw   m2, m2
+    pshufhw     m0, m2, 0xff
+    pshufhw     m1, m2, 0xaa
     lea         r2, [r1+r3*2]
-    pshufw     mm2, mm3, 0x55
-    pshufw     mm3, mm3, 0x00
-    pshufw     mm4, mm7, 0xff
-    pshufw     mm5, mm7, 0xaa
-    pshufw     mm6, mm7, 0x55
-    pshufw     mm7, mm7, 0x00
-    movq [r0+r3*1], mm0
-    movq [r0+r3*2], mm1
-    movq [r1+r3*1], mm2
-    movq [r1+r3*2], mm3
-    movq [r2+r3*1], mm4
-    movq [r2+r3*2], mm5
+    pshufhw     m3, m2, 0x55
+    pshufhw     m4, m2, 0x00
+    movhps   [r0+r3*1], m0
+    movhps   [r0+r3*2], m1
+    movhps   [r1+r3*1], m3
+    movhps   [r1+r3*2], m4
+    pshuflw     m0, m2, 0xff
+    pshuflw     m1, m2, 0xaa
+    pshuflw     m3, m2, 0x55
+    pshuflw     m4, m2, 0x00
+    movq [r2+r3*1], m0
+    movq [r2+r3*2], m1
     lea         r0, [r2+r3*2]
-    movq [r0+r3*1], mm6
-    movq [r0+r3*2], mm7
+    movq [r0+r3*1], m3
+    movq [r0+r3*2], m4
     RET
-%endmacro
-
-INIT_MMX mmxext
-PRED8x8L_HORIZONTAL
-INIT_MMX ssse3
-PRED8x8L_HORIZONTAL
 
 ;-----------------------------------------------------------------------------
 ; void ff_pred8x8l_vertical_8(uint8_t *src, int has_topleft, int has_topright,
diff --git a/libavcodec/x86/h264_intrapred_init.c 
b/libavcodec/x86/h264_intrapred_init.c
index 5cc83d17c7..bd69e192ee 100644
--- a/libavcodec/x86/h264_intrapred_init.c
+++ b/libavcodec/x86/h264_intrapred_init.c
@@ -128,8 +128,7 @@ PRED8x8(tm_vp8, 8, ssse3)
 
 PRED8x8L(top_dc, 8, sse2)
 PRED8x8L(dc, 8, sse2)
-PRED8x8L(horizontal, 8, mmxext)
-PRED8x8L(horizontal, 8, ssse3)
+PRED8x8L(horizontal, 8, sse2)
 PRED8x8L(vertical, 8, sse2)
 PRED8x8L(down_left, 8, sse2)
 PRED8x8L(down_left, 8, ssse3)
@@ -163,7 +162,6 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int 
codec_id,
 
     if (bit_depth == 8) {
         if (EXTERNAL_MMXEXT(cpu_flags)) {
-            h->pred8x8l [HOR_PRED               ] = 
ff_pred8x8l_horizontal_8_mmxext;
             h->pred8x8l [HOR_UP_PRED            ] = 
ff_pred8x8l_horizontal_up_8_mmxext;
             h->pred4x4  [DIAG_DOWN_RIGHT_PRED   ] = 
ff_pred4x4_down_right_8_mmxext;
             h->pred4x4  [VERT_RIGHT_PRED        ] = 
ff_pred4x4_vertical_right_8_mmxext;
@@ -193,6 +191,7 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int 
codec_id,
         if (EXTERNAL_SSE2(cpu_flags)) {
             h->pred16x16[HOR_PRED8x8          ] = 
ff_pred16x16_horizontal_8_sse2;
             h->pred16x16[DC_PRED8x8           ] = ff_pred16x16_dc_8_sse2;
+            h->pred8x8l [HOR_PRED             ] = 
ff_pred8x8l_horizontal_8_sse2;
             h->pred8x8l [DC_PRED              ] = ff_pred8x8l_dc_8_sse2;
             h->pred8x8l [TOP_DC_PRED          ] = ff_pred8x8l_top_dc_8_sse2;
             h->pred8x8l [VERT_PRED            ] = ff_pred8x8l_vertical_8_sse2;
@@ -230,7 +229,6 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int 
codec_id,
             h->pred16x16[DC_PRED8x8           ] = ff_pred16x16_dc_8_ssse3;
             if (chroma_format_idc <= 1)
                 h->pred8x8  [HOR_PRED8x8      ] = 
ff_pred8x8_horizontal_8_ssse3;
-            h->pred8x8l [HOR_PRED             ] = 
ff_pred8x8l_horizontal_8_ssse3;
             h->pred8x8l [DIAG_DOWN_LEFT_PRED  ] = 
ff_pred8x8l_down_left_8_ssse3;
             h->pred8x8l [DIAG_DOWN_RIGHT_PRED ] = 
ff_pred8x8l_down_right_8_ssse3;
             h->pred8x8l [VERT_RIGHT_PRED      ] = 
ff_pred8x8l_vertical_right_8_ssse3;

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

Reply via email to