Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] avcodec: Mark init and close functions as av_cold
Date: Fri, 14 Mar 2025 14:51:01 +0100
Message-ID: <AS8P250MB074417E43F45CDD27E2FDA718FD22@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <AS8P250MB074427D2D6F0D49DFA8EBA448FD22@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM>

[-- Attachment #1: Type: text/plain, Size: 89 bytes --]

Andreas Rheinhardt:
> Patch attached.
> 
> - Andreas
> 

Now truely attached.

- Andreas

[-- Attachment #2: 0001-avcodec-Mark-init-and-close-functions-as-av_cold.patch --]
[-- Type: text/x-patch, Size: 22603 bytes --]

From ccb9413d8408e8b1b0a786af683042609cddd177 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Thu, 6 Mar 2025 18:28:57 +0100
Subject: [PATCH] avcodec: Mark init and close functions as av_cold

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/d3d12va_av1.c    | 4 ++--
 libavcodec/d3d12va_decode.c | 4 ++--
 libavcodec/d3d12va_h264.c   | 2 +-
 libavcodec/d3d12va_hevc.c   | 2 +-
 libavcodec/d3d12va_mpeg2.c  | 2 +-
 libavcodec/d3d12va_vc1.c    | 2 +-
 libavcodec/d3d12va_vp9.c    | 2 +-
 libavcodec/dcaenc.c         | 2 +-
 libavcodec/dvdsubenc.c      | 2 +-
 libavcodec/dxv.c            | 4 ++--
 libavcodec/dxva2_av1.c      | 2 +-
 libavcodec/ffv1enc.c        | 2 +-
 libavcodec/libaribb24.c     | 4 ++--
 libavcodec/libaribcaption.c | 4 ++--
 libavcodec/libvorbisdec.c   | 6 ++++--
 libavcodec/lscrdec.c        | 6 +++---
 libavcodec/mfenc.c          | 2 +-
 libavcodec/microdvddec.c    | 2 +-
 libavcodec/movtextdec.c     | 6 +++---
 libavcodec/rasc.c           | 2 +-
 libavcodec/rkmppdec.c       | 6 +++---
 libavcodec/rpzaenc.c        | 4 ++--
 libavcodec/sbcdec.c         | 2 +-
 libavcodec/smcenc.c         | 4 ++--
 libavcodec/textdec.c        | 2 +-
 libavcodec/vaapi_av1.c      | 4 ++--
 libavcodec/vdpau.c          | 6 +++---
 libavcodec/vdpau_av1.c      | 2 +-
 libavcodec/vdpau_h264.c     | 2 +-
 libavcodec/vdpau_hevc.c     | 2 +-
 libavcodec/vdpau_mpeg12.c   | 4 ++--
 libavcodec/vdpau_mpeg4.c    | 2 +-
 libavcodec/vdpau_vc1.c      | 2 +-
 libavcodec/vdpau_vp9.c      | 2 +-
 34 files changed, 54 insertions(+), 52 deletions(-)

diff --git a/libavcodec/d3d12va_av1.c b/libavcodec/d3d12va_av1.c
index 4a4d207b4f..83e7e53a55 100644
--- a/libavcodec/d3d12va_av1.c
+++ b/libavcodec/d3d12va_av1.c
@@ -151,7 +151,7 @@ static int d3d12va_av1_end_frame(AVCodecContext *avctx)
     return ret;
 }
 
-static int d3d12va_av1_decode_init(AVCodecContext *avctx)
+static av_cold int d3d12va_av1_decode_init(AVCodecContext *avctx)
 {
     D3D12VADecodeContext    *ctx     = D3D12VA_DECODE_CONTEXT(avctx);
     D3D12AV1DecodeContext   *av1_ctx = D3D12_AV1_DECODE_CONTEXT(avctx);
@@ -179,7 +179,7 @@ static int d3d12va_av1_decode_init(AVCodecContext *avctx)
     return 0;
 }
 
-static int d3d12va_av1_decode_uninit(AVCodecContext *avctx)
+static av_cold int d3d12va_av1_decode_uninit(AVCodecContext *avctx)
 {
     D3D12AV1DecodeContext   *ctx     = D3D12_AV1_DECODE_CONTEXT(avctx);
 
diff --git a/libavcodec/d3d12va_decode.c b/libavcodec/d3d12va_decode.c
index 3b8978635e..312d6e1ed7 100644
--- a/libavcodec/d3d12va_decode.c
+++ b/libavcodec/d3d12va_decode.c
@@ -280,7 +280,7 @@ int ff_d3d12va_common_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames
     return 0;
 }
 
-int ff_d3d12va_decode_init(AVCodecContext *avctx)
+av_cold int ff_d3d12va_decode_init(AVCodecContext *avctx)
 {
     int ret;
     AVHWFramesContext *frames_ctx;
@@ -370,7 +370,7 @@ fail:
     return AVERROR(EINVAL);
 }
 
-int ff_d3d12va_decode_uninit(AVCodecContext *avctx)
+av_cold int ff_d3d12va_decode_uninit(AVCodecContext *avctx)
 {
     int num_allocator = 0;
     D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
diff --git a/libavcodec/d3d12va_h264.c b/libavcodec/d3d12va_h264.c
index b2fe2955c8..9ccbe9d5a8 100644
--- a/libavcodec/d3d12va_h264.c
+++ b/libavcodec/d3d12va_h264.c
@@ -173,7 +173,7 @@ static int d3d12va_h264_end_frame(AVCodecContext *avctx)
     return ret;
 }
 
-static int d3d12va_h264_decode_init(AVCodecContext *avctx)
+static av_cold int d3d12va_h264_decode_init(AVCodecContext *avctx)
 {
     D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
     DXVA_PicParams_H264 pp;
diff --git a/libavcodec/d3d12va_hevc.c b/libavcodec/d3d12va_hevc.c
index 7686f0eb6c..26c67dcfbd 100644
--- a/libavcodec/d3d12va_hevc.c
+++ b/libavcodec/d3d12va_hevc.c
@@ -160,7 +160,7 @@ static int d3d12va_hevc_end_frame(AVCodecContext *avctx)
                scale ? &ctx_pic->qm : NULL, scale ? sizeof(ctx_pic->qm) : 0, update_input_arguments);
 }
 
-static int d3d12va_hevc_decode_init(AVCodecContext *avctx)
+static av_cold int d3d12va_hevc_decode_init(AVCodecContext *avctx)
 {
     D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
     DXVA_PicParams_HEVC pp;
diff --git a/libavcodec/d3d12va_mpeg2.c b/libavcodec/d3d12va_mpeg2.c
index 86a7d97b34..d2eb77797f 100644
--- a/libavcodec/d3d12va_mpeg2.c
+++ b/libavcodec/d3d12va_mpeg2.c
@@ -150,7 +150,7 @@ static int d3d12va_mpeg2_end_frame(AVCodecContext *avctx)
     return ret;
 }
 
-static int d3d12va_mpeg2_decode_init(AVCodecContext *avctx)
+static av_cold int d3d12va_mpeg2_decode_init(AVCodecContext *avctx)
 {
     D3D12VADecodeContext      *ctx     = D3D12VA_DECODE_CONTEXT(avctx);
 
diff --git a/libavcodec/d3d12va_vc1.c b/libavcodec/d3d12va_vc1.c
index dccc0fbffa..73f2cf71ad 100644
--- a/libavcodec/d3d12va_vc1.c
+++ b/libavcodec/d3d12va_vc1.c
@@ -162,7 +162,7 @@ static int d3d12va_vc1_end_frame(AVCodecContext *avctx)
                                        update_input_arguments);
 }
 
-static int d3d12va_vc1_decode_init(AVCodecContext *avctx)
+static av_cold int d3d12va_vc1_decode_init(AVCodecContext *avctx)
 {
     int ret;
     D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
diff --git a/libavcodec/d3d12va_vp9.c b/libavcodec/d3d12va_vp9.c
index 3476768e61..68f26d4c61 100644
--- a/libavcodec/d3d12va_vp9.c
+++ b/libavcodec/d3d12va_vp9.c
@@ -126,7 +126,7 @@ static int d3d12va_vp9_end_frame(AVCodecContext *avctx)
                &ctx_pic->pp, sizeof(ctx_pic->pp), NULL, 0, update_input_arguments);
 }
 
-static int d3d12va_vp9_decode_init(AVCodecContext *avctx)
+static av_cold int d3d12va_vp9_decode_init(AVCodecContext *avctx)
 {
     D3D12VADecodeContext *ctx = D3D12VA_DECODE_CONTEXT(avctx);
     DXVA_PicParams_VP9 pp;
diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c
index 94b0ff7673..902c617e72 100644
--- a/libavcodec/dcaenc.c
+++ b/libavcodec/dcaenc.c
@@ -199,7 +199,7 @@ static av_cold void dcaenc_init_static_tables(void)
         create_enc_table(&bitalloc_12_table[i][1], 12, &src_table);
 }
 
-static int encode_init(AVCodecContext *avctx)
+static av_cold int encode_init(AVCodecContext *avctx)
 {
     static AVOnce init_static_once = AV_ONCE_INIT;
     DCAEncContext *c = avctx->priv_data;
diff --git a/libavcodec/dvdsubenc.c b/libavcodec/dvdsubenc.c
index cc6535fda3..00bab35988 100644
--- a/libavcodec/dvdsubenc.c
+++ b/libavcodec/dvdsubenc.c
@@ -442,7 +442,7 @@ static int bprint_to_extradata(AVCodecContext *avctx, struct AVBPrint *buf)
     return 0;
 }
 
-static int dvdsub_init(AVCodecContext *avctx)
+static av_cold int dvdsub_init(AVCodecContext *avctx)
 {
     DVDSubtitleContext *dvdc = avctx->priv_data;
     static const uint32_t default_palette[16] = {
diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c
index ba23222727..0b8e077ad6 100644
--- a/libavcodec/dxv.c
+++ b/libavcodec/dxv.c
@@ -1053,7 +1053,7 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame,
     return avpkt->size;
 }
 
-static int dxv_init(AVCodecContext *avctx)
+static av_cold int dxv_init(AVCodecContext *avctx)
 {
     DXVContext *ctx = avctx->priv_data;
     int ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
@@ -1073,7 +1073,7 @@ static int dxv_init(AVCodecContext *avctx)
     return 0;
 }
 
-static int dxv_close(AVCodecContext *avctx)
+static av_cold int dxv_close(AVCodecContext *avctx)
 {
     DXVContext *ctx = avctx->priv_data;
 
diff --git a/libavcodec/dxva2_av1.c b/libavcodec/dxva2_av1.c
index ea97fcb87e..9a7e0eb3ae 100644
--- a/libavcodec/dxva2_av1.c
+++ b/libavcodec/dxva2_av1.c
@@ -450,7 +450,7 @@ static int dxva2_av1_end_frame(AVCodecContext *avctx)
     return ret;
 }
 
-static int dxva2_av1_uninit(AVCodecContext *avctx)
+static av_cold int dxva2_av1_uninit(AVCodecContext *avctx)
 {
     struct AV1DXVAContext *ctx = avctx->internal->hwaccel_priv_data;
 
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 406cc052ae..f647ab0def 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -909,7 +909,7 @@ av_cold int ff_ffv1_encode_setup_plane_info(AVCodecContext *avctx,
     return av_pix_fmt_get_chroma_sub_sample(pix_fmt, &s->chroma_h_shift, &s->chroma_v_shift);
 }
 
-static int encode_init_internal(AVCodecContext *avctx)
+static av_cold int encode_init_internal(AVCodecContext *avctx)
 {
     int ret;
     FFV1Context *s = avctx->priv_data;
diff --git a/libavcodec/libaribb24.c b/libavcodec/libaribb24.c
index 009c995ded..6e062cbffd 100644
--- a/libavcodec/libaribb24.c
+++ b/libavcodec/libaribb24.c
@@ -144,7 +144,7 @@ static int libaribb24_generate_ass_header(AVCodecContext *avctx)
     return 0;
 }
 
-static int libaribb24_init(AVCodecContext *avctx)
+static av_cold int libaribb24_init(AVCodecContext *avctx)
 {
     Libaribb24Context *b24 = avctx->priv_data;
     void(* arib_dec_init)(arib_decoder_t* decoder) = NULL;
@@ -197,7 +197,7 @@ static int libaribb24_init(AVCodecContext *avctx)
     return 0;
 }
 
-static int libaribb24_close(AVCodecContext *avctx)
+static av_cold int libaribb24_close(AVCodecContext *avctx)
 {
     Libaribb24Context *b24 = avctx->priv_data;
 
diff --git a/libavcodec/libaribcaption.c b/libavcodec/libaribcaption.c
index 0b67d41772..91691f6778 100644
--- a/libavcodec/libaribcaption.c
+++ b/libavcodec/libaribcaption.c
@@ -939,7 +939,7 @@ static void aribcaption_flush(AVCodecContext *avctx)
         ctx->readorder = 0;
 }
 
-static int aribcaption_close(AVCodecContext *avctx)
+static av_cold int aribcaption_close(AVCodecContext *avctx)
 {
     ARIBCaptionContext *ctx = avctx->priv_data;
 
@@ -954,7 +954,7 @@ static int aribcaption_close(AVCodecContext *avctx)
     return 0;
 }
 
-static int aribcaption_init(AVCodecContext *avctx)
+static av_cold int aribcaption_init(AVCodecContext *avctx)
 {
     ARIBCaptionContext *ctx = avctx->priv_data;
     aribcc_profile_t profile;
diff --git a/libavcodec/libvorbisdec.c b/libavcodec/libvorbisdec.c
index a5e7a691d6..7922261b2f 100644
--- a/libavcodec/libvorbisdec.c
+++ b/libavcodec/libvorbisdec.c
@@ -35,7 +35,8 @@ typedef struct OggVorbisDecContext {
 
 static int oggvorbis_decode_close(AVCodecContext *avccontext);
 
-static int oggvorbis_decode_init(AVCodecContext *avccontext) {
+static av_cold int oggvorbis_decode_init(AVCodecContext *avccontext)
+{
     OggVorbisDecContext *context = avccontext->priv_data ;
     uint8_t *p= avccontext->extradata;
     int i, hsizes[3], ret;
@@ -198,7 +199,8 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext, AVFrame *frame,
 }
 
 
-static int oggvorbis_decode_close(AVCodecContext *avccontext) {
+static av_cold int oggvorbis_decode_close(AVCodecContext *avccontext)
+{
     OggVorbisDecContext *context = avccontext->priv_data ;
 
     vorbis_block_clear(&context->vb);
diff --git a/libavcodec/lscrdec.c b/libavcodec/lscrdec.c
index 199d2d6827..fb8cdfa9f8 100644
--- a/libavcodec/lscrdec.c
+++ b/libavcodec/lscrdec.c
@@ -213,7 +213,7 @@ static int decode_frame_lscr(AVCodecContext *avctx, AVFrame *rframe,
     return avpkt->size;
 }
 
-static int lscr_decode_close(AVCodecContext *avctx)
+static av_cold int lscr_decode_close(AVCodecContext *avctx)
 {
     LSCRContext *s = avctx->priv_data;
 
@@ -225,7 +225,7 @@ static int lscr_decode_close(AVCodecContext *avctx)
     return 0;
 }
 
-static int lscr_decode_init(AVCodecContext *avctx)
+static av_cold int lscr_decode_init(AVCodecContext *avctx)
 {
     LSCRContext *s = avctx->priv_data;
 
@@ -242,7 +242,7 @@ static int lscr_decode_init(AVCodecContext *avctx)
     return ff_inflate_init(&s->zstream, avctx);
 }
 
-static void lscr_decode_flush(AVCodecContext *avctx)
+static av_cold void lscr_decode_flush(AVCodecContext *avctx)
 {
     LSCRContext *s = avctx->priv_data;
     av_frame_unref(s->last_picture);
diff --git a/libavcodec/mfenc.c b/libavcodec/mfenc.c
index 2bf3fa976e..58650292f1 100644
--- a/libavcodec/mfenc.c
+++ b/libavcodec/mfenc.c
@@ -1226,7 +1226,7 @@ static int mf_close(AVCodecContext *avctx)
     return 0;
 }
 
-static int mf_init(AVCodecContext *avctx)
+static av_cold int mf_init(AVCodecContext *avctx)
 {
     int ret;
     if ((ret = mf_load_library(avctx)) == 0) {
diff --git a/libavcodec/microdvddec.c b/libavcodec/microdvddec.c
index 786a3845fd..a46a62e45f 100644
--- a/libavcodec/microdvddec.c
+++ b/libavcodec/microdvddec.c
@@ -319,7 +319,7 @@ static int microdvd_decode_frame(AVCodecContext *avctx, AVSubtitle *sub,
     return avpkt->size;
 }
 
-static int microdvd_init(AVCodecContext *avctx)
+static av_cold int microdvd_init(AVCodecContext *avctx)
 {
     int i, sidx;
     AVBPrint font_buf;
diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index f799252bf2..fe04514e16 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -443,7 +443,7 @@ static int text_to_ass(AVBPrint *buf, const char *text, const char *text_end,
     return 0;
 }
 
-static int mov_text_init(AVCodecContext *avctx) {
+static av_cold int mov_text_init(AVCodecContext *avctx) {
     /*
      * TODO: Handle the default text style.
      * NB: Most players ignore styles completely, with the result that
@@ -561,7 +561,7 @@ static int mov_text_decode_frame(AVCodecContext *avctx, AVSubtitle *sub,
     return avpkt->size;
 }
 
-static int mov_text_decode_close(AVCodecContext *avctx)
+static av_cold int mov_text_decode_close(AVCodecContext *avctx)
 {
     MovTextContext *m = avctx->priv_data;
     mov_text_cleanup_ftab(m);
@@ -569,7 +569,7 @@ static int mov_text_decode_close(AVCodecContext *avctx)
     return 0;
 }
 
-static void mov_text_flush(AVCodecContext *avctx)
+static av_cold void mov_text_flush(AVCodecContext *avctx)
 {
     MovTextContext *m = avctx->priv_data;
     if (!(avctx->flags2 & AV_CODEC_FLAG2_RO_FLUSH_NOOP))
diff --git a/libavcodec/rasc.c b/libavcodec/rasc.c
index 7b0251ca3f..a8e00a41a6 100644
--- a/libavcodec/rasc.c
+++ b/libavcodec/rasc.c
@@ -779,7 +779,7 @@ static av_cold int decode_close(AVCodecContext *avctx)
     return 0;
 }
 
-static void decode_flush(AVCodecContext *avctx)
+static av_cold void decode_flush(AVCodecContext *avctx)
 {
     RASCContext *s = avctx->priv_data;
 
diff --git a/libavcodec/rkmppdec.c b/libavcodec/rkmppdec.c
index 07d299f144..54e697664e 100644
--- a/libavcodec/rkmppdec.c
+++ b/libavcodec/rkmppdec.c
@@ -123,7 +123,7 @@ static int rkmpp_write_data(AVCodecContext *avctx, uint8_t *buffer, int size, in
     return ret;
 }
 
-static int rkmpp_close_decoder(AVCodecContext *avctx)
+static av_cold int rkmpp_close_decoder(AVCodecContext *avctx)
 {
     RKMPPDecodeContext *rk_context = avctx->priv_data;
     av_refstruct_unref(&rk_context->decoder);
@@ -149,7 +149,7 @@ static void rkmpp_release_decoder(AVRefStructOpaque unused, void *obj)
     av_buffer_unref(&decoder->device_ref);
 }
 
-static int rkmpp_init_decoder(AVCodecContext *avctx)
+static av_cold int rkmpp_init_decoder(AVCodecContext *avctx)
 {
     RKMPPDecodeContext *rk_context = avctx->priv_data;
     RKMPPDecoder *decoder = NULL;
@@ -517,7 +517,7 @@ static int rkmpp_receive_frame(AVCodecContext *avctx, AVFrame *frame)
     return rkmpp_retrieve_frame(avctx, frame);
 }
 
-static void rkmpp_flush(AVCodecContext *avctx)
+static av_cold void rkmpp_flush(AVCodecContext *avctx)
 {
     RKMPPDecodeContext *rk_context = avctx->priv_data;
     RKMPPDecoder *decoder = rk_context->decoder;
diff --git a/libavcodec/rpzaenc.c b/libavcodec/rpzaenc.c
index d9887f587a..b43c213ec8 100644
--- a/libavcodec/rpzaenc.c
+++ b/libavcodec/rpzaenc.c
@@ -788,7 +788,7 @@ post_skip :
     }
 }
 
-static int rpza_encode_init(AVCodecContext *avctx)
+static av_cold int rpza_encode_init(AVCodecContext *avctx)
 {
     RpzaContext *s = avctx->priv_data;
 
@@ -847,7 +847,7 @@ static int rpza_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     return 0;
 }
 
-static int rpza_encode_end(AVCodecContext *avctx)
+static av_cold int rpza_encode_end(AVCodecContext *avctx)
 {
     RpzaContext *s = (RpzaContext *)avctx->priv_data;
 
diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c
index 432e9a9a1f..d39319966c 100644
--- a/libavcodec/sbcdec.c
+++ b/libavcodec/sbcdec.c
@@ -321,7 +321,7 @@ static void sbc_synthesize_audio(struct sbc_decoder_state *state,
     }
 }
 
-static int sbc_decode_init(AVCodecContext *avctx)
+static av_cold int sbc_decode_init(AVCodecContext *avctx)
 {
     SBCDecContext *sbc = avctx->priv_data;
     int i, ch;
diff --git a/libavcodec/smcenc.c b/libavcodec/smcenc.c
index 58314317fd..dfa1c17d2d 100644
--- a/libavcodec/smcenc.c
+++ b/libavcodec/smcenc.c
@@ -515,7 +515,7 @@ static void smc_encode_stream(SMCContext *s, const AVFrame *frame,
     }
 }
 
-static int smc_encode_init(AVCodecContext *avctx)
+static av_cold int smc_encode_init(AVCodecContext *avctx)
 {
     SMCContext *s = avctx->priv_data;
 
@@ -580,7 +580,7 @@ static int smc_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     return 0;
 }
 
-static int smc_encode_end(AVCodecContext *avctx)
+static av_cold int smc_encode_end(AVCodecContext *avctx)
 {
     SMCContext *s = avctx->priv_data;
 
diff --git a/libavcodec/textdec.c b/libavcodec/textdec.c
index b9aebff002..10a052e99b 100644
--- a/libavcodec/textdec.c
+++ b/libavcodec/textdec.c
@@ -95,7 +95,7 @@ const FFCodec ff_text_decoder = {
 
 #if CONFIG_VPLAYER_DECODER || CONFIG_PJS_DECODER || CONFIG_SUBVIEWER1_DECODER || CONFIG_STL_DECODER
 
-static int linebreak_init(AVCodecContext *avctx)
+static av_cold int linebreak_init(AVCodecContext *avctx)
 {
     TextContext *text = avctx->priv_data;
     text->linebreaks = "|";
diff --git a/libavcodec/vaapi_av1.c b/libavcodec/vaapi_av1.c
index 5451b6055b..7e8f632b8a 100644
--- a/libavcodec/vaapi_av1.c
+++ b/libavcodec/vaapi_av1.c
@@ -74,7 +74,7 @@ static int8_t vaapi_av1_get_bit_depth_idx(AVCodecContext *avctx)
     return bit_depth == 8 ? 0 : bit_depth == 10 ? 1 : 2;
 }
 
-static int vaapi_av1_decode_init(AVCodecContext *avctx)
+static av_cold int vaapi_av1_decode_init(AVCodecContext *avctx)
 {
     VAAPIAV1DecContext *ctx = avctx->internal->hwaccel_priv_data;
 
@@ -92,7 +92,7 @@ static int vaapi_av1_decode_init(AVCodecContext *avctx)
     return ff_vaapi_decode_init(avctx);
 }
 
-static int vaapi_av1_decode_uninit(AVCodecContext *avctx)
+static av_cold int vaapi_av1_decode_uninit(AVCodecContext *avctx)
 {
     VAAPIAV1DecContext *ctx = avctx->internal->hwaccel_priv_data;
 
diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
index 0dd5641603..174abe226c 100644
--- a/libavcodec/vdpau.c
+++ b/libavcodec/vdpau.c
@@ -139,8 +139,8 @@ int ff_vdpau_common_frame_params(AVCodecContext *avctx,
     return 0;
 }
 
-int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile,
-                         int level)
+av_cold int ff_vdpau_common_init(AVCodecContext *avctx,
+                                 VdpDecoderProfile profile, int level)
 {
     VDPAUHWContext *hwctx = avctx->hwaccel_context;
     VDPAUContext *vdctx = avctx->internal->hwaccel_priv_data;
@@ -290,7 +290,7 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile,
     return vdpau_error(status);
 }
 
-int ff_vdpau_common_uninit(AVCodecContext *avctx)
+av_cold int ff_vdpau_common_uninit(AVCodecContext *avctx)
 {
     VDPAUContext *vdctx = avctx->internal->hwaccel_priv_data;
     VdpDecoderDestroy *destroy;
diff --git a/libavcodec/vdpau_av1.c b/libavcodec/vdpau_av1.c
index a1aff79bb7..0be3222135 100644
--- a/libavcodec/vdpau_av1.c
+++ b/libavcodec/vdpau_av1.c
@@ -330,7 +330,7 @@ static int vdpau_av1_end_frame(AVCodecContext *avctx)
     return 0;
 }
 
-static int vdpau_av1_init(AVCodecContext *avctx)
+static av_cold int vdpau_av1_init(AVCodecContext *avctx)
 {
     VdpDecoderProfile profile;
     uint32_t level = avctx->level;
diff --git a/libavcodec/vdpau_h264.c b/libavcodec/vdpau_h264.c
index 9c08e4048c..a1961b31f1 100644
--- a/libavcodec/vdpau_h264.c
+++ b/libavcodec/vdpau_h264.c
@@ -214,7 +214,7 @@ static int vdpau_h264_end_frame(AVCodecContext *avctx)
     return 0;
 }
 
-static int vdpau_h264_init(AVCodecContext *avctx)
+static av_cold int vdpau_h264_init(AVCodecContext *avctx)
 {
     VdpDecoderProfile profile;
     uint32_t level = avctx->level;
diff --git a/libavcodec/vdpau_hevc.c b/libavcodec/vdpau_hevc.c
index 0ddcafd897..b312adeafc 100644
--- a/libavcodec/vdpau_hevc.c
+++ b/libavcodec/vdpau_hevc.c
@@ -513,7 +513,7 @@ static int vdpau_hevc_parse_rext_profile(AVCodecContext *avctx, VdpDecoderProfil
 }
 
 
-static int vdpau_hevc_init(AVCodecContext *avctx)
+static av_cold int vdpau_hevc_init(AVCodecContext *avctx)
 {
     VdpDecoderProfile profile;
     uint32_t level = avctx->level;
diff --git a/libavcodec/vdpau_mpeg12.c b/libavcodec/vdpau_mpeg12.c
index 1ce0bfaa07..dc6341b7ed 100644
--- a/libavcodec/vdpau_mpeg12.c
+++ b/libavcodec/vdpau_mpeg12.c
@@ -100,7 +100,7 @@ static int vdpau_mpeg_decode_slice(AVCodecContext *avctx,
 }
 
 #if CONFIG_MPEG1_VDPAU_HWACCEL
-static int vdpau_mpeg1_init(AVCodecContext *avctx)
+static av_cold int vdpau_mpeg1_init(AVCodecContext *avctx)
 {
     return ff_vdpau_common_init(avctx, VDP_DECODER_PROFILE_MPEG1,
                                 VDP_DECODER_LEVEL_MPEG1_NA);
@@ -123,7 +123,7 @@ const FFHWAccel ff_mpeg1_vdpau_hwaccel = {
 #endif
 
 #if CONFIG_MPEG2_VDPAU_HWACCEL
-static int vdpau_mpeg2_init(AVCodecContext *avctx)
+static av_cold int vdpau_mpeg2_init(AVCodecContext *avctx)
 {
     VdpDecoderProfile profile;
 
diff --git a/libavcodec/vdpau_mpeg4.c b/libavcodec/vdpau_mpeg4.c
index 40af8655cc..1036890dd9 100644
--- a/libavcodec/vdpau_mpeg4.c
+++ b/libavcodec/vdpau_mpeg4.c
@@ -90,7 +90,7 @@ static int vdpau_mpeg4_decode_slice(av_unused AVCodecContext *avctx,
      return 0;
 }
 
-static int vdpau_mpeg4_init(AVCodecContext *avctx)
+static av_cold int vdpau_mpeg4_init(AVCodecContext *avctx)
 {
     VdpDecoderProfile profile;
 
diff --git a/libavcodec/vdpau_vc1.c b/libavcodec/vdpau_vc1.c
index 20208c6dbc..53ff367230 100644
--- a/libavcodec/vdpau_vc1.c
+++ b/libavcodec/vdpau_vc1.c
@@ -116,7 +116,7 @@ static int vdpau_vc1_decode_slice(AVCodecContext *avctx,
     return 0;
 }
 
-static int vdpau_vc1_init(AVCodecContext *avctx)
+static av_cold int vdpau_vc1_init(AVCodecContext *avctx)
 {
     VdpDecoderProfile profile;
 
diff --git a/libavcodec/vdpau_vp9.c b/libavcodec/vdpau_vp9.c
index 424e2e60fb..e000d7f6ca 100644
--- a/libavcodec/vdpau_vp9.c
+++ b/libavcodec/vdpau_vp9.c
@@ -197,7 +197,7 @@ static int vdpau_vp9_end_frame(AVCodecContext *avctx)
     return 0;
 }
 
-static int vdpau_vp9_init(AVCodecContext *avctx)
+static av_cold int vdpau_vp9_init(AVCodecContext *avctx)
 {
     VdpDecoderProfile profile;
     uint32_t level = avctx->level;
-- 
2.45.2


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  reply	other threads:[~2025-03-14 13:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-14 13:49 Andreas Rheinhardt
2025-03-14 13:51 ` Andreas Rheinhardt [this message]
2025-03-16  3:51   ` Andreas Rheinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AS8P250MB074417E43F45CDD27E2FDA718FD22@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git