avcodec/x86/huffyuvencdsp: Remove MMX sub_hfyu_median_pred_int16
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Thu, 26 Feb 2026 01:44:37 +0000 (02:44 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Sun, 1 Mar 2026 11:04:14 +0000 (12:04 +0100)
Superseded by SSE2 and AVX2.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
libavcodec/huffyuvenc.c
libavcodec/x86/huffyuvencdsp.asm
libavcodec/x86/huffyuvencdsp_init.c
tests/checkasm/huffyuvencdsp.c

index cd31e8f068f187141eccc052c9a71eb24db62311..dd3ed9a996dfb93160c86d0ef245764274e4561c 100644 (file)
@@ -39,7 +39,6 @@
 #include "huffyuvencdsp.h"
 #include "lossless_videoencdsp.h"
 #include "put_bits.h"
-#include "libavutil/emms.h"
 #include "libavutil/mem.h"
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
@@ -940,7 +939,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     } else {
         av_log(avctx, AV_LOG_ERROR, "Format not supported!\n");
     }
-    emms_c();
 
     size += (put_bits_count(&s->pb) + 31) / 8;
     put_bits(&s->pb, 16, 0);
index 11f4b8c01f8b752ed01061277f7ecb21d5240d08..e8e7a6469d08b371422082a888a8aef9948f63b6 100644 (file)
@@ -55,46 +55,6 @@ INIT_YMM avx2
 DIFF_INT16
 %endif
 
-INIT_MMX mmxext
-cglobal sub_hfyu_median_pred_int16, 7,7,0, dst, src1, src2, mask, w, left, left_top
-    add      wd, wd
-    movd    mm7, maskd
-    SPLATW  mm7, mm7
-    movq    mm0, [src1q]
-    movq    mm2, [src2q]
-    psllq   mm0, 16
-    psllq   mm2, 16
-    movd    mm6, [left_topq]
-    por     mm0, mm6
-    movd    mm6, [leftq]
-    por     mm2, mm6
-    xor     maskq, maskq
-.loop:
-    movq    mm1, [src1q + maskq]
-    movq    mm3, [src2q + maskq]
-    movq    mm4, mm2
-    psubw   mm2, mm0
-    paddw   mm2, mm1
-    pand    mm2, mm7
-    movq    mm5, mm4
-    pmaxsw  mm4, mm1
-    pminsw  mm1, mm5
-    pminsw  mm4, mm2
-    pmaxsw  mm4, mm1
-    psubw   mm3, mm4
-    pand    mm3, mm7
-    movq    [dstq + maskq], mm3
-    add     maskq, 8
-    movq    mm0, [src1q + maskq - 2]
-    movq    mm2, [src2q + maskq - 2]
-    cmp     maskq, wq
-        jb .loop
-    movzx maskd, word [src1q + wq - 2]
-    mov [left_topq], maskd
-    movzx maskd, word [src2q + wq - 2]
-    mov [leftq], maskd
-    RET
-
 %macro SUB_HFYU_MEDIAN_PRED_INT16 1 ; u,s for pmaxuw vs pmaxsw
 cglobal sub_hfyu_median_pred_int16, 7,7,6, dst, src1, src2, mask, w, left, left_top
     movd        xm5, maskd
index 7289e94bc73d4ab186eb66521692b0464aa80805..c46be95cb941e24e2fd80400dfd58d14fb969e84 100644 (file)
@@ -31,8 +31,6 @@ void ff_diff_int16_sse2(uint16_t *dst, const uint16_t *src1, const uint16_t *src
                         unsigned mask, int w);
 void ff_diff_int16_avx2(uint16_t *dst, const uint16_t *src1, const uint16_t *src2,
                         unsigned mask, int w);
-void ff_sub_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *src1, const uint16_t *src2,
-                                          unsigned mask, int w, int *left, int *left_top);
 void ff_sub_hfyu_median_pred_int16_sse2(uint16_t *dst, const uint16_t *src1, const uint16_t *src2,
                                         unsigned mask, int w, int *left, int *left_top);
 void ff_sub_hfyu_median_pred_int16_avx2(uint16_t *dst, const uint16_t *src1, const uint16_t *src2,
@@ -42,10 +40,6 @@ av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, int bpp, int wid
 {
     av_unused int cpu_flags = av_get_cpu_flags();
 
-    if (EXTERNAL_MMXEXT(cpu_flags) && bpp < 16) {
-        c->sub_hfyu_median_pred_int16 = ff_sub_hfyu_median_pred_int16_mmxext;
-    }
-
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->diff_int16 = ff_diff_int16_sse2;
         if (bpp < 16 && width >= 8)
index a74b4295d6276692ca2c1b3b42f8446b9c9b9dee..b5d02cda6d3aa51ac981729ab749c8cffef802e8 100644 (file)
@@ -42,8 +42,8 @@ static void check_sub_hfyu_median_pred_int16(const char *aligned, unsigned width
     static const int bpps[] = { 9, 16, };
     HuffYUVEncDSPContext c;
 
-    declare_func_emms(AV_CPU_FLAG_MMXEXT, void, uint16_t *dst, const uint16_t *src1,
-                      const uint16_t *src2, unsigned mask, int w, int *left, int *left_top);
+    declare_func(void, uint16_t *dst, const uint16_t *src1,
+                 const uint16_t *src2, unsigned mask, int w, int *left, int *left_top);
 
     for (size_t i = 0; i < FF_ARRAY_ELEMS(bpps); ++i) {
         const int bpp = bpps[i];