avcodec: Add av_cold to flush,init,close functions missing it

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2025-09-05 01:09:49 +02:00 committed by James Almer
parent bc545bae3b
commit 1df63acdc4
81 changed files with 176 additions and 106 deletions

View file

@ -147,7 +147,7 @@ void ff_tilt_compensation(float *mem, float tilt, float *samples, int size)
*mem = new_tilt_mem; *mem = new_tilt_mem;
} }
void ff_acelp_filter_init(ACELPFContext *c) av_cold void ff_acelp_filter_init(ACELPFContext *c)
{ {
c->acelp_interpolatef = ff_acelp_interpolatef; c->acelp_interpolatef = ff_acelp_interpolatef;
c->acelp_apply_order_2_transfer_function = ff_acelp_apply_order_2_transfer_function; c->acelp_apply_order_2_transfer_function = ff_acelp_apply_order_2_transfer_function;

View file

@ -255,7 +255,7 @@ void ff_clear_fixed_vector(float *out, const AMRFixed *in, int size)
} }
} }
void ff_acelp_vectors_init(ACELPVContext *c) av_cold void ff_acelp_vectors_init(ACELPVContext *c)
{ {
c->weighted_vector_sumf = ff_weighted_vector_sumf; c->weighted_vector_sumf = ff_weighted_vector_sumf;

View file

@ -46,6 +46,8 @@
#include "codec_internal.h" #include "codec_internal.h"
#include "decode.h" #include "decode.h"
#include "libavutil/attributes.h"
/** /**
* @file * @file
* ADPCM decoders * ADPCM decoders
@ -2540,7 +2542,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, AVFrame *frame,
return bytestream2_tell(&gb); return bytestream2_tell(&gb);
} }
static void adpcm_flush(AVCodecContext *avctx) static av_cold void adpcm_flush(AVCodecContext *avctx)
{ {
ADPCMDecodeContext *c = avctx->priv_data; ADPCMDecodeContext *c = avctx->priv_data;

View file

@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "libavutil/attributes.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "avcodec.h" #include "avcodec.h"
#include "adx.h" #include "adx.h"
@ -246,7 +247,7 @@ static int adx_decode_frame(AVCodecContext *avctx, AVFrame *frame,
return buf - avpkt->data; return buf - avpkt->data;
} }
static void adx_decode_flush(AVCodecContext *avctx) static av_cold void adx_decode_flush(AVCodecContext *avctx)
{ {
ADXContext *c = avctx->priv_data; ADXContext *c = avctx->priv_data;
memset(c->prev, 0, sizeof(c->prev)); memset(c->prev, 0, sizeof(c->prev));

View file

@ -24,6 +24,7 @@
#define BITSTREAM_READER_LE #define BITSTREAM_READER_LE
#include "libavutil/attributes.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "libavutil/mem_internal.h" #include "libavutil/mem_internal.h"
@ -1245,7 +1246,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
return 0; return 0;
} }
static void decode_flush(AVCodecContext *avctx) static av_cold void decode_flush(AVCodecContext *avctx)
{ {
AGMContext *s = avctx->priv_data; AGMContext *s = avctx->priv_data;

View file

@ -22,6 +22,7 @@
#include <inttypes.h> #include <inttypes.h>
#include "libavutil/attributes.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
#include "libavutil/crc.h" #include "libavutil/crc.h"
@ -1729,7 +1730,7 @@ static int ape_decode_frame(AVCodecContext *avctx, AVFrame *frame,
return !s->samples ? avpkt->size : 0; return !s->samples ? avpkt->size : 0;
} }
static void ape_flush(AVCodecContext *avctx) static av_cold void ape_flush(AVCodecContext *avctx)
{ {
APEContext *s = avctx->priv_data; APEContext *s = avctx->priv_data;
s->samples= 0; s->samples= 0;

View file

@ -18,6 +18,7 @@
#include <stdatomic.h> #include <stdatomic.h>
#include "libavutil/attributes.h"
#include "libavutil/mastering_display_metadata.h" #include "libavutil/mastering_display_metadata.h"
#include "libavutil/mem_internal.h" #include "libavutil/mem_internal.h"
#include "libavutil/pixdesc.h" #include "libavutil/pixdesc.h"
@ -156,7 +157,7 @@ static av_cold int apv_decode_init(AVCodecContext *avctx)
return 0; return 0;
} }
static void apv_decode_flush(AVCodecContext *avctx) static av_cold void apv_decode_flush(AVCodecContext *avctx)
{ {
APVDecodeContext *apv = avctx->priv_data; APVDecodeContext *apv = avctx->priv_data;

View file

@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "libavutil/attributes.h"
#include "libavutil/internal.h" #include "libavutil/internal.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
@ -192,7 +193,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
return 0; return 0;
} }
static void decode_flush(AVCodecContext *avctx) static av_cold void decode_flush(AVCodecContext *avctx)
{ {
ARBCContext *s = avctx->priv_data; ARBCContext *s = avctx->priv_data;

View file

@ -21,6 +21,7 @@
#include <string.h> #include <string.h>
#include "libavutil/attributes.h"
#include "libavutil/internal.h" #include "libavutil/internal.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
@ -717,7 +718,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
return 0; return 0;
} }
static void decode_flush(AVCodecContext *avctx) static av_cold void decode_flush(AVCodecContext *avctx)
{ {
ArgoContext *s = avctx->priv_data; ArgoContext *s = avctx->priv_data;

View file

@ -163,7 +163,7 @@ int ff_ass_add_rect(AVSubtitle *sub, const char *dialog,
return ff_ass_add_rect2(sub, dialog, readorder, layer, style, speaker, NULL); return ff_ass_add_rect2(sub, dialog, readorder, layer, style, speaker, NULL);
} }
void ff_ass_decoder_flush(AVCodecContext *avctx) av_cold void ff_ass_decoder_flush(AVCodecContext *avctx)
{ {
FFASSDecoderContext *s = avctx->priv_data; FFASSDecoderContext *s = avctx->priv_data;
if (!(avctx->flags2 & AV_CODEC_FLAG2_RO_FLUSH_NOOP)) if (!(avctx->flags2 & AV_CODEC_FLAG2_RO_FLUSH_NOOP))

View file

@ -379,7 +379,7 @@ static int ass_split(ASSSplitContext *ctx, const char *buf)
return buf ? 0 : AVERROR_INVALIDDATA; return buf ? 0 : AVERROR_INVALIDDATA;
} }
ASSSplitContext *ff_ass_split(const char *buf) av_cold ASSSplitContext *ff_ass_split(const char *buf)
{ {
ASSSplitContext *ctx = av_mallocz(sizeof(*ctx)); ASSSplitContext *ctx = av_mallocz(sizeof(*ctx));
if (!ctx) if (!ctx)
@ -467,7 +467,7 @@ ASSDialog *ff_ass_split_dialog(ASSSplitContext *ctx, const char *buf)
return dialog; return dialog;
} }
void ff_ass_split_free(ASSSplitContext *ctx) av_cold void ff_ass_split_free(ASSSplitContext *ctx)
{ {
if (ctx) { if (ctx) {
int i; int i;

View file

@ -820,7 +820,7 @@ static int atrac9_decode_frame(AVCodecContext *avctx, AVFrame *frame,
return avctx->block_align; return avctx->block_align;
} }
static void atrac9_decode_flush(AVCodecContext *avctx) static av_cold void atrac9_decode_flush(AVCodecContext *avctx)
{ {
ATRAC9Context *s = avctx->priv_data; ATRAC9Context *s = avctx->priv_data;

View file

@ -33,7 +33,7 @@ av_cold void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq)
afq->frame_count = 0; afq->frame_count = 0;
} }
void ff_af_queue_close(AudioFrameQueue *afq) av_cold void ff_af_queue_close(AudioFrameQueue *afq)
{ {
if(afq->frame_count) if(afq->frame_count)
av_log(afq->avctx, AV_LOG_WARNING, "%d frames left in the queue on closing\n", afq->frame_count); av_log(afq->avctx, AV_LOG_WARNING, "%d frames left in the queue on closing\n", afq->frame_count);

View file

@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "libavutil/attributes.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "av1_parse.h" #include "av1_parse.h"
@ -200,7 +201,7 @@ static av_cold int av1_parser_init(AVCodecParserContext *ctx)
return 0; return 0;
} }
static void av1_parser_close(AVCodecParserContext *ctx) static av_cold void av1_parser_close(AVCodecParserContext *ctx)
{ {
AV1ParseContext *s = ctx->priv_data; AV1ParseContext *s = ctx->priv_data;

View file

@ -20,6 +20,7 @@
#include "config_components.h" #include "config_components.h"
#include "libavutil/attributes.h"
#include "libavutil/hdr_dynamic_metadata.h" #include "libavutil/hdr_dynamic_metadata.h"
#include "libavutil/film_grain_params.h" #include "libavutil/film_grain_params.h"
#include "libavutil/mastering_display_metadata.h" #include "libavutil/mastering_display_metadata.h"
@ -1535,7 +1536,7 @@ static int av1_receive_frame(AVCodecContext *avctx, AVFrame *frame)
return ret; return ret;
} }
static void av1_decode_flush(AVCodecContext *avctx) static av_cold void av1_decode_flush(AVCodecContext *avctx)
{ {
AV1DecContext *s = avctx->priv_data; AV1DecContext *s = avctx->priv_data;
AV1RawMetadataITUTT35 itut_t35; AV1RawMetadataITUTT35 itut_t35;

View file

@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "libavutil/attributes.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "avcodec.h" #include "avcodec.h"
#include "idctdsp.h" #include "idctdsp.h"
@ -68,12 +69,12 @@ static const AVClass avdct_class = {
.version = LIBAVUTIL_VERSION_INT, .version = LIBAVUTIL_VERSION_INT,
}; };
const AVClass *avcodec_dct_get_class(void) av_cold const AVClass *avcodec_dct_get_class(void)
{ {
return &avdct_class; return &avdct_class;
} }
AVDCT *avcodec_dct_alloc(void) av_cold AVDCT *avcodec_dct_alloc(void)
{ {
AVDCT *dsp = av_mallocz(sizeof(AVDCT)); AVDCT *dsp = av_mallocz(sizeof(AVDCT));
@ -86,7 +87,7 @@ AVDCT *avcodec_dct_alloc(void)
return dsp; return dsp;
} }
int avcodec_dct_init(AVDCT *dsp) av_cold int avcodec_dct_init(AVDCT *dsp)
{ {
AVCodecContext *avctx = avcodec_alloc_context3(NULL); AVCodecContext *avctx = avcodec_alloc_context3(NULL);

View file

@ -1411,7 +1411,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
return 0; return 0;
} }
static void flush(AVCodecContext *avctx) static av_cold void flush(AVCodecContext *avctx)
{ {
BinkContext * const c = avctx->priv_data; BinkContext * const c = avctx->priv_data;

View file

@ -30,6 +30,7 @@
#include "config_components.h" #include "config_components.h"
#include "libavutil/attributes.h"
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
#include "libavutil/intfloat.h" #include "libavutil/intfloat.h"
#include "libavutil/mem_internal.h" #include "libavutil/mem_internal.h"
@ -358,7 +359,7 @@ fail:
return ret; return ret;
} }
static void decode_flush(AVCodecContext *avctx) static av_cold void decode_flush(AVCodecContext *avctx)
{ {
BinkAudioContext *const s = avctx->priv_data; BinkAudioContext *const s = avctx->priv_data;

View file

@ -25,6 +25,7 @@
* @author Stefan Gehrer <stefan.gehrer@gmx.de> * @author Stefan Gehrer <stefan.gehrer@gmx.de>
*/ */
#include "libavutil/attributes.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/emms.h" #include "libavutil/emms.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
@ -1230,7 +1231,7 @@ static int decode_seq_header(AVSContext *h)
return 0; return 0;
} }
static void cavs_flush(AVCodecContext * avctx) static av_cold void cavs_flush(AVCodecContext * avctx)
{ {
AVSContext *h = avctx->priv_data; AVSContext *h = avctx->priv_data;
h->got_keyframe = 0; h->got_keyframe = 0;

View file

@ -16,6 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "libavutil/attributes.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/opt.h" #include "libavutil/opt.h"
#include "libavutil/pixfmt.h" #include "libavutil/pixfmt.h"
@ -1265,7 +1266,7 @@ static int cbs_av1_assemble_fragment(CodedBitstreamContext *ctx,
#endif #endif
} }
static void cbs_av1_flush(CodedBitstreamContext *ctx) static av_cold void cbs_av1_flush(CodedBitstreamContext *ctx)
{ {
CodedBitstreamAV1Context *priv = ctx->priv_data; CodedBitstreamAV1Context *priv = ctx->priv_data;
@ -1279,7 +1280,7 @@ static void cbs_av1_flush(CodedBitstreamContext *ctx)
priv->tile_num = 0; priv->tile_num = 0;
} }
static void cbs_av1_close(CodedBitstreamContext *ctx) static av_cold void cbs_av1_close(CodedBitstreamContext *ctx)
{ {
CodedBitstreamAV1Context *priv = ctx->priv_data; CodedBitstreamAV1Context *priv = ctx->priv_data;

View file

@ -20,6 +20,8 @@
#include "bsf_internal.h" #include "bsf_internal.h"
#include "cbs_bsf.h" #include "cbs_bsf.h"
#include "libavutil/attributes.h"
static int cbs_bsf_update_side_data(AVBSFContext *bsf, AVPacket *pkt) static int cbs_bsf_update_side_data(AVBSFContext *bsf, AVPacket *pkt)
{ {
CBSBSFContext *ctx = bsf->priv_data; CBSBSFContext *ctx = bsf->priv_data;
@ -107,7 +109,7 @@ fail:
return err; return err;
} }
int ff_cbs_bsf_generic_init(AVBSFContext *bsf, const CBSBSFType *type) av_cold int ff_cbs_bsf_generic_init(AVBSFContext *bsf, const CBSBSFType *type)
{ {
CBSBSFContext *ctx = bsf->priv_data; CBSBSFContext *ctx = bsf->priv_data;
CodedBitstreamFragment *frag = &ctx->fragment; CodedBitstreamFragment *frag = &ctx->fragment;
@ -152,7 +154,7 @@ fail:
return err; return err;
} }
void ff_cbs_bsf_generic_close(AVBSFContext *bsf) av_cold void ff_cbs_bsf_generic_close(AVBSFContext *bsf)
{ {
CBSBSFContext *ctx = bsf->priv_data; CBSBSFContext *ctx = bsf->priv_data;

View file

@ -1905,7 +1905,7 @@ static int cbs_h2645_assemble_fragment(CodedBitstreamContext *ctx,
return 0; return 0;
} }
static void cbs_h264_flush(CodedBitstreamContext *ctx) static av_cold void cbs_h264_flush(CodedBitstreamContext *ctx)
{ {
CodedBitstreamH264Context *h264 = ctx->priv_data; CodedBitstreamH264Context *h264 = ctx->priv_data;
@ -1919,7 +1919,7 @@ static void cbs_h264_flush(CodedBitstreamContext *ctx)
h264->last_slice_nal_unit_type = 0; h264->last_slice_nal_unit_type = 0;
} }
static void cbs_h264_close(CodedBitstreamContext *ctx) static av_cold void cbs_h264_close(CodedBitstreamContext *ctx)
{ {
CodedBitstreamH264Context *h264 = ctx->priv_data; CodedBitstreamH264Context *h264 = ctx->priv_data;
int i; int i;
@ -1932,7 +1932,7 @@ static void cbs_h264_close(CodedBitstreamContext *ctx)
av_refstruct_unref(&h264->pps[i]); av_refstruct_unref(&h264->pps[i]);
} }
static void cbs_h265_flush(CodedBitstreamContext *ctx) static av_cold void cbs_h265_flush(CodedBitstreamContext *ctx)
{ {
CodedBitstreamH265Context *h265 = ctx->priv_data; CodedBitstreamH265Context *h265 = ctx->priv_data;
@ -1948,7 +1948,7 @@ static void cbs_h265_flush(CodedBitstreamContext *ctx)
h265->active_pps = NULL; h265->active_pps = NULL;
} }
static void cbs_h265_close(CodedBitstreamContext *ctx) static av_cold void cbs_h265_close(CodedBitstreamContext *ctx)
{ {
CodedBitstreamH265Context *h265 = ctx->priv_data; CodedBitstreamH265Context *h265 = ctx->priv_data;
int i; int i;
@ -1963,7 +1963,7 @@ static void cbs_h265_close(CodedBitstreamContext *ctx)
av_refstruct_unref(&h265->pps[i]); av_refstruct_unref(&h265->pps[i]);
} }
static void cbs_h266_flush(CodedBitstreamContext *ctx) static av_cold void cbs_h266_flush(CodedBitstreamContext *ctx)
{ {
CodedBitstreamH266Context *h266 = ctx->priv_data; CodedBitstreamH266Context *h266 = ctx->priv_data;
@ -1976,7 +1976,7 @@ static void cbs_h266_flush(CodedBitstreamContext *ctx)
av_refstruct_unref(&h266->ph_ref); av_refstruct_unref(&h266->ph_ref);
} }
static void cbs_h266_close(CodedBitstreamContext *ctx) static av_cold void cbs_h266_close(CodedBitstreamContext *ctx)
{ {
CodedBitstreamH266Context *h266 = ctx->priv_data; CodedBitstreamH266Context *h266 = ctx->priv_data;

View file

@ -587,7 +587,7 @@ static int cbs_vp9_assemble_fragment(CodedBitstreamContext *ctx,
return 0; return 0;
} }
static void cbs_vp9_flush(CodedBitstreamContext *ctx) static av_cold void cbs_vp9_flush(CodedBitstreamContext *ctx)
{ {
CodedBitstreamVP9Context *vp9 = ctx->priv_data; CodedBitstreamVP9Context *vp9 = ctx->priv_data;

View file

@ -23,6 +23,7 @@
#include "avcodec.h" #include "avcodec.h"
#include "ass.h" #include "ass.h"
#include "codec_internal.h" #include "codec_internal.h"
#include "libavutil/attributes.h"
#include "libavutil/opt.h" #include "libavutil/opt.h"
#define SCREEN_ROWS 15 #define SCREEN_ROWS 15
@ -309,7 +310,7 @@ static av_cold int close_decoder(AVCodecContext *avctx)
return 0; return 0;
} }
static void flush_decoder(AVCodecContext *avctx) static av_cold void flush_decoder(AVCodecContext *avctx)
{ {
CCaptionSubContext *ctx = avctx->priv_data; CCaptionSubContext *ctx = avctx->priv_data;
ctx->screen[0].row_used = 0; ctx->screen[0].row_used = 0;

View file

@ -24,6 +24,8 @@
#include "codec_internal.h" #include "codec_internal.h"
#include "decode.h" #include "decode.h"
#include "libavutil/attributes.h"
/** /**
* @file * @file
* @brief CD Graphics Video Decoder * @brief CD Graphics Video Decoder
@ -367,7 +369,7 @@ static int cdg_decode_frame(AVCodecContext *avctx, AVFrame *frame,
return avpkt->size; return avpkt->size;
} }
static void cdg_decode_flush(AVCodecContext *avctx) static av_cold void cdg_decode_flush(AVCodecContext *avctx)
{ {
CDGraphicsContext *cc = avctx->priv_data; CDGraphicsContext *cc = avctx->priv_data;

View file

@ -420,7 +420,7 @@ static av_cold int cdtoons_decode_init(AVCodecContext *avctx)
return 0; return 0;
} }
static void cdtoons_flush(AVCodecContext *avctx) static av_cold void cdtoons_flush(AVCodecContext *avctx)
{ {
CDToonsContext *c = avctx->priv_data; CDToonsContext *c = avctx->priv_data;

View file

@ -25,6 +25,7 @@
#include "config.h" #include "config.h"
#include "celp_filters.h" #include "celp_filters.h"
#include "libavutil/attributes.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/common.h" #include "libavutil/common.h"
@ -210,7 +211,7 @@ void ff_celp_lp_zero_synthesis_filterf(float *out, const float *filter_coeffs,
} }
} }
void ff_celp_filter_init(CELPFContext *c) void av_cold ff_celp_filter_init(CELPFContext *c)
{ {
c->celp_lp_synthesis_filterf = ff_celp_lp_synthesis_filterf; c->celp_lp_synthesis_filterf = ff_celp_lp_synthesis_filterf;
c->celp_lp_zero_synthesis_filterf = ff_celp_lp_zero_synthesis_filterf; c->celp_lp_zero_synthesis_filterf = ff_celp_lp_zero_synthesis_filterf;

View file

@ -97,7 +97,7 @@ static void make_lpc_coefs(float *lpc, const float *refl, int order)
memcpy(lpc, cur, sizeof(*lpc) * order); memcpy(lpc, cur, sizeof(*lpc) * order);
} }
static void cng_decode_flush(AVCodecContext *avctx) static av_cold void cng_decode_flush(AVCodecContext *avctx)
{ {
CNGContext *p = avctx->priv_data; CNGContext *p = avctx->priv_data;
p->inited = 0; p->inited = 0;

View file

@ -29,10 +29,11 @@
#include <string.h> #include <string.h>
#include "libavutil/attributes.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "parser.h" #include "avcodec.h"
#define DIRAC_PARSE_INFO_PREFIX 0x42424344 #define DIRAC_PARSE_INFO_PREFIX 0x42424344
@ -265,7 +266,7 @@ static int dirac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
return next; return next;
} }
static void dirac_parse_close(AVCodecParserContext *s) static av_cold void dirac_parse_close(AVCodecParserContext *s)
{ {
DiracParseContext *pc = s->priv_data; DiracParseContext *pc = s->priv_data;

View file

@ -21,6 +21,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "libavutil/attributes.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "dovi_rpu.h" #include "dovi_rpu.h"
@ -39,7 +40,7 @@ void ff_dovi_ctx_unref(DOVIContext *s)
}; };
} }
void ff_dovi_ctx_flush(DOVIContext *s) av_cold void ff_dovi_ctx_flush(DOVIContext *s)
{ {
av_refstruct_unref(&s->dm); av_refstruct_unref(&s->dm);
for (int i = 0; i < FF_ARRAY_ELEMS(s->vdr); i++) for (int i = 0; i < FF_ARRAY_ELEMS(s->vdr); i++)

View file

@ -43,6 +43,8 @@
#include "decode.h" #include "decode.h"
#include "mathops.h" #include "mathops.h"
#include "libavutil/attributes.h"
typedef struct DPCMContext { typedef struct DPCMContext {
int16_t array[256]; int16_t array[256];
int sample[2]; ///< previous sample (for SOL_DPCM and WADY_DPCM) int sample[2]; ///< previous sample (for SOL_DPCM and WADY_DPCM)
@ -457,7 +459,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx, AVFrame *frame,
return avpkt->size; return avpkt->size;
} }
static void dpcm_flush(AVCodecContext *avctx) static av_cold void dpcm_flush(AVCodecContext *avctx)
{ {
DPCMContext *s = avctx->priv_data; DPCMContext *s = avctx->priv_data;

View file

@ -686,7 +686,7 @@ static av_cold int dvdsub_init(AVCodecContext *avctx)
return 1; return 1;
} }
static void dvdsub_flush(AVCodecContext *avctx) static av_cold void dvdsub_flush(AVCodecContext *avctx)
{ {
DVDSubContext *ctx = avctx->priv_data; DVDSubContext *ctx = avctx->priv_data;
ctx->buf_size = 0; ctx->buf_size = 0;

View file

@ -25,6 +25,8 @@
#include "evc.h" #include "evc.h"
#include "evc_parse.h" #include "evc_parse.h"
#include "libavutil/attributes.h"
typedef struct EVCParserContext { typedef struct EVCParserContext {
EVCParamSets ps; EVCParamSets ps;
EVCParserPoc poc; EVCParserPoc poc;
@ -362,7 +364,7 @@ static int evc_parse(AVCodecParserContext *s, AVCodecContext *avctx,
return next; return next;
} }
static void evc_parser_close(AVCodecParserContext *s) static av_cold void evc_parser_close(AVCodecParserContext *s)
{ {
EVCParserContext *ctx = s->priv_data; EVCParserContext *ctx = s->priv_data;

View file

@ -129,7 +129,7 @@ static void *executor_worker_task(void *data)
} }
#endif #endif
static void executor_free(FFExecutor *e, const int has_lock, const int has_cond) static av_cold void executor_free(FFExecutor *e, const int has_lock, const int has_cond)
{ {
if (e->thread_count) { if (e->thread_count) {
//signal die //signal die
@ -153,7 +153,7 @@ static void executor_free(FFExecutor *e, const int has_lock, const int has_cond)
av_free(e); av_free(e);
} }
FFExecutor* ff_executor_alloc(const FFTaskCallbacks *cb, int thread_count) av_cold FFExecutor* ff_executor_alloc(const FFTaskCallbacks *cb, int thread_count)
{ {
FFExecutor *e; FFExecutor *e;
int has_lock = 0, has_cond = 0; int has_lock = 0, has_cond = 0;
@ -199,7 +199,7 @@ free_executor:
return NULL; return NULL;
} }
void ff_executor_free(FFExecutor **executor) av_cold void ff_executor_free(FFExecutor **executor)
{ {
int thread_count; int thread_count;

View file

@ -20,6 +20,8 @@
#include "ffv1.h" #include "ffv1.h"
#include "rangecoder.h" #include "rangecoder.h"
#include "libavutil/attributes.h"
typedef struct FFV1ParseContext { typedef struct FFV1ParseContext {
FFV1Context f; FFV1Context f;
int got_first; int got_first;
@ -70,7 +72,7 @@ static int parse(AVCodecParserContext *s,
return buf_size; return buf_size;
} }
static void ffv1_close(AVCodecParserContext *s) static av_cold void ffv1_close(AVCodecParserContext *s)
{ {
FFV1ParseContext *p = s->priv_data; FFV1ParseContext *p = s->priv_data;

View file

@ -887,7 +887,7 @@ static av_cold int flac_parse_init(AVCodecParserContext *c)
return 0; return 0;
} }
static void flac_parse_close(AVCodecParserContext *c) static av_cold void flac_parse_close(AVCodecParserContext *c)
{ {
FLACParseContext *fpc = c->priv_data; FLACParseContext *fpc = c->priv_data;
FLACHeaderMarker *curr = fpc->headers, *temp; FLACHeaderMarker *curr = fpc->headers, *temp;

View file

@ -22,6 +22,8 @@
#include "get_bits.h" #include "get_bits.h"
#include "decode.h" #include "decode.h"
#include "libavutil/attributes.h"
typedef struct FTRContext { typedef struct FTRContext {
AVCodecContext *aac_avctx[64]; // wrapper context for AAC AVCodecContext *aac_avctx[64]; // wrapper context for AAC
int nb_context; int nb_context;
@ -173,7 +175,7 @@ static int ftr_decode_frame(AVCodecContext *avctx, AVFrame *frame,
return get_bits_count(&gb) >> 3; return get_bits_count(&gb) >> 3;
} }
static void ftr_flush(AVCodecContext *avctx) static av_cold void ftr_flush(AVCodecContext *avctx)
{ {
FTRContext *s = avctx->priv_data; FTRContext *s = avctx->priv_data;

View file

@ -30,6 +30,7 @@
* @see http://www.w3.org/Graphics/GIF/spec-gif89a.txt * @see http://www.w3.org/Graphics/GIF/spec-gif89a.txt
*/ */
#include "libavutil/attributes.h"
#include "libavutil/imgutils_internal.h" #include "libavutil/imgutils_internal.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "libavutil/opt.h" #include "libavutil/opt.h"
@ -518,7 +519,7 @@ static int gif_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return 0; return 0;
} }
static int gif_encode_close(AVCodecContext *avctx) static av_cold int gif_encode_close(AVCodecContext *avctx)
{ {
GIFContext *s = avctx->priv_data; GIFContext *s = avctx->priv_data;

View file

@ -26,6 +26,7 @@
#include "config_components.h" #include "config_components.h"
#include "libavutil/attributes.h"
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
#include "avcodec.h" #include "avcodec.h"
#include "codec_internal.h" #include "codec_internal.h"
@ -106,7 +107,7 @@ static int gsm_decode_frame(AVCodecContext *avctx, AVFrame *frame,
return avctx->block_align; return avctx->block_align;
} }
static void gsm_flush(AVCodecContext *avctx) static av_cold void gsm_flush(AVCodecContext *avctx)
{ {
GSMContext *s = avctx->priv_data; GSMContext *s = avctx->priv_data;
memset(s, 0, sizeof(*s)); memset(s, 0, sizeof(*s));

View file

@ -29,6 +29,7 @@
#include <stdint.h> #include <stdint.h>
#include "libavutil/attributes.h"
#include "libavutil/avutil.h" #include "libavutil/avutil.h"
#include "libavutil/error.h" #include "libavutil/error.h"
#include "libavutil/log.h" #include "libavutil/log.h"
@ -660,7 +661,7 @@ static int h264_parse(AVCodecParserContext *s,
return next; return next;
} }
static void h264_close(AVCodecParserContext *s) static av_cold void h264_close(AVCodecParserContext *s)
{ {
H264ParseContext *p = s->priv_data; H264ParseContext *p = s->priv_data;
ParseContext *pc = &p->pc; ParseContext *pc = &p->pc;

View file

@ -29,6 +29,7 @@
#include "config_components.h" #include "config_components.h"
#include "libavutil/attributes.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/emms.h" #include "libavutil/emms.h"
#include "libavutil/imgutils.h" #include "libavutil/imgutils.h"
@ -474,7 +475,7 @@ void ff_h264_flush_change(H264Context *h)
h->mmco_reset = 1; h->mmco_reset = 1;
} }
static void h264_decode_flush(AVCodecContext *avctx) static av_cold void h264_decode_flush(AVCodecContext *avctx)
{ {
H264Context *h = avctx->priv_data; H264Context *h = avctx->priv_data;
int i; int i;

View file

@ -4187,7 +4187,7 @@ static av_cold int hevc_decode_init(AVCodecContext *avctx)
return 0; return 0;
} }
static void hevc_decode_flush(AVCodecContext *avctx) static av_cold void hevc_decode_flush(AVCodecContext *avctx)
{ {
HEVCContext *s = avctx->priv_data; HEVCContext *s = avctx->priv_data;
ff_hevc_flush_dpb(s); ff_hevc_flush_dpb(s);

View file

@ -23,6 +23,7 @@
#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>
#include "libavutil/attributes.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "libavutil/mem_internal.h" #include "libavutil/mem_internal.h"
#include "libavutil/thread.h" #include "libavutil/thread.h"
@ -518,7 +519,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
return 0; return 0;
} }
static void decode_flush(AVCodecContext *avctx) static av_cold void decode_flush(AVCodecContext *avctx)
{ {
IMM4Context *s = avctx->priv_data; IMM4Context *s = avctx->priv_data;

View file

@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "libavutil/attributes.h"
#include "libavutil/attributes_internal.h" #include "libavutil/attributes_internal.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
@ -155,7 +156,7 @@ static int imm5_decode_frame(AVCodecContext *avctx, AVFrame *frame,
return avpkt->size; return avpkt->size;
} }
static void imm5_flush(AVCodecContext *avctx) static av_cold void imm5_flush(AVCodecContext *avctx)
{ {
IMM5Context *ctx = avctx->priv_data; IMM5Context *ctx = avctx->priv_data;

View file

@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "libavutil/attributes.h"
#include "libavutil/common.h" #include "libavutil/common.h"
#include "avcodec.h" #include "avcodec.h"
#include "bytestream.h" #include "bytestream.h"
@ -158,7 +159,7 @@ static int imx_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
return avpkt->size; return avpkt->size;
} }
static void imx_decode_flush(AVCodecContext *avctx) static av_cold void imx_decode_flush(AVCodecContext *avctx)
{ {
SimbiosisIMXContext *imx = avctx->priv_data; SimbiosisIMXContext *imx = avctx->priv_data;
@ -168,7 +169,7 @@ static void imx_decode_flush(AVCodecContext *avctx)
memset(imx->history, 0, sizeof(imx->history)); memset(imx->history, 0, sizeof(imx->history));
} }
static int imx_decode_close(AVCodecContext *avctx) static av_cold int imx_decode_close(AVCodecContext *avctx)
{ {
SimbiosisIMXContext *imx = avctx->priv_data; SimbiosisIMXContext *imx = avctx->priv_data;

View file

@ -71,6 +71,7 @@
#include "bytestream.h" #include "bytestream.h"
#include "jpeg2000.h" #include "jpeg2000.h"
#include "version.h" #include "version.h"
#include "libavutil/attributes.h"
#include "libavutil/common.h" #include "libavutil/common.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "libavutil/pixdesc.h" #include "libavutil/pixdesc.h"
@ -580,7 +581,7 @@ static void init_quantization(Jpeg2000EncoderContext *s)
} }
} }
static void init_luts(void) static av_cold void init_luts(void)
{ {
int i, a, int i, a,
mask = ~((1<<NMSEDEC_FRACBITS)-1); mask = ~((1<<NMSEDEC_FRACBITS)-1);

View file

@ -21,6 +21,7 @@
#include "config.h" #include "config.h"
#include "lossless_videodsp.h" #include "lossless_videodsp.h"
#include "libavcodec/mathops.h" #include "libavcodec/mathops.h"
#include "libavutil/attributes.h"
// 0x7f7f7f7f or 0x7f7f7f7f7f7f7f7f or whatever, depending on the cpu's native arithmetic size // 0x7f7f7f7f or 0x7f7f7f7f7f7f7f7f or whatever, depending on the cpu's native arithmetic size
#define pb_7f (~0UL / 255 * 0x7f) #define pb_7f (~0UL / 255 * 0x7f)
@ -110,7 +111,7 @@ static void add_gradient_pred_c(uint8_t *src, const ptrdiff_t stride, const ptrd
} }
} }
void ff_llviddsp_init(LLVidDSPContext *c) av_cold void ff_llviddsp_init(LLVidDSPContext *c)
{ {
c->add_bytes = add_bytes_c; c->add_bytes = add_bytes_c;
c->add_median_pred = add_median_pred_c; c->add_median_pred = add_median_pred_c;

View file

@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "libavutil/attributes.h"
#include "libavutil/imgutils.h" #include "libavutil/imgutils.h"
#include "libavutil/internal.h" #include "libavutil/internal.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
@ -257,7 +258,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
return 0; return 0;
} }
static void decode_flush(AVCodecContext *avctx) static av_cold void decode_flush(AVCodecContext *avctx)
{ {
MidiVidContext *s = avctx->priv_data; MidiVidContext *s = avctx->priv_data;

View file

@ -32,7 +32,7 @@
#include "config_components.h" #include "config_components.h"
#include "libavutil/display.h" #include "libavutil/attributes.h"
#include "libavutil/emms.h" #include "libavutil/emms.h"
#include "libavutil/imgutils.h" #include "libavutil/imgutils.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
@ -43,6 +43,7 @@
#include "codec_internal.h" #include "codec_internal.h"
#include "copy_block.h" #include "copy_block.h"
#include "decode.h" #include "decode.h"
#include "exif.h"
#include "hwaccel_internal.h" #include "hwaccel_internal.h"
#include "hwconfig.h" #include "hwconfig.h"
#include "idctdsp.h" #include "idctdsp.h"
@ -53,8 +54,6 @@
#include "jpeglsdec.h" #include "jpeglsdec.h"
#include "profiles.h" #include "profiles.h"
#include "put_bits.h" #include "put_bits.h"
#include "exif_internal.h"
#include "bytestream.h"
static int init_default_huffman_tables(MJpegDecodeContext *s) static int init_default_huffman_tables(MJpegDecodeContext *s)
@ -2924,7 +2923,7 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx)
return 0; return 0;
} }
static void decode_flush(AVCodecContext *avctx) static av_cold void decode_flush(AVCodecContext *avctx)
{ {
MJpegDecodeContext *s = avctx->priv_data; MJpegDecodeContext *s = avctx->priv_data;
s->got_picture = 0; s->got_picture = 0;

View file

@ -29,6 +29,7 @@
#include <stdint.h> #include <stdint.h>
#include "avcodec.h" #include "avcodec.h"
#include "libavutil/attributes.h"
#include "libavutil/internal.h" #include "libavutil/internal.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
@ -1413,7 +1414,7 @@ error:
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
static void mlp_decode_flush(AVCodecContext *avctx) static av_cold void mlp_decode_flush(AVCodecContext *avctx)
{ {
MLPDecodeContext *m = avctx->priv_data; MLPDecodeContext *m = avctx->priv_data;

View file

@ -23,6 +23,7 @@
#include <inttypes.h> #include <inttypes.h>
#include "libavutil/attributes.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "libavutil/thread.h" #include "libavutil/thread.h"
@ -1315,7 +1316,7 @@ static int mobiclip_decode(AVCodecContext *avctx, AVFrame *rframe,
return 0; return 0;
} }
static void mobiclip_flush(AVCodecContext *avctx) static av_cold void mobiclip_flush(AVCodecContext *avctx)
{ {
MobiClipContext *s = avctx->priv_data; MobiClipContext *s = avctx->priv_data;

View file

@ -21,6 +21,7 @@
#include <stdarg.h> #include <stdarg.h>
#include "avcodec.h" #include "avcodec.h"
#include "libavutil/attributes.h"
#include "libavutil/opt.h" #include "libavutil/opt.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
@ -162,7 +163,7 @@ static const Box box_types[] = {
const static size_t box_count = FF_ARRAY_ELEMS(box_types); const static size_t box_count = FF_ARRAY_ELEMS(box_types);
static int mov_text_encode_close(AVCodecContext *avctx) static av_cold int mov_text_encode_close(AVCodecContext *avctx)
{ {
MovTextContext *s = avctx->priv_data; MovTextContext *s = avctx->priv_data;

View file

@ -25,6 +25,7 @@
* divided into 32 subbands. * divided into 32 subbands.
*/ */
#include "libavutil/attributes.h"
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
#include "libavutil/internal.h" #include "libavutil/internal.h"
#include "libavutil/lfg.h" #include "libavutil/lfg.h"
@ -296,7 +297,7 @@ static int mpc7_decode_frame(AVCodecContext *avctx, AVFrame *frame,
return avpkt->size; return avpkt->size;
} }
static void mpc7_decode_flush(AVCodecContext *avctx) static av_cold void mpc7_decode_flush(AVCodecContext *avctx)
{ {
MPCContext *c = avctx->priv_data; MPCContext *c = avctx->priv_data;

View file

@ -293,7 +293,7 @@ static int mpegvideo_parse(AVCodecParserContext *s,
return next; return next;
} }
static int mpegvideo_parse_init(AVCodecParserContext *s) static av_cold int mpegvideo_parse_init(AVCodecParserContext *s)
{ {
s->pict_type = AV_PICTURE_TYPE_NONE; // first frame might be partial s->pict_type = AV_PICTURE_TYPE_NONE; // first frame might be partial
return 0; return 0;

View file

@ -34,6 +34,7 @@
#include "codec_internal.h" #include "codec_internal.h"
#include "decode.h" #include "decode.h"
#include "msrledec.h" #include "msrledec.h"
#include "libavutil/attributes.h"
#include "libavutil/imgutils.h" #include "libavutil/imgutils.h"
typedef struct MsrleContext { typedef struct MsrleContext {
@ -138,7 +139,7 @@ static int msrle_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
return buf_size; return buf_size;
} }
static void msrle_decode_flush(AVCodecContext *avctx) static av_cold void msrle_decode_flush(AVCodecContext *avctx)
{ {
MsrleContext *s = avctx->priv_data; MsrleContext *s = avctx->priv_data;

View file

@ -30,6 +30,8 @@
#include "codec_internal.h" #include "codec_internal.h"
#include "encode.h" #include "encode.h"
#include "libavutil/attributes.h"
typedef struct MSRLEContext { typedef struct MSRLEContext {
int curframe; int curframe;
AVFrame *last_frame; AVFrame *last_frame;
@ -276,7 +278,7 @@ static int msrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
return av_frame_replace(s->last_frame, pict); return av_frame_replace(s->last_frame, pict);
} }
static int msrle_encode_close(AVCodecContext *avctx) static av_cold int msrle_encode_close(AVCodecContext *avctx)
{ {
MSRLEContext *s = avctx->priv_data; MSRLEContext *s = avctx->priv_data;
av_frame_free(&s->last_frame); av_frame_free(&s->last_frame);

View file

@ -23,6 +23,7 @@
#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>
#include "libavutil/attributes.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "libavutil/thread.h" #include "libavutil/thread.h"
@ -682,7 +683,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
return 0; return 0;
} }
static void decode_flush(AVCodecContext *avctx) static av_cold void decode_flush(AVCodecContext *avctx)
{ {
MV30Context *s = avctx->priv_data; MV30Context *s = avctx->priv_data;

View file

@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "libavutil/attributes.h"
#include "libavutil/internal.h" #include "libavutil/internal.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
@ -62,7 +63,7 @@ typedef struct OSQContext {
int pkt_offset; int pkt_offset;
} OSQContext; } OSQContext;
static void osq_flush(AVCodecContext *avctx) static av_cold void osq_flush(AVCodecContext *avctx)
{ {
OSQContext *s = avctx->priv_data; OSQContext *s = avctx->priv_data;

View file

@ -24,12 +24,13 @@
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include "libavutil/attributes.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "parser.h" #include "parser.h"
AVCodecParserContext *av_parser_init(int codec_id) av_cold AVCodecParserContext *av_parser_init(int codec_id)
{ {
AVCodecParserContext *s = NULL; AVCodecParserContext *s = NULL;
const AVCodecParser *parser; const AVCodecParser *parser;
@ -190,7 +191,7 @@ int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx,
return index; return index;
} }
void av_parser_close(AVCodecParserContext *s) av_cold void av_parser_close(AVCodecParserContext *s)
{ {
if (s) { if (s) {
if (s->parser->parser_close) if (s->parser->parser_close)
@ -287,7 +288,7 @@ int ff_combine_frame(ParseContext *pc, int next,
return 0; return 0;
} }
void ff_parse_close(AVCodecParserContext *s) av_cold void ff_parse_close(AVCodecParserContext *s)
{ {
ParseContext *pc = s->priv_data; ParseContext *pc = s->priv_data;

View file

@ -25,6 +25,8 @@
#include "decode.h" #include "decode.h"
#include "zlib_wrapper.h" #include "zlib_wrapper.h"
#include "libavutil/attributes.h"
#include <zlib.h> #include <zlib.h>
typedef struct PDVContext { typedef struct PDVContext {
@ -117,7 +119,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
return avpkt->size; return avpkt->size;
} }
static void decode_flush(AVCodecContext *avctx) static av_cold void decode_flush(AVCodecContext *avctx)
{ {
PDVContext *s = avctx->priv_data; PDVContext *s = avctx->priv_data;

View file

@ -29,6 +29,8 @@
#include "codec_internal.h" #include "codec_internal.h"
#include "decode.h" #include "decode.h"
#include "libavutil/attributes.h"
typedef struct QpegContext{ typedef struct QpegContext{
AVCodecContext *avctx; AVCodecContext *avctx;
AVFrame *ref; AVFrame *ref;
@ -314,7 +316,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p,
return avpkt->size; return avpkt->size;
} }
static void decode_flush(AVCodecContext *avctx){ static av_cold void decode_flush(AVCodecContext *avctx)
{
QpegContext * const a = avctx->priv_data; QpegContext * const a = avctx->priv_data;
int i, pal_size; int i, pal_size;
const uint8_t *pal_src; const uint8_t *pal_src;

View file

@ -38,6 +38,8 @@
#include "bytestream.h" #include "bytestream.h"
#include "codec_internal.h" #include "codec_internal.h"
#include "libavutil/attributes.h"
typedef struct QtrleContext { typedef struct QtrleContext {
AVCodecContext *avctx; AVCodecContext *avctx;
AVFrame *frame; AVFrame *frame;
@ -561,7 +563,7 @@ done:
return avpkt->size; return avpkt->size;
} }
static void qtrle_decode_flush(AVCodecContext *avctx) static av_cold void qtrle_decode_flush(AVCodecContext *avctx)
{ {
QtrleContext *s = avctx->priv_data; QtrleContext *s = avctx->priv_data;

View file

@ -503,7 +503,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
return avpkt->size; return avpkt->size;
} }
static void decode_flush(AVCodecContext *avctx) static av_cold void decode_flush(AVCodecContext *avctx)
{ {
RALFContext *ctx = avctx->priv_data; RALFContext *ctx = avctx->priv_data;

View file

@ -18,6 +18,8 @@
* License along with FFmpeg; if not, write to the Free Software * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "libavutil/attributes.h"
#include "libavutil/common.h" #include "libavutil/common.h"
#include "get_bits.h" #include "get_bits.h"
#include "rtjpeg.h" #include "rtjpeg.h"
@ -167,7 +169,7 @@ void ff_rtjpeg_decode_init(RTJpegContext *c, int width, int height,
c->h = height; c->h = height;
} }
void ff_rtjpeg_init(RTJpegContext *c, struct AVCodecContext *avctx) av_cold void ff_rtjpeg_init(RTJpegContext *c, struct AVCodecContext *avctx)
{ {
int i; int i;

View file

@ -33,6 +33,8 @@
#include "unary.h" #include "unary.h"
#include "videodsp.h" #include "videodsp.h"
#include "libavutil/attributes.h"
static const int8_t frame_types[4] = {AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, AV_PICTURE_TYPE_NONE}; static const int8_t frame_types[4] = {AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, AV_PICTURE_TYPE_NONE};
enum CUType { enum CUType {
@ -2396,7 +2398,7 @@ static int rv60_decode_frame(AVCodecContext *avctx, AVFrame * frame,
return avpkt->size; return avpkt->size;
} }
static void rv60_flush(AVCodecContext *avctx) static av_cold void rv60_flush(AVCodecContext *avctx)
{ {
RV60Context *s = avctx->priv_data; RV60Context *s = avctx->priv_data;

View file

@ -25,6 +25,7 @@
*/ */
#include "ass.h" #include "ass.h"
#include "libavutil/attributes.h"
#include "libavutil/avstring.h" #include "libavutil/avstring.h"
#include "libavutil/bprint.h" #include "libavutil/bprint.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
@ -174,7 +175,7 @@ static av_cold int sami_close(AVCodecContext *avctx)
return 0; return 0;
} }
static void sami_flush(AVCodecContext *avctx) static av_cold void sami_flush(AVCodecContext *avctx)
{ {
SAMIContext *sami = avctx->priv_data; SAMIContext *sami = avctx->priv_data;
if (!(avctx->flags2 & AV_CODEC_FLAG2_RO_FLUSH_NOOP)) if (!(avctx->flags2 & AV_CODEC_FLAG2_RO_FLUSH_NOOP))

View file

@ -275,7 +275,7 @@ static int text_encode_frame(AVCodecContext *avctx,
return encode_frame(avctx, buf, bufsize, sub, &text_callbacks); return encode_frame(avctx, buf, bufsize, sub, &text_callbacks);
} }
static int srt_encode_close(AVCodecContext *avctx) static av_cold int srt_encode_close(AVCodecContext *avctx)
{ {
SRTContext *s = avctx->priv_data; SRTContext *s = avctx->priv_data;
ff_ass_split_free(s->ass_ctx); ff_ass_split_free(s->ass_ctx);

View file

@ -32,6 +32,7 @@
* http://www.pcisys.net/~melanson/codecs/ * http://www.pcisys.net/~melanson/codecs/
*/ */
#include "libavutil/attributes.h"
#include "libavutil/crc.h" #include "libavutil/crc.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "libavutil/thread.h" #include "libavutil/thread.h"
@ -846,7 +847,7 @@ static av_cold int svq1_decode_end(AVCodecContext *avctx)
return 0; return 0;
} }
static void svq1_flush(AVCodecContext *avctx) static av_cold void svq1_flush(AVCodecContext *avctx)
{ {
SVQ1Context *s = avctx->priv_data; SVQ1Context *s = avctx->priv_data;

View file

@ -28,6 +28,7 @@
#include "avcodec.h" #include "avcodec.h"
#include "ass.h" #include "ass.h"
#include "codec_internal.h" #include "codec_internal.h"
#include "libavutil/attributes.h"
#include "libavutil/bprint.h" #include "libavutil/bprint.h"
#include "libavutil/opt.h" #include "libavutil/opt.h"
@ -65,7 +66,7 @@ static int text_decode_frame(AVCodecContext *avctx, AVSubtitle *sub,
return avpkt->size; return avpkt->size;
} }
static void text_flush(AVCodecContext *avctx) static av_cold void text_flush(AVCodecContext *avctx)
{ {
TextContext *text = avctx->priv_data; TextContext *text = avctx->priv_data;
if (!(avctx->flags2 & AV_CODEC_FLAG2_RO_FLUSH_NOOP)) if (!(avctx->flags2 & AV_CODEC_FLAG2_RO_FLUSH_NOOP))

View file

@ -134,7 +134,7 @@ done:
return ret; return ret;
} }
static int v4l2_configure_contexts(V4L2m2mContext *s) static av_cold int v4l2_configure_contexts(V4L2m2mContext *s)
{ {
void *log_ctx = s->avctx; void *log_ctx = s->avctx;
int ret; int ret;
@ -261,7 +261,7 @@ static void v4l2_m2m_destroy_context(AVRefStructOpaque unused, void *context)
av_packet_unref(&s->buf_pkt); av_packet_unref(&s->buf_pkt);
} }
int ff_v4l2_m2m_codec_end(V4L2m2mPriv *priv) av_cold int ff_v4l2_m2m_codec_end(V4L2m2mPriv *priv)
{ {
V4L2m2mContext *s = priv->context; V4L2m2mContext *s = priv->context;
int ret; int ret;
@ -287,7 +287,7 @@ int ff_v4l2_m2m_codec_end(V4L2m2mPriv *priv)
return 0; return 0;
} }
int ff_v4l2_m2m_codec_init(V4L2m2mPriv *priv) av_cold int ff_v4l2_m2m_codec_init(V4L2m2mPriv *priv)
{ {
int ret = AVERROR(EINVAL); int ret = AVERROR(EINVAL);
struct dirent *entry; struct dirent *entry;

View file

@ -336,7 +336,7 @@ static int vc1_decode_sprites(VC1Context *v, GetBitContext* gb)
return 0; return 0;
} }
static void vc1_sprite_flush(AVCodecContext *avctx) static av_cold void vc1_sprite_flush(AVCodecContext *avctx)
{ {
VC1Context *v = avctx->priv_data; VC1Context *v = avctx->priv_data;
MpegEncContext *s = &v->s; MpegEncContext *s = &v->s;

View file

@ -329,7 +329,7 @@ end:
return buf_size; return buf_size;
} }
static void vorbis_parser_close(AVCodecParserContext *ctx) static av_cold void vorbis_parser_close(AVCodecParserContext *ctx)
{ {
VorbisParseContext *s = ctx->priv_data; VorbisParseContext *s = ctx->priv_data;
av_vorbis_parse_free(&s->vp); av_vorbis_parse_free(&s->vp);

View file

@ -35,6 +35,7 @@
#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>
#include "libavutil/attributes.h"
#include "libavutil/emms.h" #include "libavutil/emms.h"
#include "libavutil/imgutils.h" #include "libavutil/imgutils.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
@ -349,7 +350,7 @@ static av_cold void free_tables(AVCodecContext *avctx)
av_freep(&s->motion_val[1]); av_freep(&s->motion_val[1]);
} }
static void vp3_decode_flush(AVCodecContext *avctx) static av_cold void vp3_decode_flush(AVCodecContext *avctx)
{ {
Vp3DecodeContext *s = avctx->priv_data; Vp3DecodeContext *s = avctx->priv_data;

View file

@ -41,6 +41,7 @@
#include "vp9data.h" #include "vp9data.h"
#include "vp9dec.h" #include "vp9dec.h"
#include "vpx_rac.h" #include "vpx_rac.h"
#include "libavutil/attributes.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "libavutil/pixdesc.h" #include "libavutil/pixdesc.h"
@ -1822,7 +1823,7 @@ fail:
return ret; return ret;
} }
static void vp9_decode_flush(AVCodecContext *avctx) static av_cold void vp9_decode_flush(AVCodecContext *avctx)
{ {
VP9Context *s = avctx->priv_data; VP9Context *s = avctx->priv_data;
int i; int i;

View file

@ -684,7 +684,7 @@ static int task_run(FFTask *_t, void *local_context, void *user_data)
return 0; return 0;
} }
FFExecutor* ff_vvc_executor_alloc(VVCContext *s, const int thread_count) av_cold FFExecutor* ff_vvc_executor_alloc(VVCContext *s, const int thread_count)
{ {
FFTaskCallbacks callbacks = { FFTaskCallbacks callbacks = {
s, s,
@ -695,7 +695,7 @@ FFExecutor* ff_vvc_executor_alloc(VVCContext *s, const int thread_count)
return ff_executor_alloc(&callbacks, thread_count); return ff_executor_alloc(&callbacks, thread_count);
} }
void ff_vvc_executor_free(FFExecutor **e) av_cold void ff_vvc_executor_free(FFExecutor **e)
{ {
ff_executor_free(e); ff_executor_free(e);
} }

View file

@ -1611,7 +1611,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, AVFrame *frame, int block
return 0; return 0;
} }
static void wavpack_decode_flush(AVCodecContext *avctx) static av_cold void wavpack_decode_flush(AVCodecContext *avctx)
{ {
WavpackContext *s = avctx->priv_data; WavpackContext *s = avctx->priv_data;

View file

@ -187,7 +187,7 @@ static int webvtt_encode_frame(AVCodecContext *avctx,
return s->buffer.len; return s->buffer.len;
} }
static int webvtt_encode_close(AVCodecContext *avctx) static av_cold int webvtt_encode_close(AVCodecContext *avctx)
{ {
WebVTTContext *s = avctx->priv_data; WebVTTContext *s = avctx->priv_data;
ff_ass_split_free(s->ass_ctx); ff_ass_split_free(s->ass_ctx);

View file

@ -1302,7 +1302,7 @@ static int decode_packet(AVCodecContext *avctx, AVFrame *rframe,
return (s->packet_loss) ? AVERROR_INVALIDDATA : get_bits_count(gb) >> 3; return (s->packet_loss) ? AVERROR_INVALIDDATA : get_bits_count(gb) >> 3;
} }
static void flush(AVCodecContext *avctx) static av_cold void flush(AVCodecContext *avctx)
{ {
WmallDecodeCtx *s = avctx->priv_data; WmallDecodeCtx *s = avctx->priv_data;
s->packet_loss = 1; s->packet_loss = 1;

View file

@ -88,6 +88,7 @@
#include <inttypes.h> #include <inttypes.h>
#include "libavutil/attributes.h"
#include "libavutil/audio_fifo.h" #include "libavutil/audio_fifo.h"
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "libavutil/tx.h" #include "libavutil/tx.h"
@ -2040,7 +2041,7 @@ static av_cold int xma_decode_end(AVCodecContext *avctx)
return 0; return 0;
} }
static void flush(WMAProDecodeCtx *s) static av_cold void flush(WMAProDecodeCtx *s)
{ {
int i; int i;
/** reset output buffer as a part of it is used during the windowing of a /** reset output buffer as a part of it is used during the windowing of a
@ -2058,14 +2059,14 @@ static void flush(WMAProDecodeCtx *s)
*@brief Clear decoder buffers (for seeking). *@brief Clear decoder buffers (for seeking).
*@param avctx codec context *@param avctx codec context
*/ */
static void wmapro_flush(AVCodecContext *avctx) static av_cold void wmapro_flush(AVCodecContext *avctx)
{ {
WMAProDecodeCtx *s = avctx->priv_data; WMAProDecodeCtx *s = avctx->priv_data;
flush(s); flush(s);
} }
static void xma_flush(AVCodecContext *avctx) static av_cold void xma_flush(AVCodecContext *avctx)
{ {
XMADecodeCtx *s = avctx->priv_data; XMADecodeCtx *s = avctx->priv_data;
int i; int i;

View file

@ -24,7 +24,10 @@
* XBM parser * XBM parser
*/ */
#include "libavutil/common.h" #include <stdint.h>
#include "libavutil/attributes.h"
#include "libavutil/avutil.h"
#include "parser.h" #include "parser.h"
@ -41,7 +44,7 @@ typedef struct XBMParseContext {
#define END ((';' << 8) | ('\n' << 0)) #define END ((';' << 8) | ('\n' << 0))
static int xbm_init(AVCodecParserContext *s) static av_cold int xbm_init(AVCodecParserContext *s)
{ {
XBMParseContext *bpc = s->priv_data; XBMParseContext *bpc = s->priv_data;

View file

@ -22,6 +22,7 @@
#include "codec_internal.h" #include "codec_internal.h"
#include "decode.h" #include "decode.h"
#include "zlib_wrapper.h" #include "zlib_wrapper.h"
#include "libavutil/attributes.h"
#include "libavutil/common.h" #include "libavutil/common.h"
typedef struct ZeroCodecContext { typedef struct ZeroCodecContext {
@ -126,7 +127,7 @@ static av_cold int zerocodec_decode_init(AVCodecContext *avctx)
return ff_inflate_init(&zc->zstream, avctx); return ff_inflate_init(&zc->zstream, avctx);
} }
static void zerocodec_decode_flush(AVCodecContext *avctx) static av_cold void zerocodec_decode_flush(AVCodecContext *avctx)
{ {
ZeroCodecContext *zc = avctx->priv_data; ZeroCodecContext *zc = avctx->priv_data;