Commit 98a6fff9 authored by Zuxy Meng's avatar Zuxy Meng
Browse files

Apply 'cold' attribute to init/uninit functions in libavcodec

Originally committed as revision 12525 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 77ab59eb
......@@ -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++){
......@@ -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) {
......@@ -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;
......
......@@ -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;
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......@@ -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;
......
......@@ -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 */
......
......@@ -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;
......
......@@ -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;
......@@ -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;
......@@ -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);
......
......@@ -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;
......@@ -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;
......
......@@ -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;
......
......@@ -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 =) */
......@@ -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);
......
......@@ -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;
......@@ -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;
......
......@@ -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;
......@@ -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;
......
......@@ -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) {
......@@ -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);
......@@ -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;
......@@ -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;
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......@@ -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])
......
......@@ -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);
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......@@ -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);
......
......@@ -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;
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment