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

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 89d34d66a6 avcodec/aacpsy: fix spread energy index for short windows
89d34d66a6 is described below

commit 89d34d66a638b52d56023d547e785291f67efb2f
Author:     romainhedouin <[email protected]>
AuthorDate: Wed Oct 14 20:42:24 2026 +0200
Commit:     Lynne <[email protected]>
CommitDate: Sun Oct 18 00:47:12 2026 +0000

    avcodec/aacpsy: fix spread energy index for short windows
    
    In psy_3gpp_analyze_channel(), the spread energy of the first band was
    always stored in spread_en[0] instead of spread_en[w], unlike every
    other access to spread_en[w+g]. For short windows, windows 1-7 thus
    started spreading from an unset value instead of their own first band
    energy. This only affects the hole avoidance decision.
    
    Tested: make fate passes (5875 tests). Encoder output was bit-identical
    before and after on luckynight_2ch_44kHz_s16.wav and on a synthetic
    transient signal at 24k, 32k, 48k, 64k and 128k, so the practical
    effect seems small.
    
    Found with the help of an AI code review; verified by hand.
    
    Signed-off-by: romainhedouin <[email protected]>
---
 libavcodec/aacpsy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c
index ac0e17de5b..e730e621b9 100644
--- a/libavcodec/aacpsy.c
+++ b/libavcodec/aacpsy.c
@@ -769,7 +769,7 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int 
channel,
         AacPsyBand *bands = &pch->band[w];
 
         /* 5.4.2.3 "Spreading" & 5.4.3 "Spread Energy Calculation" */
-        spread_en[0] = bands[0].energy;
+        spread_en[w] = bands[0].energy;
         for (g = 1; g < num_bands; g++) {
             bands[g].thr   = FFMAX(bands[g].thr,    bands[g-1].thr * 
coeffs[g].spread_hi[0]);
             spread_en[w+g] = FFMAX(bands[g].energy, spread_en[w+g-1] * 
coeffs[g].spread_hi[1]);

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to