Skip to content

Commit

Permalink
Apply 'cold' attribute to init/uninit functions in libavcodec
Browse files Browse the repository at this point in the history
Originally committed as revision 12525 to svn://svn.ffmpeg.org/ffmpeg/trunk
  • Loading branch information
zuxy committed Mar 21, 2008
1 parent 77ab59e commit 98a6fff
Show file tree
Hide file tree
Showing 145 changed files with 296 additions and 288 deletions.
6 changes: 3 additions & 3 deletions libavcodec/4xm.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ static void idct(DCTELEM block[64]){
}
}

static void init_vlcs(FourXContext *f){
static av_cold void init_vlcs(FourXContext *f){
int i;

for(i=0; i<8; i++){
Expand Down Expand Up @@ -792,7 +792,7 @@ static void common_init(AVCodecContext *avctx){
f->avctx= avctx;
}

static int decode_init(AVCodecContext *avctx){
static av_cold int decode_init(AVCodecContext *avctx){
FourXContext * const f = avctx->priv_data;

if(avctx->extradata_size != 4 || !avctx->extradata) {
Expand All @@ -811,7 +811,7 @@ static int decode_init(AVCodecContext *avctx){
}


static int decode_end(AVCodecContext *avctx){
static av_cold int decode_end(AVCodecContext *avctx){
FourXContext * const f = avctx->priv_data;
int i;

Expand Down
4 changes: 2 additions & 2 deletions libavcodec/8bps.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const
* Init 8BPS decoder
*
*/
static int decode_init(AVCodecContext *avctx)
static av_cold int decode_init(AVCodecContext *avctx)
{
EightBpsContext * const c = avctx->priv_data;

Expand Down Expand Up @@ -208,7 +208,7 @@ static int decode_init(AVCodecContext *avctx)
* Uninit 8BPS decoder
*
*/
static int decode_end(AVCodecContext *avctx)
static av_cold int decode_end(AVCodecContext *avctx)
{
EightBpsContext * const c = avctx->priv_data;

Expand Down
2 changes: 1 addition & 1 deletion libavcodec/aac_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static int aac_sync(const uint8_t *buf, int *channels, int *sample_rate,
return size;
}

static int aac_parse_init(AVCodecParserContext *s1)
static av_cold int aac_parse_init(AVCodecParserContext *s1)
{
AACAC3ParseContext *s = s1->priv_data;
s->inbuf_ptr = s->inbuf;
Expand Down
4 changes: 2 additions & 2 deletions libavcodec/aasc.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ typedef struct AascContext {
} \
stream_byte = buf[stream_ptr++];

static int aasc_decode_init(AVCodecContext *avctx)
static av_cold int aasc_decode_init(AVCodecContext *avctx)
{
AascContext *s = avctx->priv_data;

Expand Down Expand Up @@ -150,7 +150,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
return buf_size;
}

static int aasc_decode_end(AVCodecContext *avctx)
static av_cold int aasc_decode_end(AVCodecContext *avctx)
{
AascContext *s = avctx->priv_data;

Expand Down
2 changes: 1 addition & 1 deletion libavcodec/ac3.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, uint8_t *bap,
* note: This function must remain thread safe because it is called by the
* AVParser init code.
*/
void ac3_common_init(void)
av_cold void ac3_common_init(void)
{
int i, j, k, l, v;
/* compute bndtab and masktab from bandsz */
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/ac3_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ static int ac3_sync(const uint8_t *buf, int *channels, int *sample_rate,
return hdr.frame_size;
}

static int ac3_parse_init(AVCodecParserContext *s1)
static av_cold int ac3_parse_init(AVCodecParserContext *s1)
{
AACAC3ParseContext *s = s1->priv_data;
s->inbuf_ptr = s->inbuf;
Expand Down
6 changes: 3 additions & 3 deletions libavcodec/ac3dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ symmetric_dequant(int code, int levels)
/*
* Initialize tables at runtime.
*/
static void ac3_tables_init(void)
static av_cold void ac3_tables_init(void)
{
int i;

Expand Down Expand Up @@ -260,7 +260,7 @@ static void ac3_tables_init(void)
/**
* AVCodec initialization
*/
static int ac3_decode_init(AVCodecContext *avctx)
static av_cold int ac3_decode_init(AVCodecContext *avctx)
{
AC3DecodeContext *s = avctx->priv_data;
s->avctx = avctx;
Expand Down Expand Up @@ -1209,7 +1209,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
/**
* Uninitialize the AC-3 decoder.
*/
static int ac3_decode_end(AVCodecContext *avctx)
static av_cold int ac3_decode_end(AVCodecContext *avctx)
{
AC3DecodeContext *s = avctx->priv_data;
ff_mdct_end(&s->imdct_512);
Expand Down
4 changes: 2 additions & 2 deletions libavcodec/ac3enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ static int compute_bit_allocation(AC3EncodeContext *s,
return 0;
}

static int AC3_encode_init(AVCodecContext *avctx)
static av_cold int AC3_encode_init(AVCodecContext *avctx)
{
int freq = avctx->sample_rate;
int bitrate = avctx->bit_rate;
Expand Down Expand Up @@ -1255,7 +1255,7 @@ static int AC3_encode_frame(AVCodecContext *avctx,
return output_frame_end(s);
}

static int AC3_encode_close(AVCodecContext *avctx)
static av_cold int AC3_encode_close(AVCodecContext *avctx)
{
av_freep(&avctx->coded_frame);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/adpcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx,
}
#endif //CONFIG_ENCODERS

static int adpcm_decode_init(AVCodecContext * avctx)
static av_cold int adpcm_decode_init(AVCodecContext * avctx)
{
ADPCMContext *c = avctx->priv_data;
unsigned int max_channels = 2;
Expand Down
4 changes: 2 additions & 2 deletions libavcodec/adxenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static int adx_encode_header(AVCodecContext *avctx,unsigned char *buf,size_t buf
return 0x20+4;
}

static int adx_encode_init(AVCodecContext *avctx)
static av_cold int adx_encode_init(AVCodecContext *avctx)
{
if (avctx->channels > 2)
return -1; /* only stereo or mono =) */
Expand All @@ -126,7 +126,7 @@ static int adx_encode_init(AVCodecContext *avctx)
return 0;
}

static int adx_encode_close(AVCodecContext *avctx)
static av_cold int adx_encode_close(AVCodecContext *avctx)
{
av_freep(&avctx->coded_frame);

Expand Down
4 changes: 2 additions & 2 deletions libavcodec/alac.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ static int alac_decode_frame(AVCodecContext *avctx,
return input_buffer_size;
}

static int alac_decode_init(AVCodecContext * avctx)
static av_cold int alac_decode_init(AVCodecContext * avctx)
{
ALACContext *alac = avctx->priv_data;
alac->avctx = avctx;
Expand All @@ -637,7 +637,7 @@ static int alac_decode_init(AVCodecContext * avctx)
return 0;
}

static int alac_decode_close(AVCodecContext *avctx)
static av_cold int alac_decode_close(AVCodecContext *avctx)
{
ALACContext *alac = avctx->priv_data;

Expand Down
4 changes: 2 additions & 2 deletions libavcodec/apedec.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static inline int32_t scalarproduct(int16_t * v1, int16_t * v2, int order)
return res;
}

static int ape_decode_init(AVCodecContext * avctx)
static av_cold int ape_decode_init(AVCodecContext * avctx)
{
APEContext *s = avctx->priv_data;
int i;
Expand Down Expand Up @@ -224,7 +224,7 @@ static int ape_decode_init(AVCodecContext * avctx)
return 0;
}

static int ape_decode_close(AVCodecContext * avctx)
static av_cold int ape_decode_close(AVCodecContext * avctx)
{
APEContext *s = avctx->priv_data;
int i;
Expand Down
10 changes: 5 additions & 5 deletions libavcodec/asv1.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static VLC dc_ccp_vlc;
static VLC ac_ccp_vlc;
static VLC asv2_level_vlc;

static void init_vlcs(ASV1Context *a){
static av_cold void init_vlcs(ASV1Context *a){
static int done = 0;

if (!done) {
Expand Down Expand Up @@ -521,7 +521,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
}
#endif /* CONFIG_ENCODERS */

static void common_init(AVCodecContext *avctx){
static av_cold void common_init(AVCodecContext *avctx){
ASV1Context * const a = avctx->priv_data;

dsputil_init(&a->dsp, avctx);
Expand All @@ -535,7 +535,7 @@ static void common_init(AVCodecContext *avctx){
a->avctx= avctx;
}

static int decode_init(AVCodecContext *avctx){
static av_cold int decode_init(AVCodecContext *avctx){
ASV1Context * const a = avctx->priv_data;
AVFrame *p= (AVFrame*)&a->picture;
int i;
Expand Down Expand Up @@ -570,7 +570,7 @@ static int decode_init(AVCodecContext *avctx){
}

#ifdef CONFIG_ENCODERS
static int encode_init(AVCodecContext *avctx){
static av_cold int encode_init(AVCodecContext *avctx){
ASV1Context * const a = avctx->priv_data;
int i;
const int scale= avctx->codec_id == CODEC_ID_ASV1 ? 1 : 2;
Expand All @@ -595,7 +595,7 @@ static int encode_init(AVCodecContext *avctx){
}
#endif

static int decode_end(AVCodecContext *avctx){
static av_cold int decode_end(AVCodecContext *avctx){
ASV1Context * const a = avctx->priv_data;

av_freep(&a->bitstream_buffer);
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/avs.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ avs_decode_frame(AVCodecContext * avctx,
return buf_size;
}

static int avs_decode_init(AVCodecContext * avctx)
static av_cold int avs_decode_init(AVCodecContext * avctx)
{
avctx->pix_fmt = PIX_FMT_PAL8;
return 0;
Expand Down
4 changes: 2 additions & 2 deletions libavcodec/bethsoftvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ typedef struct BethsoftvidContext {
AVFrame frame;
} BethsoftvidContext;

static int bethsoftvid_decode_init(AVCodecContext *avctx)
static av_cold int bethsoftvid_decode_init(AVCodecContext *avctx)
{
BethsoftvidContext *vid = avctx->priv_data;
vid->frame.reference = 1;
Expand Down Expand Up @@ -120,7 +120,7 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx,
return buf_size;
}

static int bethsoftvid_decode_end(AVCodecContext *avctx)
static av_cold int bethsoftvid_decode_end(AVCodecContext *avctx)
{
BethsoftvidContext * vid = avctx->priv_data;
if(vid->frame.data[0])
Expand Down
4 changes: 2 additions & 2 deletions libavcodec/bmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "bytestream.h"
#include "bmp.h"

static int bmp_decode_init(AVCodecContext *avctx){
static av_cold int bmp_decode_init(AVCodecContext *avctx){
BMPContext *s = avctx->priv_data;

avcodec_get_frame_defaults((AVFrame*)&s->picture);
Expand Down Expand Up @@ -231,7 +231,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
return buf_size;
}

static int bmp_decode_end(AVCodecContext *avctx)
static av_cold int bmp_decode_end(AVCodecContext *avctx)
{
BMPContext* c = avctx->priv_data;

Expand Down
2 changes: 1 addition & 1 deletion libavcodec/bmpenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "bytestream.h"
#include "bmp.h"

static int bmp_encode_init(AVCodecContext *avctx){
static av_cold int bmp_encode_init(AVCodecContext *avctx){
BMPContext *s = avctx->priv_data;

avcodec_get_frame_defaults((AVFrame*)&s->picture);
Expand Down
4 changes: 2 additions & 2 deletions libavcodec/c93.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ typedef enum {
#define C93_HAS_PALETTE 0x01
#define C93_FIRST_FRAME 0x02

static int decode_init(AVCodecContext *avctx)
static av_cold int decode_init(AVCodecContext *avctx)
{
avctx->pix_fmt = PIX_FMT_PAL8;
return 0;
}

static int decode_end(AVCodecContext *avctx)
static av_cold int decode_end(AVCodecContext *avctx)
{
C93DecoderContext * const c93 = avctx->priv_data;

Expand Down
4 changes: 2 additions & 2 deletions libavcodec/cavs.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ void ff_cavs_init_top_lines(AVSContext *h) {
h->block = av_mallocz(64*sizeof(DCTELEM));
}

int ff_cavs_init(AVCodecContext *avctx) {
av_cold int ff_cavs_init(AVCodecContext *avctx) {
AVSContext *h = avctx->priv_data;
MpegEncContext * const s = &h->s;

Expand Down Expand Up @@ -699,7 +699,7 @@ int ff_cavs_init(AVCodecContext *avctx) {
return 0;
}

int ff_cavs_end(AVCodecContext *avctx) {
av_cold int ff_cavs_end(AVCodecContext *avctx) {
AVSContext *h = avctx->priv_data;

av_free(h->top_qp);
Expand Down
4 changes: 2 additions & 2 deletions libavcodec/cinepak.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ static int cinepak_decode (CinepakContext *s)
return 0;
}

static int cinepak_decode_init(AVCodecContext *avctx)
static av_cold int cinepak_decode_init(AVCodecContext *avctx)
{
CinepakContext *s = avctx->priv_data;

Expand Down Expand Up @@ -443,7 +443,7 @@ static int cinepak_decode_frame(AVCodecContext *avctx,
return buf_size;
}

static int cinepak_decode_end(AVCodecContext *avctx)
static av_cold int cinepak_decode_end(AVCodecContext *avctx)
{
CinepakContext *s = avctx->priv_data;

Expand Down
6 changes: 3 additions & 3 deletions libavcodec/cljr.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
}
#endif

static void common_init(AVCodecContext *avctx){
static av_cold void common_init(AVCodecContext *avctx){
CLJRContext * const a = avctx->priv_data;

avctx->coded_frame= (AVFrame*)&a->picture;
a->avctx= avctx;
}

static int decode_init(AVCodecContext *avctx){
static av_cold int decode_init(AVCodecContext *avctx){

common_init(avctx);

Expand All @@ -122,7 +122,7 @@ static int decode_init(AVCodecContext *avctx){
}

#if 0
static int encode_init(AVCodecContext *avctx){
static av_cold int encode_init(AVCodecContext *avctx){

common_init(avctx);

Expand Down
4 changes: 2 additions & 2 deletions libavcodec/cscd.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
return buf_size;
}

static int decode_init(AVCodecContext *avctx) {
static av_cold int decode_init(AVCodecContext *avctx) {
CamStudioContext *c = avctx->priv_data;
if (avcodec_check_dimensions(avctx, avctx->height, avctx->width) < 0) {
return 1;
Expand Down Expand Up @@ -240,7 +240,7 @@ static int decode_init(AVCodecContext *avctx) {
return 0;
}

static int decode_end(AVCodecContext *avctx) {
static av_cold int decode_end(AVCodecContext *avctx) {
CamStudioContext *c = avctx->priv_data;
av_freep(&c->decomp_buf);
if (c->pic.data[0])
Expand Down
Loading

0 comments on commit 98a6fff

Please sign in to comment.