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

Git pushed a commit to branch master
in repository ffmpeg.

commit 417158195367ce9335521a23905234381c5d73d0
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Wed Jun 10 17:48:42 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Sun Jun 14 15:34:43 2026 +0000

    swresample/x86/resample: write only int16 in the int16 resampler
    
    The resample asm code as it is currently handles 1 sample at a time
    
    The asm code should be redesigned and handle more than 1 sample at a
    time. That is the whole purpose of SIMD. There is also multiple samples
    available that need identical handling like from several channels or
    similar handling from other points in time.
    
    Such redesign would make the resampler faster and would change the
    requirements of padding and maybe memory layout. So it seems simpler
    to just avoid overwriting in the asm as it is today than to have
    the allocation handle specific overallocation for asm code that
    ideally should be redesigned
    
    Fixes writing 16bits over the end of the array
    
    This is an alternative fix for 
https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23053
    
    Found-by: Ivan Grigorev <[email protected]>
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libswresample/x86/resample.asm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libswresample/x86/resample.asm b/libswresample/x86/resample.asm
index 6c3dc28703..e155f171d1 100644
--- a/libswresample/x86/resample.asm
+++ b/libswresample/x86/resample.asm
@@ -198,7 +198,8 @@ cglobal resample_common_%1, 1, 7, 2, ctx, phase_count, dst, 
frac, \
     add                        fracd, dst_incr_modd
     packssdw                      m0, m0
     add                       indexd, dst_incr_divd
-    movd                      [dstq], m0
+    movd                     filterd, m0
+    mov                       [dstq], filterw
 %else ; float/double
     ; horizontal sum & store
 %if mmsize == 32
@@ -478,7 +479,8 @@ cglobal resample_linear_%1, 1, 7, 5, ctx, 
min_filter_length_x4, filter2, \
     paddd                         m0, m1
     psrad                         m0, 15
     packssdw                      m0, m0
-    movd                      [dstq], m0
+    movd                         eax, m0
+    mov                       [dstq], ax
 
     ; note that for imul/idiv, I need to move filter to edx/eax for each:
     ; - 32bit: eax=r0[filter1], edx=r2[filter2]

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

Reply via email to