[FFmpeg-cvslog] avcodec/x86/h264_idct: Fix incorrect xmm spilling on win64

Henrik Gramner git at videolan.org
Mon Mar 25 22:30:38 EET 2024


ffmpeg | branch: master | Henrik Gramner <henrik at gramner.com> | Sun Mar 24 20:04:17 2024 +0100| [7c003b63c85aadf57ca10be849bd9895a4eeeb87] | committer: Henrik Gramner

avcodec/x86/h264_idct: Fix incorrect xmm spilling on win64

Broken in afa471d0efed1df5dca6eeeb2fcdd211ae4cad4e. It just happened
to work before due to x86inc.asm previously performing XMM spills in
INIT_MMX mode which was more of a bug than an intentional feature.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7c003b63c85aadf57ca10be849bd9895a4eeeb87
---

 libavcodec/x86/h264_idct.asm | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/libavcodec/x86/h264_idct.asm b/libavcodec/x86/h264_idct.asm
index b29ddde200..d9c3c9c862 100644
--- a/libavcodec/x86/h264_idct.asm
+++ b/libavcodec/x86/h264_idct.asm
@@ -716,11 +716,9 @@ RET
 %endif
 %endmacro
 
-%macro IDCT_DC_DEQUANT 1
-cglobal h264_luma_dc_dequant_idct, 3, 4, %1
-    ; manually spill XMM registers for Win64 because
-    ; the code here is initialized with INIT_MMX
-    WIN64_SPILL_XMM %1
+INIT_XMM sse2
+cglobal h264_luma_dc_dequant_idct, 3, 4, 7
+INIT_MMX cpuname
     movq        m3, [r1+24]
     movq        m2, [r1+16]
     movq        m1, [r1+ 8]
@@ -757,10 +755,6 @@ cglobal h264_luma_dc_dequant_idct, 3, 4, %1
     movd      xmm6, t1d
     DEQUANT_STORE xmm6
     RET
-%endmacro
-
-INIT_MMX sse2
-IDCT_DC_DEQUANT 7
 
 %ifdef __NASM_VER__
 %if __NASM_MAJOR__ >= 2 && __NASM_MINOR__ >= 4



More information about the ffmpeg-cvslog mailing list