The branch, master has been updated
       via  6384254db203bea90b57b0f4dd8f32726a22a249 (commit)
       via  87282710975c11f423a26f4e4df86daf12a34485 (commit)
       via  f611459e6f9ca4f1d27128402ea8defd0820cb8e (commit)
       via  84f4b9fc1fdb9dd48b258e26cdc0edfa383b857c (commit)
       via  87cb7c871b6b25e537a7b19e47bf2779ad8d31b4 (commit)
      from  f49de7018af3e41805ad600ce99b79163861ff59 (commit)


- Log -----------------------------------------------------------------
commit 6384254db203bea90b57b0f4dd8f32726a22a249
Author:     Andreas Rheinhardt <andreas.rheinha...@outlook.com>
AuthorDate: Thu Sep 4 12:29:28 2025 +0200
Commit:     Andreas Rheinhardt <andreas.rheinha...@outlook.com>
CommitDate: Fri Sep 12 21:39:27 2025 +0200

    avcodec/mpegaudiodec_template: Avoid write-only stores
    
    Reviewed-by: Peter Ross <pr...@xvid.org>
    Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>

diff --git a/libavcodec/mpegaudiodec_template.c 
b/libavcodec/mpegaudiodec_template.c
index 3ca9adb8ab..0efcf9853d 100644
--- a/libavcodec/mpegaudiodec_template.c
+++ b/libavcodec/mpegaudiodec_template.c
@@ -1792,7 +1792,9 @@ static av_cold int decode_init_mp3on4(AVCodecContext * 
avctx)
         s->mp3decctx[i]->adu_mode = 1;
         s->mp3decctx[i]->avctx = avctx;
         s->mp3decctx[i]->mpadsp = s->mp3decctx[0]->mpadsp;
+#if USE_FLOATS
         s->mp3decctx[i]->butterflies_float = 
s->mp3decctx[0]->butterflies_float;
+#endif
     }
 
     return 0;

commit 87282710975c11f423a26f4e4df86daf12a34485
Author:     Andreas Rheinhardt <andreas.rheinha...@outlook.com>
AuthorDate: Thu Sep 4 12:25:48 2025 +0200
Commit:     Andreas Rheinhardt <andreas.rheinha...@outlook.com>
CommitDate: Fri Sep 12 21:39:22 2025 +0200

    avcodec/mpegaudiodec_template: Mark flush functions as av_cold
    
    Reviewed-by: Peter Ross <pr...@xvid.org>
    Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>

diff --git a/libavcodec/mpegaudiodec_template.c 
b/libavcodec/mpegaudiodec_template.c
index 42e995643b..3ca9adb8ab 100644
--- a/libavcodec/mpegaudiodec_template.c
+++ b/libavcodec/mpegaudiodec_template.c
@@ -1625,7 +1625,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame 
*frame,
     return buf_size + skipped;
 }
 
-static void mp_flush(MPADecodeContext *ctx)
+static av_cold void mp_flush(MPADecodeContext *ctx)
 {
     memset(ctx->synth_buf, 0, sizeof(ctx->synth_buf));
     memset(ctx->mdct_buf, 0, sizeof(ctx->mdct_buf));
@@ -1633,7 +1633,7 @@ static void mp_flush(MPADecodeContext *ctx)
     ctx->dither_state = 0;
 }
 
-static void flush(AVCodecContext *avctx)
+static av_cold void flush(AVCodecContext *avctx)
 {
     mp_flush(avctx->priv_data);
 }
@@ -1799,7 +1799,7 @@ static av_cold int decode_init_mp3on4(AVCodecContext * 
avctx)
 }
 
 
-static void flush_mp3on4(AVCodecContext *avctx)
+static av_cold void flush_mp3on4(AVCodecContext *avctx)
 {
     int i;
     MP3On4DecodeContext *s = avctx->priv_data;

commit f611459e6f9ca4f1d27128402ea8defd0820cb8e
Author:     Andreas Rheinhardt <andreas.rheinha...@outlook.com>
AuthorDate: Thu Sep 4 12:07:06 2025 +0200
Commit:     Andreas Rheinhardt <andreas.rheinha...@outlook.com>
CommitDate: Fri Sep 12 21:39:16 2025 +0200

    avcodec/mpegaudiodec_template: Allocate sub-contexts jointly
    
    Reviewed-by: Peter Ross <pr...@xvid.org>
    Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>

diff --git a/libavcodec/mpegaudiodec_template.c 
b/libavcodec/mpegaudiodec_template.c
index 5c38f4e9d7..42e995643b 100644
--- a/libavcodec/mpegaudiodec_template.c
+++ b/libavcodec/mpegaudiodec_template.c
@@ -1738,10 +1738,8 @@ static const int16_t chan_layout[8] = {
 static av_cold int decode_close_mp3on4(AVCodecContext * avctx)
 {
     MP3On4DecodeContext *s = avctx->priv_data;
-    int i;
 
-    for (i = 0; i < s->frames; i++)
-        av_freep(&s->mp3decctx[i]);
+    av_freep(&s->mp3decctx[0]);
 
     return 0;
 }
@@ -1777,8 +1775,8 @@ static av_cold int decode_init_mp3on4(AVCodecContext * 
avctx)
     /* Init the first mp3 decoder in standard way, so that all tables get built
      * Other decoders will be initialized here copying data from the first 
context
      */
-    // Allocate zeroed memory for the first decoder context
-    s->mp3decctx[0] = av_mallocz(sizeof(MPADecodeContext));
+    // Allocate zeroed memory for the decoder contexts
+    s->mp3decctx[0] = av_calloc(s->frames, sizeof(*s->mp3decctx[0]));
     if (!s->mp3decctx[0])
         return AVERROR(ENOMEM);
     ret = decode_ctx_init(avctx, s->mp3decctx[0]);
@@ -1790,9 +1788,7 @@ static av_cold int decode_init_mp3on4(AVCodecContext * 
avctx)
      * Each frame is 1 or 2 channels - up to 5 frames allowed
      */
     for (i = 1; i < s->frames; i++) {
-        s->mp3decctx[i] = av_mallocz(sizeof(MPADecodeContext));
-        if (!s->mp3decctx[i])
-            return AVERROR(ENOMEM);
+        s->mp3decctx[i] = s->mp3decctx[0] + i;
         s->mp3decctx[i]->adu_mode = 1;
         s->mp3decctx[i]->avctx = avctx;
         s->mp3decctx[i]->mpadsp = s->mp3decctx[0]->mpadsp;

commit 84f4b9fc1fdb9dd48b258e26cdc0edfa383b857c
Author:     Andreas Rheinhardt <andreas.rheinha...@outlook.com>
AuthorDate: Thu Sep 4 12:00:24 2025 +0200
Commit:     Andreas Rheinhardt <andreas.rheinha...@outlook.com>
CommitDate: Fri Sep 12 21:38:48 2025 +0200

    avcodec/mpegaudiodec_template: Don't modify AVCodecContext.priv_data
    
    Reviewed-by: Peter Ross <pr...@xvid.org>
    Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>

diff --git a/libavcodec/mpegaudiodec_template.c 
b/libavcodec/mpegaudiodec_template.c
index d7c5210eb8..5c38f4e9d7 100644
--- a/libavcodec/mpegaudiodec_template.c
+++ b/libavcodec/mpegaudiodec_template.c
@@ -280,10 +280,9 @@ static av_cold void decode_init_static(void)
     ff_mpegaudiodec_common_init_static();
 }
 
-static av_cold int decode_init(AVCodecContext * avctx)
+static av_cold int decode_ctx_init(AVCodecContext *avctx, MPADecodeContext *s)
 {
     static AVOnce init_static_once = AV_ONCE_INIT;
-    MPADecodeContext *s = avctx->priv_data;
 
     s->avctx = avctx;
 
@@ -315,6 +314,11 @@ static av_cold int decode_init(AVCodecContext * avctx)
     return 0;
 }
 
+static av_cold int decode_init(AVCodecContext *avctx)
+{
+    return decode_ctx_init(avctx, avctx->priv_data);
+}
+
 #define C3 FIXHR(0.86602540378443864676/2)
 #define C4 FIXHR(0.70710678118654752439/2) //0.5 / cos(pi*(9)/36)
 #define C5 FIXHR(0.51763809020504152469/2) //0.5 / cos(pi*(5)/36)
@@ -1771,19 +1775,13 @@ static av_cold int decode_init_mp3on4(AVCodecContext * 
avctx)
         s->syncword = 0xfff00000;
 
     /* Init the first mp3 decoder in standard way, so that all tables get built
-     * We replace avctx->priv_data with the context of the first decoder so 
that
-     * decode_init() does not have to be changed.
      * Other decoders will be initialized here copying data from the first 
context
      */
     // Allocate zeroed memory for the first decoder context
     s->mp3decctx[0] = av_mallocz(sizeof(MPADecodeContext));
     if (!s->mp3decctx[0])
         return AVERROR(ENOMEM);
-    // Put decoder context in place to make init_decode() happy
-    avctx->priv_data = s->mp3decctx[0];
-    ret = decode_init(avctx);
-    // Restore mp3on4 context pointer
-    avctx->priv_data = s;
+    ret = decode_ctx_init(avctx, s->mp3decctx[0]);
     if (ret < 0)
         return ret;
     s->mp3decctx[0]->adu_mode = 1; // Set adu mode

commit 87cb7c871b6b25e537a7b19e47bf2779ad8d31b4
Author:     Andreas Rheinhardt <andreas.rheinha...@outlook.com>
AuthorDate: Thu Sep 4 14:56:13 2025 +0200
Commit:     Andreas Rheinhardt <andreas.rheinha...@outlook.com>
CommitDate: Fri Sep 12 21:37:42 2025 +0200

    avcodec/pcm_tablegen: Fix hardcoded-tables if alaw,mulaw,vidc codecs 
disabled
    
    Since ae448e00afb43d7f72dfa9c82a4c45994e4fea6a the various
    tableinit functions are not compiled unconditionally any more,
    so that pcm_tablegen.c (which creates the hardcoded tables)
    needs to be updated.
    
    Reviewed-by: James Almer <jamr...@gmail.com>
    Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>

diff --git a/libavcodec/pcm_tablegen.c b/libavcodec/pcm_tablegen.c
index 473a47f6d9..cff713606b 100644
--- a/libavcodec/pcm_tablegen.c
+++ b/libavcodec/pcm_tablegen.c
@@ -21,21 +21,27 @@
  */
 
 #include <stdlib.h>
+#include "config_components.h"
 #define CONFIG_HARDCODED_TABLES 0
 #include "pcm_tablegen.h"
 #include "tableprint.h"
 
 int main(void)
 {
-    pcm_alaw_tableinit();
-    pcm_ulaw_tableinit();
-    pcm_vidc_tableinit();
-
     write_fileheader();
 
+#if CONFIG_PCM_ALAW_ENCODER
+    pcm_alaw_tableinit();
     WRITE_ARRAY("static const", uint8_t, linear_to_alaw);
+#endif
+#if CONFIG_PCM_MULAW_ENCODER
+    pcm_ulaw_tableinit();
     WRITE_ARRAY("static const", uint8_t, linear_to_ulaw);
+#endif
+#if CONFIG_PCM_VIDC_ENCODER
+    pcm_vidc_tableinit();
     WRITE_ARRAY("static const", uint8_t, linear_to_vidc);
+#endif
 
     return 0;
 }

-----------------------------------------------------------------------

Summary of changes:
 libavcodec/mpegaudiodec_template.c | 36 ++++++++++++++++--------------------
 libavcodec/pcm_tablegen.c          | 14 ++++++++++----
 2 files changed, 26 insertions(+), 24 deletions(-)


hooks/post-receive
-- 

_______________________________________________
ffmpeg-cvslog mailing list -- ffmpeg-cvslog@ffmpeg.org
To unsubscribe send an email to ffmpeg-cvslog-le...@ffmpeg.org

Reply via email to