diff mbox series

[FFmpeg-devel,2/2] avcodec/x86/diracdsp: Migrate last remaining MMX function to SSE2

Message ID 20241107092533.1113300-2-kawakami150708@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/2] avcodec/x86/diracdsp_init: Remove unused macro | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed

Commit Message

Kyosuke Kawakami Nov. 7, 2024, 9:25 a.m. UTC
The add_dirac_obmc8_mmx function was the only MMX function left. This
patch migrates it to SSE2.

Signed-off-by: Kyosuke Kawakami <kawakami150708@gmail.com>
---
 libavcodec/x86/diracdsp.asm    |  4 +---
 libavcodec/x86/diracdsp_init.c | 10 +++-------
 2 files changed, 4 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/x86/diracdsp.asm b/libavcodec/x86/diracdsp.asm
index e5e2b11846..d438b668cf 100644
--- a/libavcodec/x86/diracdsp.asm
+++ b/libavcodec/x86/diracdsp.asm
@@ -247,14 +247,12 @@  cglobal add_dirac_obmc%1_%2, 6,6,5, dst, src, stride, obmc, yblen
     RET
 %endm
 
-INIT_MMX
-ADD_OBMC 8, mmx
-
 INIT_XMM
 PUT_RECT sse2
 ADD_RECT sse2
 
 HPEL_FILTER sse2
+ADD_OBMC 8, sse2
 ADD_OBMC 32, sse2
 ADD_OBMC 16, sse2
 
diff --git a/libavcodec/x86/diracdsp_init.c b/libavcodec/x86/diracdsp_init.c
index 6a31d3921f..ef01ebdf2e 100644
--- a/libavcodec/x86/diracdsp_init.c
+++ b/libavcodec/x86/diracdsp_init.c
@@ -24,8 +24,7 @@ 
 
 void ff_add_rect_clamped_sse2(uint8_t *, const uint16_t *, int, const int16_t *, int, int, int);
 
-void ff_add_dirac_obmc8_mmx(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen);
-
+void ff_add_dirac_obmc8_sse2(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen);
 void ff_add_dirac_obmc16_sse2(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen);
 void ff_add_dirac_obmc32_sse2(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen);
 
@@ -89,15 +88,12 @@  void ff_diracdsp_init_x86(DiracDSPContext* c)
 #if HAVE_X86ASM
     int mm_flags = av_get_cpu_flags();
 
-    if (EXTERNAL_MMX(mm_flags)) {
-        c->add_dirac_obmc[0] = ff_add_dirac_obmc8_mmx;
-    }
-
     if (EXTERNAL_SSE2(mm_flags)) {
         c->dirac_hpel_filter = dirac_hpel_filter_sse2;
         c->add_rect_clamped = ff_add_rect_clamped_sse2;
         c->put_signed_rect_clamped[0] = (void *)ff_put_signed_rect_clamped_sse2;
 
+        c->add_dirac_obmc[0] = ff_add_dirac_obmc8_sse2;
         c->add_dirac_obmc[1] = ff_add_dirac_obmc16_sse2;
         c->add_dirac_obmc[2] = ff_add_dirac_obmc32_sse2;
 
@@ -111,5 +107,5 @@  void ff_diracdsp_init_x86(DiracDSPContext* c)
         c->dequant_subband[1]         = ff_dequant_subband_32_sse4;
         c->put_signed_rect_clamped[1] = ff_put_signed_rect_clamped_10_sse4;
     }
-#endif
+#endif // HAVE_X86ASM
 }