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

Git pushed a commit to branch master
in repository ffmpeg.

commit 0a81a1ce6645931ea79d07737edc7548ec984520
Author:     Andreas Rheinhardt <[email protected]>
AuthorDate: Mon Mar 23 20:52:31 2026 +0100
Commit:     Andreas Rheinhardt <[email protected]>
CommitDate: Sat Mar 28 11:25:38 2026 +0100

    avcodec/x86/sbcdsp: Fix calculating four-subbands stereo scalefactors
    
    sbc_calc_scalefactors uses an int32_t [16/*max blocks*/][2/*max
    channels*/][8/*max subbands*/] array. The MMX version of this code
    treats the two inner arrays as one [2*8] array to process
    and it processes subbands*channels of them. But when subbands
    is < 8 and channels is two, the entries to process are not
    contiguous: One has to process 0..subbands-1 and 8..7+subbands,
    yet the code processed 0..2*subbands-1.
    This commit fixes this by processing entries 0..7+subbands
    if there are two channels.
    
    Before this commit, the following command line triggered an
    av_assert2() in put_bits():
    ffmpeg_g -i tests/data/asynth-44100-2.wav -c sbc -b:a 200k \
    -sbc_delay 0.003 -f null -
    
    Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 libavcodec/x86/sbcdsp.asm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/x86/sbcdsp.asm b/libavcodec/x86/sbcdsp.asm
index d68d3a9ae8..d46141b40c 100644
--- a/libavcodec/x86/sbcdsp.asm
+++ b/libavcodec/x86/sbcdsp.asm
@@ -126,7 +126,7 @@ cglobal sbc_calc_scalefactors, 5, 7, 4, sb_sample_f, 
scale_factor, blocks, chann
     shl           subbandsd, 2
     cmp           channelsd, 2
     jl            .loop_1
-    shl           subbandsd, 1
+    add           subbandsd, 32
 
 .loop_1:
     sub           subbandsq, 8

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

Reply via email to