From f30ef7eec41dce9ff0f134dcd579b5ade95b5b1b Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Thu, 23 Jul 2026 01:19:49 +0200 Subject: [PATCH] avcodec/x86/vc1dsp_loopfilter: Avoid imul Multipliying a GPR by 0x01010101 splats a byte to a dword; the intention was to avoid vector shuffles lateron, yet this is not true because the byte splat necessitates a byte->word conversion lateron. Signed-off-by: Andreas Rheinhardt --- libavcodec/x86/vc1dsp_loopfilter.asm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libavcodec/x86/vc1dsp_loopfilter.asm b/libavcodec/x86/vc1dsp_loopfilter.asm index f1367da5fa..373608588f 100644 --- a/libavcodec/x86/vc1dsp_loopfilter.asm +++ b/libavcodec/x86/vc1dsp_loopfilter.asm @@ -89,9 +89,10 @@ SECTION .text pxor m5, m5 movd m3, r2d %if %1 > 4 - punpcklbw m3, m3 + SPLATW m3, m3 +%else + pshufw m3, m3, 0 %endif - punpcklbw m3, m5 pcmpgtw m3, m4 ; if (a0 < pq) pand m6, m3 @@ -217,7 +218,6 @@ SECTION .text lea r3, [4*r1] sub r4, r3 lea r3, [r1+2*r1] - imul r2, 0x01010101 %endmacro %macro START_H_FILTER 1 @@ -225,7 +225,6 @@ SECTION .text %if %1 > 4 lea r4, [r0+4*r1] %endif - imul r2, 0x01010101 %endmacro INIT_XMM sse2