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 8876f61947 avcodec/aacenc: Use the right element type when restoring 
coefficients
8876f61947 is described below

commit 8876f61947bf922e6e30c1c2df83fd7f55759b9a
Author:     romainhedouin <[email protected]>
AuthorDate: Fri Nov 6 18:27:13 2026 +0100
Commit:     Lynne <[email protected]>
CommitDate: Sat Nov 7 05:56:10 2026 +0000

    avcodec/aacenc: Use the right element type when restoring coefficients
    
    When the rate loop encodes a frame again, it first restores the
    coefficients of every element. The number of channels to restore came
    from the type of the last element, not from the element being
    restored. For layouts that do not end in a channel pair (4.0, 5.1, 6.1,
    7.1), the second channel of each pair was not restored.
    
    Noticed during a review sweep of ffmpeg using an LLM.
    
    Signed-off-by: romainhedouin <[email protected]>
---
 libavcodec/aacenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 5b1e3eff0f..50a1460e61 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -1650,7 +1650,7 @@ static int aac_encode_frame(AVCodecContext *avctx, 
AVPacket *avpkt,
                 if (is_mode || ms_mode || tns_mode || pred_mode) {
                     for (i = 0; i < s->chan_map[0]; i++) {
                         // Must restore coeffs
-                        chans = tag == TYPE_CPE ? 2 : 1;
+                        chans = s->chan_map[i + 1] == TYPE_CPE ? 2 : 1;
                         cpe = &s->cpe[i];
                         for (ch = 0; ch < chans; ch++)
                             memcpy(cpe->ch[ch].coeffs, cpe->ch[ch].pcoeffs, 
sizeof(cpe->ch[ch].coeffs));

-- 
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