Patch by Daniel Verkamp daniel at drv dot nu. Originally committed as revision 17526 to svn://svn.ffmpeg.org/ffmpeg/trunktags/v0.5
| @@ -785,7 +785,7 @@ static int decode_frame(AVCodecContext *avctx, | |||
| } | |||
| static void common_init(AVCodecContext *avctx){ | |||
| static av_cold void common_init(AVCodecContext *avctx){ | |||
| FourXContext * const f = avctx->priv_data; | |||
| dsputil_init(&f->dsp, avctx); | |||
| @@ -88,7 +88,7 @@ typedef struct IComplex { | |||
| short re,im; | |||
| } IComplex; | |||
| static void fft_init(int ln) | |||
| static av_cold void fft_init(int ln) | |||
| { | |||
| int i, n; | |||
| float alpha; | |||
| @@ -149,7 +149,7 @@ typedef struct ADPCMContext { | |||
| /* XXX: implement encoding */ | |||
| #if CONFIG_ENCODERS | |||
| static int adpcm_encode_init(AVCodecContext *avctx) | |||
| static av_cold int adpcm_encode_init(AVCodecContext *avctx) | |||
| { | |||
| if (avctx->channels > 2) | |||
| return -1; /* only stereo or mono =) */ | |||
| @@ -199,7 +199,7 @@ static int adpcm_encode_init(AVCodecContext *avctx) | |||
| return 0; | |||
| } | |||
| static int adpcm_encode_close(AVCodecContext *avctx) | |||
| static av_cold int adpcm_encode_close(AVCodecContext *avctx) | |||
| { | |||
| av_freep(&avctx->coded_frame); | |||
| @@ -244,7 +244,7 @@ static int decode_bytes(const uint8_t* inbuffer, uint8_t* out, int bytes){ | |||
| } | |||
| static void init_atrac3_transforms(ATRAC3Context *q) { | |||
| static av_cold void init_atrac3_transforms(ATRAC3Context *q) { | |||
| float enc_window[256]; | |||
| float s; | |||
| int i; | |||
| @@ -275,7 +275,7 @@ static void init_atrac3_transforms(ATRAC3Context *q) { | |||
| * Atrac3 uninit, free all allocated memory | |||
| */ | |||
| static int atrac3_decode_close(AVCodecContext *avctx) | |||
| static av_cold int atrac3_decode_close(AVCodecContext *avctx) | |||
| { | |||
| ATRAC3Context *q = avctx->priv_data; | |||
| @@ -926,7 +926,7 @@ static int atrac3_decode_frame(AVCodecContext *avctx, | |||
| * @param avctx pointer to the AVCodecContext | |||
| */ | |||
| static int atrac3_decode_init(AVCodecContext *avctx) | |||
| static av_cold int atrac3_decode_init(AVCodecContext *avctx) | |||
| { | |||
| int i; | |||
| const uint8_t *edata_ptr = avctx->extradata; | |||
| @@ -36,7 +36,7 @@ typedef struct BFIContext { | |||
| uint8_t *dst; | |||
| } BFIContext; | |||
| static int bfi_decode_init(AVCodecContext * avctx) | |||
| static av_cold int bfi_decode_init(AVCodecContext * avctx) | |||
| { | |||
| BFIContext *bfi = avctx->priv_data; | |||
| avctx->pix_fmt = PIX_FMT_PAL8; | |||
| @@ -161,7 +161,7 @@ static int bfi_decode_frame(AVCodecContext * avctx, void *data, | |||
| return buf_size; | |||
| } | |||
| static int bfi_decode_close(AVCodecContext * avctx) | |||
| static av_cold int bfi_decode_close(AVCodecContext * avctx) | |||
| { | |||
| BFIContext *bfi = avctx->priv_data; | |||
| if (bfi->frame.data[0]) | |||
| @@ -183,7 +183,7 @@ static void dump_short_table(short* table, int size, int delimiter) { | |||
| /*************** init functions ***************/ | |||
| /* table generator */ | |||
| static void init_pow2table(void){ | |||
| static av_cold void init_pow2table(void){ | |||
| int i; | |||
| for (i=-63 ; i<64 ; i++){ | |||
| pow2tab[63+i]= pow(2, i); | |||
| @@ -192,7 +192,7 @@ static void init_pow2table(void){ | |||
| } | |||
| /* table generator */ | |||
| static void init_gain_table(COOKContext *q) { | |||
| static av_cold void init_gain_table(COOKContext *q) { | |||
| int i; | |||
| q->gain_size_factor = q->samples_per_channel/8; | |||
| for (i=0 ; i<23 ; i++) { | |||
| @@ -202,7 +202,7 @@ static void init_gain_table(COOKContext *q) { | |||
| } | |||
| static int init_cook_vlc_tables(COOKContext *q) { | |||
| static av_cold int init_cook_vlc_tables(COOKContext *q) { | |||
| int i, result; | |||
| result = 0; | |||
| @@ -229,7 +229,7 @@ static int init_cook_vlc_tables(COOKContext *q) { | |||
| return result; | |||
| } | |||
| static int init_cook_mlt(COOKContext *q) { | |||
| static av_cold int init_cook_mlt(COOKContext *q) { | |||
| int j; | |||
| int mlt_size = q->samples_per_channel; | |||
| @@ -258,7 +258,7 @@ static const float *maybe_reformat_buffer32 (COOKContext *q, const float *ptr, i | |||
| return ptr; | |||
| } | |||
| static void init_cplscales_table (COOKContext *q) { | |||
| static av_cold void init_cplscales_table (COOKContext *q) { | |||
| int i; | |||
| for (i=0;i<5;i++) | |||
| q->cplscales[i] = maybe_reformat_buffer32 (q, cplscales[i], (1<<(i+2))-1); | |||
| @@ -314,7 +314,7 @@ static inline int decode_bytes(const uint8_t* inbuffer, uint8_t* out, int bytes) | |||
| * Cook uninit | |||
| */ | |||
| static int cook_decode_close(AVCodecContext *avctx) | |||
| static av_cold int cook_decode_close(AVCodecContext *avctx) | |||
| { | |||
| int i; | |||
| COOKContext *q = avctx->priv_data; | |||
| @@ -29,7 +29,7 @@ typedef struct DVDSubParseContext { | |||
| int packet_index; | |||
| } DVDSubParseContext; | |||
| static int dvdsub_parse_init(AVCodecParserContext *s) | |||
| static av_cold int dvdsub_parse_init(AVCodecParserContext *s) | |||
| { | |||
| return 0; | |||
| } | |||
| @@ -70,7 +70,7 @@ static int dvdsub_parse(AVCodecParserContext *s, | |||
| return buf_size; | |||
| } | |||
| static void dvdsub_parse_close(AVCodecParserContext *s) | |||
| static av_cold void dvdsub_parse_close(AVCodecParserContext *s) | |||
| { | |||
| DVDSubParseContext *pc = s->priv_data; | |||
| av_freep(&pc->packet); | |||
| @@ -431,7 +431,7 @@ static int read_old_huffman_tables(HYuvContext *s){ | |||
| #endif | |||
| } | |||
| static void alloc_temp(HYuvContext *s){ | |||
| static av_cold void alloc_temp(HYuvContext *s){ | |||
| int i; | |||
| if(s->bitstream_bpp<24){ | |||
| @@ -445,7 +445,7 @@ static void alloc_temp(HYuvContext *s){ | |||
| } | |||
| } | |||
| static int common_init(AVCodecContext *avctx){ | |||
| static av_cold int common_init(AVCodecContext *avctx){ | |||
| HYuvContext *s = avctx->priv_data; | |||
| s->avctx= avctx; | |||
| @@ -2170,7 +2170,7 @@ static uint8_t c_ccir_to_jpeg[256]; | |||
| static uint8_t c_jpeg_to_ccir[256]; | |||
| /* init various conversion tables */ | |||
| static void img_convert_init(void) | |||
| static av_cold void img_convert_init(void) | |||
| { | |||
| int i; | |||
| uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; | |||
| @@ -156,7 +156,7 @@ typedef struct AMRContext { | |||
| enum TXFrameType tx_frametype; | |||
| } AMRContext; | |||
| static int amr_nb_decode_init(AVCodecContext * avctx) | |||
| static av_cold int amr_nb_decode_init(AVCodecContext * avctx) | |||
| { | |||
| AMRContext *s = avctx->priv_data; | |||
| @@ -184,7 +184,7 @@ static int amr_nb_decode_init(AVCodecContext * avctx) | |||
| return 0; | |||
| } | |||
| static int amr_nb_encode_init(AVCodecContext * avctx) | |||
| static av_cold int amr_nb_encode_init(AVCodecContext * avctx) | |||
| { | |||
| AMRContext *s = avctx->priv_data; | |||
| @@ -225,7 +225,7 @@ static int amr_nb_encode_init(AVCodecContext * avctx) | |||
| return 0; | |||
| } | |||
| static int amr_nb_encode_close(AVCodecContext * avctx) | |||
| static av_cold int amr_nb_encode_close(AVCodecContext * avctx) | |||
| { | |||
| AMRContext *s = avctx->priv_data; | |||
| @@ -235,7 +235,7 @@ static int amr_nb_encode_close(AVCodecContext * avctx) | |||
| return 0; | |||
| } | |||
| static int amr_nb_decode_close(AVCodecContext * avctx) | |||
| static av_cold int amr_nb_decode_close(AVCodecContext * avctx) | |||
| { | |||
| AMRContext *s = avctx->priv_data; | |||
| @@ -362,7 +362,7 @@ typedef struct AMRContext { | |||
| int enc_bitrate; | |||
| } AMRContext; | |||
| static int amr_nb_decode_init(AVCodecContext * avctx) | |||
| static av_cold int amr_nb_decode_init(AVCodecContext * avctx) | |||
| { | |||
| AMRContext *s = avctx->priv_data; | |||
| @@ -385,7 +385,7 @@ static int amr_nb_decode_init(AVCodecContext * avctx) | |||
| return 0; | |||
| } | |||
| static int amr_nb_encode_init(AVCodecContext * avctx) | |||
| static av_cold int amr_nb_encode_init(AVCodecContext * avctx) | |||
| { | |||
| AMRContext *s = avctx->priv_data; | |||
| @@ -422,7 +422,7 @@ static int amr_nb_encode_init(AVCodecContext * avctx) | |||
| return 0; | |||
| } | |||
| static int amr_nb_decode_close(AVCodecContext * avctx) | |||
| static av_cold int amr_nb_decode_close(AVCodecContext * avctx) | |||
| { | |||
| AMRContext *s = avctx->priv_data; | |||
| @@ -430,7 +430,7 @@ static int amr_nb_decode_close(AVCodecContext * avctx) | |||
| return 0; | |||
| } | |||
| static int amr_nb_encode_close(AVCodecContext * avctx) | |||
| static av_cold int amr_nb_encode_close(AVCodecContext * avctx) | |||
| { | |||
| AMRContext *s = avctx->priv_data; | |||
| @@ -63,7 +63,7 @@ static enum PixelFormat GetFfmpegChromaFormat(dirac_chroma_t dirac_pix_fmt) | |||
| return PIX_FMT_NONE; | |||
| } | |||
| static int libdirac_decode_init(AVCodecContext *avccontext) | |||
| static av_cold int libdirac_decode_init(AVCodecContext *avccontext) | |||
| { | |||
| FfmpegDiracDecoderParams *p_dirac_params = avccontext->priv_data ; | |||
| @@ -174,7 +174,7 @@ static int libdirac_decode_frame(AVCodecContext *avccontext, | |||
| } | |||
| static int libdirac_decode_close(AVCodecContext *avccontext) | |||
| static av_cold int libdirac_decode_close(AVCodecContext *avccontext) | |||
| { | |||
| FfmpegDiracDecoderParams *p_dirac_params = avccontext->priv_data; | |||
| dirac_decoder_close (p_dirac_params->p_decoder); | |||
| @@ -127,7 +127,7 @@ static VideoFormat GetDiracVideoFormatPreset (AVCodecContext *avccontext) | |||
| ff_dirac_video_formats[idx] : VIDEO_FORMAT_CUSTOM; | |||
| } | |||
| static int libdirac_encode_init(AVCodecContext *avccontext) | |||
| static av_cold int libdirac_encode_init(AVCodecContext *avccontext) | |||
| { | |||
| FfmpegDiracEncoderParams* p_dirac_params = avccontext->priv_data; | |||
| @@ -386,7 +386,7 @@ static int libdirac_encode_frame(AVCodecContext *avccontext, | |||
| return enc_size; | |||
| } | |||
| static int libdirac_encode_close(AVCodecContext *avccontext) | |||
| static av_cold int libdirac_encode_close(AVCodecContext *avccontext) | |||
| { | |||
| FfmpegDiracEncoderParams* p_dirac_params = avccontext->priv_data; | |||
| @@ -117,7 +117,7 @@ static void channel_setup(AVCodecContext *avctx) | |||
| #endif | |||
| } | |||
| static int faac_init_mp4(AVCodecContext *avctx) | |||
| static av_cold int faac_init_mp4(AVCodecContext *avctx) | |||
| { | |||
| FAACContext *s = avctx->priv_data; | |||
| unsigned long samplerate; | |||
| @@ -135,7 +135,7 @@ static enum PixelFormat GetFfmpegChromaFormat(SchroChromaFormat schro_pix_fmt) | |||
| return PIX_FMT_NONE; | |||
| } | |||
| static int libschroedinger_decode_init(AVCodecContext *avccontext) | |||
| static av_cold int libschroedinger_decode_init(AVCodecContext *avccontext) | |||
| { | |||
| FfmpegSchroDecoderParams *p_schro_params = avccontext->priv_data ; | |||
| @@ -325,7 +325,7 @@ static int libschroedinger_decode_frame(AVCodecContext *avccontext, | |||
| } | |||
| static int libschroedinger_decode_close(AVCodecContext *avccontext) | |||
| static av_cold int libschroedinger_decode_close(AVCodecContext *avccontext) | |||
| { | |||
| FfmpegSchroDecoderParams *p_schro_params = avccontext->priv_data; | |||
| /* Free the decoder. */ | |||
| @@ -77,7 +77,7 @@ static int concatenate_packet(unsigned int* offset, AVCodecContext* avc_context, | |||
| return 0; | |||
| } | |||
| static int encode_init(AVCodecContext* avc_context) | |||
| static av_cold int encode_init(AVCodecContext* avc_context) | |||
| { | |||
| theora_info t_info; | |||
| theora_comment t_comment; | |||
| @@ -240,7 +240,7 @@ static int encode_frame( | |||
| return o_packet.bytes; | |||
| } | |||
| static int encode_close(AVCodecContext* avc_context) | |||
| static av_cold int encode_close(AVCodecContext* avc_context) | |||
| { | |||
| ogg_packet o_packet; | |||
| TheoraContext *h = avc_context->priv_data; | |||
| @@ -50,7 +50,7 @@ typedef struct OggVorbisContext { | |||
| } OggVorbisContext ; | |||
| static int oggvorbis_init_encoder(vorbis_info *vi, AVCodecContext *avccontext) { | |||
| static av_cold int oggvorbis_init_encoder(vorbis_info *vi, AVCodecContext *avccontext) { | |||
| double cfreq; | |||
| if(avccontext->flags & CODEC_FLAG_QSCALE) { | |||
| @@ -90,7 +90,7 @@ static int av_mpeg4_decode_header(AVCodecParserContext *s1, | |||
| return ret; | |||
| } | |||
| static int mpeg4video_parse_init(AVCodecParserContext *s) | |||
| static av_cold int mpeg4video_parse_init(AVCodecParserContext *s) | |||
| { | |||
| ParseContext1 *pc = s->priv_data; | |||
| @@ -81,7 +81,7 @@ int ff_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, | |||
| return s->frame_size; | |||
| } | |||
| static int mpegaudio_parse_init(AVCodecParserContext *s1) | |||
| static av_cold int mpegaudio_parse_init(AVCodecParserContext *s1) | |||
| { | |||
| MpegAudioParseContext *s = s1->priv_data; | |||
| s->inbuf_ptr = s->inbuf; | |||
| @@ -250,7 +250,7 @@ static int pow_mult3[3] = { | |||
| }; | |||
| #endif | |||
| static void int_pow_init(void) | |||
| static av_cold void int_pow_init(void) | |||
| { | |||
| int i, a; | |||
| @@ -308,7 +308,7 @@ static int int_pow(int i, int *exp_ptr) | |||
| } | |||
| #endif | |||
| static int decode_init(AVCodecContext * avctx) | |||
| static av_cold int decode_init(AVCodecContext * avctx) | |||
| { | |||
| MPADecodeContext *s = avctx->priv_data; | |||
| static int init=0; | |||
| @@ -829,7 +829,7 @@ static inline int round_sample(int64_t *sum) | |||
| op2(sum2, (w2)[7 * 64], tmp);\ | |||
| } | |||
| void ff_mpa_synth_init(MPA_INT *window) | |||
| void av_cold ff_mpa_synth_init(MPA_INT *window) | |||
| { | |||
| int i; | |||
| @@ -2444,7 +2444,7 @@ static int decode_init_mp3on4(AVCodecContext * avctx) | |||
| } | |||
| static int decode_close_mp3on4(AVCodecContext * avctx) | |||
| static av_cold int decode_close_mp3on4(AVCodecContext * avctx) | |||
| { | |||
| MP3On4DecodeContext *s = avctx->priv_data; | |||
| int i; | |||
| @@ -107,7 +107,7 @@ const uint8_t *ff_find_start_code(const uint8_t * restrict p, const uint8_t *end | |||
| } | |||
| /* init common dct for both encoder and decoder */ | |||
| int ff_dct_common_init(MpegEncContext *s) | |||
| av_cold int ff_dct_common_init(MpegEncContext *s) | |||
| { | |||
| s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_c; | |||
| s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_c; | |||
| @@ -396,7 +396,7 @@ void MPV_decode_defaults(MpegEncContext *s){ | |||
| * init common structure for both encoder and decoder. | |||
| * this assumes that some variables like width/height are already set | |||
| */ | |||
| int MPV_common_init(MpegEncContext *s) | |||
| av_cold int MPV_common_init(MpegEncContext *s) | |||
| { | |||
| int y_size, c_size, yc_size, i, mb_array_size, mv_table_size, x, y, threads; | |||
| @@ -85,7 +85,7 @@ static uint8_t rl_length[NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2]; | |||
| static uint8_t static_rl_table_store[NB_RL_TABLES][2][2*MAX_RUN + MAX_LEVEL + 3]; | |||
| static void common_init(MpegEncContext * s) | |||
| static av_cold void common_init(MpegEncContext * s) | |||
| { | |||
| static int initialized=0; | |||
| @@ -163,7 +163,7 @@ void ff_msmpeg4_code012(PutBitContext *pb, int n) | |||
| } | |||
| } | |||
| void ff_msmpeg4_encode_init(MpegEncContext *s) | |||
| av_cold void ff_msmpeg4_encode_init(MpegEncContext *s) | |||
| { | |||
| static int init_done=0; | |||
| int i; | |||
| @@ -995,7 +995,7 @@ VLC ff_inter_intra_vlc; | |||
| /* This table is practically identical to the one from h263 | |||
| * except that it is inverted. */ | |||
| static void init_h263_dc_for_msmpeg4(void) | |||
| static av_cold void init_h263_dc_for_msmpeg4(void) | |||
| { | |||
| int level, uni_code, uni_len; | |||
| @@ -1050,7 +1050,7 @@ static void init_h263_dc_for_msmpeg4(void) | |||
| } | |||
| /* init all vlc decoding tables */ | |||
| int ff_msmpeg4_decode_init(MpegEncContext *s) | |||
| av_cold int ff_msmpeg4_decode_init(MpegEncContext *s) | |||
| { | |||
| static int done = 0; | |||
| int i; | |||
| @@ -222,7 +222,7 @@ static float noise_samples[128]; | |||
| static DECLARE_ALIGNED_16(MPA_INT, mpa_window[512]); | |||
| static void softclip_table_init(void) { | |||
| static av_cold void softclip_table_init(void) { | |||
| int i; | |||
| double dfl = SOFTCLIP_THRESHOLD - 32767; | |||
| float delta = 1.0 / -dfl; | |||
| @@ -232,7 +232,7 @@ static void softclip_table_init(void) { | |||
| // random generated table | |||
| static void rnd_table_init(void) { | |||
| static av_cold void rnd_table_init(void) { | |||
| int i,j; | |||
| uint32_t ldw,hdw; | |||
| uint64_t tmp64_1; | |||
| @@ -268,7 +268,7 @@ static void rnd_table_init(void) { | |||
| } | |||
| static void init_noise_samples(void) { | |||
| static av_cold void init_noise_samples(void) { | |||
| int i; | |||
| int random_seed = 0; | |||
| float delta = 1.0 / 16384.0; | |||
| @@ -279,7 +279,7 @@ static void init_noise_samples(void) { | |||
| } | |||
| static void qdm2_init_vlc(void) | |||
| static av_cold void qdm2_init_vlc(void) | |||
| { | |||
| init_vlc (&vlc_tab_level, 8, 24, | |||
| vlc_tab_level_huffbits, 1, 1, | |||
| @@ -1660,7 +1660,7 @@ static void qdm2_synthesis_filter (QDM2Context *q, int index) | |||
| * | |||
| * @param q context | |||
| */ | |||
| static void qdm2_init(QDM2Context *q) { | |||
| static av_cold void qdm2_init(QDM2Context *q) { | |||
| static int initialized = 0; | |||
| if (initialized != 0) | |||
| @@ -1726,7 +1726,7 @@ static void dump_context(QDM2Context *q) | |||
| /** | |||
| * Init parameters from codec extradata | |||
| */ | |||
| static int qdm2_decode_init(AVCodecContext *avctx) | |||
| static av_cold int qdm2_decode_init(AVCodecContext *avctx) | |||
| { | |||
| QDM2Context *s = avctx->priv_data; | |||
| uint8_t *extradata; | |||
| @@ -1896,7 +1896,7 @@ static int qdm2_decode_init(AVCodecContext *avctx) | |||
| } | |||
| static int qdm2_decode_close(AVCodecContext *avctx) | |||
| static av_cold int qdm2_decode_close(AVCodecContext *avctx) | |||
| { | |||
| QDM2Context *s = avctx->priv_data; | |||
| @@ -49,7 +49,7 @@ static av_cold void roq_dpcm_table_init(void) | |||
| } | |||
| } | |||
| static int roq_dpcm_encode_init(AVCodecContext *avctx) | |||
| static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx) | |||
| { | |||
| ROQDPCMContext *context = avctx->priv_data; | |||
| @@ -775,7 +775,7 @@ static int svq3_decode_slice_header(H264Context *h) | |||
| return 0; | |||
| } | |||
| static int svq3_decode_init(AVCodecContext *avctx) | |||
| static av_cold int svq3_decode_init(AVCodecContext *avctx) | |||
| { | |||
| MpegEncContext *const s = avctx->priv_data; | |||
| H264Context *const h = avctx->priv_data; | |||
| @@ -2207,7 +2207,7 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb) | |||
| return 0; | |||
| } | |||
| static int theora_decode_init(AVCodecContext *avctx) | |||
| static av_cold int theora_decode_init(AVCodecContext *avctx) | |||
| { | |||
| Vp3DecodeContext *s = avctx->priv_data; | |||
| GetBitContext gb; | |||