* commit '6fee1b90ce3bf4fbdfde7016e0890057c9000487':
avcodec: Add av_cold attributes to init functions missing them
Conflicts:
libavcodec/aacpsy.c
libavcodec/atrac3.c
libavcodec/dvdsubdec.c
libavcodec/ffv1.c
libavcodec/ffv1enc.c
libavcodec/h261enc.c
libavcodec/h264_parser.c
libavcodec/h264dsp.c
libavcodec/h264pred.c
libavcodec/libschroedingerenc.c
libavcodec/libxvid_rc.c
libavcodec/mpeg12.c
libavcodec/mpeg12enc.c
libavcodec/proresdsp.c
libavcodec/rangecoder.c
libavcodec/videodsp.c
libavcodec/x86/proresdsp_init.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
... | ... |
@@ -24,6 +24,7 @@ |
24 | 24 |
* AAC encoder psychoacoustic model |
25 | 25 |
*/ |
26 | 26 |
|
27 |
+#include "libavutil/attributes.h" |
|
27 | 28 |
#include "libavutil/libm.h" |
28 | 29 |
|
29 | 30 |
#include "avcodec.h" |
... | ... |
@@ -254,7 +255,8 @@ static float lame_calc_attack_threshold(int bitrate) |
254 | 254 |
/** |
255 | 255 |
* LAME psy model specific initialization |
256 | 256 |
*/ |
257 |
-static void lame_window_init(AacPsyContext *ctx, AVCodecContext *avctx) { |
|
257 |
+static av_cold void lame_window_init(AacPsyContext *ctx, AVCodecContext *avctx) |
|
258 |
+{ |
|
258 | 259 |
int i, j; |
259 | 260 |
|
260 | 261 |
for (i = 0; i < avctx->channels; i++) { |
... | ... |
@@ -30,6 +30,7 @@ |
30 | 30 |
|
31 | 31 |
#include <stdint.h> |
32 | 32 |
|
33 |
+#include "libavutil/attributes.h" |
|
33 | 34 |
#include "libavutil/avassert.h" |
34 | 35 |
#include "libavutil/avstring.h" |
35 | 36 |
#include "libavutil/channel_layout.h" |
... | ... |
@@ -754,7 +755,7 @@ static void count_frame_bits_fixed(AC3EncodeContext *s) |
754 | 754 |
* Initialize bit allocation. |
755 | 755 |
* Set default parameter codes and calculate parameter values. |
756 | 756 |
*/ |
757 |
-static void bit_alloc_init(AC3EncodeContext *s) |
|
757 |
+static av_cold void bit_alloc_init(AC3EncodeContext *s) |
|
758 | 758 |
{ |
759 | 759 |
int ch; |
760 | 760 |
|
... | ... |
@@ -36,6 +36,7 @@ |
36 | 36 |
#include <stddef.h> |
37 | 37 |
#include <stdio.h> |
38 | 38 |
|
39 |
+#include "libavutil/attributes.h" |
|
39 | 40 |
#include "libavutil/float_dsp.h" |
40 | 41 |
#include "libavutil/libm.h" |
41 | 42 |
#include "avcodec.h" |
... | ... |
@@ -838,7 +839,7 @@ static int atrac3_decode_frame(AVCodecContext *avctx, void *data, |
838 | 838 |
return avctx->block_align; |
839 | 839 |
} |
840 | 840 |
|
841 |
-static void atrac3_init_static_data(void) |
|
841 |
+static av_cold void atrac3_init_static_data(void) |
|
842 | 842 |
{ |
843 | 843 |
int i; |
844 | 844 |
|
... | ... |
@@ -19,12 +19,13 @@ |
19 | 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 |
*/ |
21 | 21 |
|
22 |
+#include "libavutil/attributes.h" |
|
22 | 23 |
#include "libavutil/common.h" |
23 | 24 |
#include "audio_frame_queue.h" |
24 | 25 |
#include "internal.h" |
25 | 26 |
#include "libavutil/avassert.h" |
26 | 27 |
|
27 |
-void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq) |
|
28 |
+av_cold void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq) |
|
28 | 29 |
{ |
29 | 30 |
afq->avctx = avctx; |
30 | 31 |
afq->remaining_delay = avctx->delay; |
... | ... |
@@ -25,6 +25,7 @@ |
25 | 25 |
* @author Thilo Borgmann <thilo.borgmann _at_ googlemail.com> |
26 | 26 |
*/ |
27 | 27 |
|
28 |
+#include "libavutil/attributes.h" |
|
28 | 29 |
#include "bgmc.h" |
29 | 30 |
|
30 | 31 |
#define FREQ_BITS 14 // bits used by frequency counters |
... | ... |
@@ -456,7 +457,8 @@ static uint8_t *bgmc_lut_getp(uint8_t *lut, int *lut_status, int delta) |
456 | 456 |
|
457 | 457 |
|
458 | 458 |
/** Initialize the lookup table arrays */ |
459 |
-int ff_bgmc_init(AVCodecContext *avctx, uint8_t **cf_lut, int **cf_lut_status) |
|
459 |
+av_cold int ff_bgmc_init(AVCodecContext *avctx, |
|
460 |
+ uint8_t **cf_lut, int **cf_lut_status) |
|
460 | 461 |
{ |
461 | 462 |
*cf_lut = av_malloc(sizeof(**cf_lut) * LUT_BUFF * 16 * LUT_SIZE); |
462 | 463 |
*cf_lut_status = av_malloc(sizeof(**cf_lut_status) * LUT_BUFF); |
... | ... |
@@ -483,8 +485,8 @@ void ff_bgmc_end(uint8_t **cf_lut, int **cf_lut_status) |
483 | 483 |
|
484 | 484 |
|
485 | 485 |
/** Initialize decoding and reads the first value */ |
486 |
-void ff_bgmc_decode_init(GetBitContext *gb, unsigned int *h, unsigned int *l, |
|
487 |
- unsigned int *v) |
|
486 |
+av_cold void ff_bgmc_decode_init(GetBitContext *gb, unsigned int *h, |
|
487 |
+ unsigned int *l, unsigned int *v) |
|
488 | 488 |
{ |
489 | 489 |
*h = TOP_VALUE; |
490 | 490 |
*l = 0; |
... | ... |
@@ -20,6 +20,7 @@ |
20 | 20 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
21 | 21 |
*/ |
22 | 22 |
|
23 |
+#include "libavutil/attributes.h" |
|
23 | 24 |
#include "libavutil/imgutils.h" |
24 | 25 |
#include "libavutil/internal.h" |
25 | 26 |
#include "avcodec.h" |
... | ... |
@@ -528,14 +529,14 @@ static inline int get_value(BinkContext *c, int bundle) |
528 | 528 |
return ret; |
529 | 529 |
} |
530 | 530 |
|
531 |
-static void binkb_init_bundle(BinkContext *c, int bundle_num) |
|
531 |
+static av_cold void binkb_init_bundle(BinkContext *c, int bundle_num) |
|
532 | 532 |
{ |
533 | 533 |
c->bundle[bundle_num].cur_dec = |
534 | 534 |
c->bundle[bundle_num].cur_ptr = c->bundle[bundle_num].data; |
535 | 535 |
c->bundle[bundle_num].len = 13; |
536 | 536 |
} |
537 | 537 |
|
538 |
-static void binkb_init_bundles(BinkContext *c) |
|
538 |
+static av_cold void binkb_init_bundles(BinkContext *c) |
|
539 | 539 |
{ |
540 | 540 |
int i; |
541 | 541 |
for (i = 0; i < BINKB_NB_SRC; i++) |
... | ... |
@@ -24,6 +24,7 @@ |
24 | 24 |
* Bink DSP routines |
25 | 25 |
*/ |
26 | 26 |
|
27 |
+#include "libavutil/attributes.h" |
|
27 | 28 |
#include "dsputil.h" |
28 | 29 |
#include "binkdsp.h" |
29 | 30 |
|
... | ... |
@@ -128,7 +129,7 @@ static void scale_block_c(const uint8_t src[64]/*align 8*/, uint8_t *dst/*align |
128 | 128 |
} |
129 | 129 |
} |
130 | 130 |
|
131 |
-void ff_binkdsp_init(BinkDSPContext *c) |
|
131 |
+av_cold void ff_binkdsp_init(BinkDSPContext *c) |
|
132 | 132 |
{ |
133 | 133 |
c->idct_add = bink_idct_add_c; |
134 | 134 |
c->idct_put = bink_idct_put_c; |
... | ... |
@@ -20,6 +20,7 @@ |
20 | 20 |
*/ |
21 | 21 |
|
22 | 22 |
#include "config.h" |
23 |
+#include "libavutil/attributes.h" |
|
23 | 24 |
#include "dcadsp.h" |
24 | 25 |
|
25 | 26 |
static void dca_lfe_fir_c(float *out, const float *in, const float *coefs, |
... | ... |
@@ -44,7 +45,7 @@ static void dca_lfe_fir_c(float *out, const float *in, const float *coefs, |
44 | 44 |
} |
45 | 45 |
} |
46 | 46 |
|
47 |
-void ff_dcadsp_init(DCADSPContext *s) |
|
47 |
+av_cold void ff_dcadsp_init(DCADSPContext *s) |
|
48 | 48 |
{ |
49 | 49 |
s->lfe_fir = dca_lfe_fir_c; |
50 | 50 |
if (ARCH_ARM) ff_dcadsp_init_arm(s); |
... | ... |
@@ -26,6 +26,7 @@ |
26 | 26 |
//#define DEBUG |
27 | 27 |
#define RC_VARIANCE 1 // use variance or ssd for fast rc |
28 | 28 |
|
29 |
+#include "libavutil/attributes.h" |
|
29 | 30 |
#include "libavutil/internal.h" |
30 | 31 |
#include "libavutil/opt.h" |
31 | 32 |
#include "avcodec.h" |
... | ... |
@@ -115,7 +116,7 @@ static int dnxhd_10bit_dct_quantize(MpegEncContext *ctx, int16_t *block, |
115 | 115 |
return last_non_zero; |
116 | 116 |
} |
117 | 117 |
|
118 |
-static int dnxhd_init_vlc(DNXHDEncContext *ctx) |
|
118 |
+static av_cold int dnxhd_init_vlc(DNXHDEncContext *ctx) |
|
119 | 119 |
{ |
120 | 120 |
int i, j, level, run; |
121 | 121 |
int max_level = 1<<(ctx->cid_table->bit_depth+2); |
... | ... |
@@ -170,7 +171,7 @@ static int dnxhd_init_vlc(DNXHDEncContext *ctx) |
170 | 170 |
return -1; |
171 | 171 |
} |
172 | 172 |
|
173 |
-static int dnxhd_init_qmat(DNXHDEncContext *ctx, int lbias, int cbias) |
|
173 |
+static av_cold int dnxhd_init_qmat(DNXHDEncContext *ctx, int lbias, int cbias) |
|
174 | 174 |
{ |
175 | 175 |
// init first elem to 1 to avoid div by 0 in convert_matrix |
176 | 176 |
uint16_t weight_matrix[64] = {1,}; // convert_matrix needs uint16_t* |
... | ... |
@@ -234,7 +235,7 @@ static int dnxhd_init_qmat(DNXHDEncContext *ctx, int lbias, int cbias) |
234 | 234 |
return -1; |
235 | 235 |
} |
236 | 236 |
|
237 |
-static int dnxhd_init_rc(DNXHDEncContext *ctx) |
|
237 |
+static av_cold int dnxhd_init_rc(DNXHDEncContext *ctx) |
|
238 | 238 |
{ |
239 | 239 |
FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_rc, 8160*ctx->m.avctx->qmax*sizeof(RCEntry), fail); |
240 | 240 |
if (ctx->m.avctx->mb_decision != FF_MB_DECISION_RD) |
... | ... |
@@ -248,7 +249,7 @@ static int dnxhd_init_rc(DNXHDEncContext *ctx) |
248 | 248 |
return -1; |
249 | 249 |
} |
250 | 250 |
|
251 |
-static int dnxhd_encode_init(AVCodecContext *avctx) |
|
251 |
+static av_cold int dnxhd_encode_init(AVCodecContext *avctx) |
|
252 | 252 |
{ |
253 | 253 |
DNXHDEncContext *ctx = avctx->priv_data; |
254 | 254 |
int i, index, bit_depth; |
... | ... |
@@ -27,6 +27,7 @@ |
27 | 27 |
* DSP utils |
28 | 28 |
*/ |
29 | 29 |
|
30 |
+#include "libavutil/attributes.h" |
|
30 | 31 |
#include "libavutil/imgutils.h" |
31 | 32 |
#include "libavutil/internal.h" |
32 | 33 |
#include "avcodec.h" |
... | ... |
@@ -107,7 +108,9 @@ static const uint8_t simple_mmx_permutation[64]={ |
107 | 107 |
|
108 | 108 |
static const uint8_t idct_sse2_row_perm[8] = {0, 4, 1, 5, 2, 6, 3, 7}; |
109 | 109 |
|
110 |
-void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable){ |
|
110 |
+av_cold void ff_init_scantable(uint8_t *permutation, ScanTable *st, |
|
111 |
+ const uint8_t *src_scantable) |
|
112 |
+{ |
|
111 | 113 |
int i; |
112 | 114 |
int end; |
113 | 115 |
|
... | ... |
@@ -128,8 +131,8 @@ void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_s |
128 | 128 |
} |
129 | 129 |
} |
130 | 130 |
|
131 |
-void ff_init_scantable_permutation(uint8_t *idct_permutation, |
|
132 |
- int idct_permutation_type) |
|
131 |
+av_cold void ff_init_scantable_permutation(uint8_t *idct_permutation, |
|
132 |
+ int idct_permutation_type) |
|
133 | 133 |
{ |
134 | 134 |
int i; |
135 | 135 |
|
... | ... |
@@ -21,6 +21,7 @@ |
21 | 21 |
#include "avcodec.h" |
22 | 22 |
#include "get_bits.h" |
23 | 23 |
#include "dsputil.h" |
24 |
+#include "libavutil/attributes.h" |
|
24 | 25 |
#include "libavutil/colorspace.h" |
25 | 26 |
#include "libavutil/opt.h" |
26 | 27 |
#include "libavutil/imgutils.h" |
... | ... |
@@ -565,7 +566,7 @@ static int dvdsub_parse_extradata(AVCodecContext *avctx) |
565 | 565 |
return 1; |
566 | 566 |
} |
567 | 567 |
|
568 |
-static int dvdsub_init(AVCodecContext *avctx) |
|
568 |
+static int av_cold dvdsub_init(AVCodecContext *avctx) |
|
569 | 569 |
{ |
570 | 570 |
DVDSubContext *ctx = avctx->priv_data; |
571 | 571 |
int ret; |
... | ... |
@@ -25,6 +25,8 @@ |
25 | 25 |
*/ |
26 | 26 |
|
27 | 27 |
#define CONFIG_AC3ENC_FLOAT 1 |
28 |
+ |
|
29 |
+#include "libavutil/attributes.h" |
|
28 | 30 |
#include "ac3enc.h" |
29 | 31 |
#include "eac3enc.h" |
30 | 32 |
#include "eac3_data.h" |
... | ... |
@@ -47,7 +49,7 @@ static const AVClass eac3enc_class = { |
47 | 47 |
static int8_t eac3_frame_expstr_index_tab[3][4][4][4][4][4]; |
48 | 48 |
|
49 | 49 |
|
50 |
-void ff_eac3_exponent_init(void) |
|
50 |
+av_cold void ff_eac3_exponent_init(void) |
|
51 | 51 |
{ |
52 | 52 |
int i; |
53 | 53 |
|
... | ... |
@@ -25,6 +25,7 @@ |
25 | 25 |
* FF Video Codec 1 (a lossless codec) |
26 | 26 |
*/ |
27 | 27 |
|
28 |
+#include "libavutil/attributes.h" |
|
28 | 29 |
#include "libavutil/avassert.h" |
29 | 30 |
#include "libavutil/crc.h" |
30 | 31 |
#include "libavutil/opt.h" |
... | ... |
@@ -62,7 +63,7 @@ av_cold int ffv1_common_init(AVCodecContext *avctx) |
62 | 62 |
return 0; |
63 | 63 |
} |
64 | 64 |
|
65 |
-int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs) |
|
65 |
+av_cold int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs) |
|
66 | 66 |
{ |
67 | 67 |
int j; |
68 | 68 |
|
... | ... |
@@ -96,7 +97,7 @@ int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs) |
96 | 96 |
return 0; |
97 | 97 |
} |
98 | 98 |
|
99 |
-int ffv1_init_slices_state(FFV1Context *f) |
|
99 |
+av_cold int ffv1_init_slices_state(FFV1Context *f) |
|
100 | 100 |
{ |
101 | 101 |
int i, ret; |
102 | 102 |
for (i = 0; i < f->slice_count; i++) { |
... | ... |
@@ -32,6 +32,7 @@ |
32 | 32 |
* The parser returns the frame with the highest score. |
33 | 33 |
**/ |
34 | 34 |
|
35 |
+#include "libavutil/attributes.h" |
|
35 | 36 |
#include "libavutil/crc.h" |
36 | 37 |
#include "libavutil/fifo.h" |
37 | 38 |
#include "bytestream.h" |
... | ... |
@@ -658,7 +659,7 @@ handle_error: |
658 | 658 |
return read_end - buf; |
659 | 659 |
} |
660 | 660 |
|
661 |
-static int flac_parse_init(AVCodecParserContext *c) |
|
661 |
+static av_cold int flac_parse_init(AVCodecParserContext *c) |
|
662 | 662 |
{ |
663 | 663 |
FLACParseContext *fpc = c->priv_data; |
664 | 664 |
fpc->pc = c; |
... | ... |
@@ -25,6 +25,7 @@ |
25 | 25 |
* H.261 encoder. |
26 | 26 |
*/ |
27 | 27 |
|
28 |
+#include "libavutil/attributes.h" |
|
28 | 29 |
#include "libavutil/avassert.h" |
29 | 30 |
#include "avcodec.h" |
30 | 31 |
#include "mpegvideo.h" |
... | ... |
@@ -312,7 +313,7 @@ void ff_h261_encode_mb(MpegEncContext *s, int16_t block[6][64], |
312 | 312 |
} |
313 | 313 |
} |
314 | 314 |
|
315 |
-void ff_h261_encode_init(MpegEncContext *s) |
|
315 |
+av_cold void ff_h261_encode_init(MpegEncContext *s) |
|
316 | 316 |
{ |
317 | 317 |
ff_h261_common_init(); |
318 | 318 |
|
... | ... |
@@ -27,6 +27,7 @@ |
27 | 27 |
|
28 | 28 |
#define UNCHECKED_BITSTREAM_READER 1 |
29 | 29 |
|
30 |
+#include "libavutil/attributes.h" |
|
30 | 31 |
#include "parser.h" |
31 | 32 |
#include "h264data.h" |
32 | 33 |
#include "golomb.h" |
... | ... |
@@ -381,7 +382,7 @@ static void close(AVCodecParserContext *s) |
381 | 381 |
ff_h264_free_context(h); |
382 | 382 |
} |
383 | 383 |
|
384 |
-static int init(AVCodecParserContext *s) |
|
384 |
+static av_cold int init(AVCodecParserContext *s) |
|
385 | 385 |
{ |
386 | 386 |
H264Context *h = s->priv_data; |
387 | 387 |
h->thread_context[0] = h; |
... | ... |
@@ -17,6 +17,7 @@ |
17 | 17 |
*/ |
18 | 18 |
|
19 | 19 |
#include "config.h" |
20 |
+#include "libavutil/attributes.h" |
|
20 | 21 |
#include "h264chroma.h" |
21 | 22 |
|
22 | 23 |
#define BIT_DEPTH 8 |
... | ... |
@@ -35,7 +36,7 @@ |
35 | 35 |
c->avg_h264_chroma_pixels_tab[1] = avg_h264_chroma_mc4_ ## depth ## _c; \ |
36 | 36 |
c->avg_h264_chroma_pixels_tab[2] = avg_h264_chroma_mc2_ ## depth ## _c; \ |
37 | 37 |
|
38 |
-void ff_h264chroma_init(H264ChromaContext *c, int bit_depth) |
|
38 |
+av_cold void ff_h264chroma_init(H264ChromaContext *c, int bit_depth) |
|
39 | 39 |
{ |
40 | 40 |
if (bit_depth > 8 && bit_depth <= 16) { |
41 | 41 |
SET_CHROMA(16); |
... | ... |
@@ -26,7 +26,9 @@ |
26 | 26 |
*/ |
27 | 27 |
|
28 | 28 |
#include <stdint.h> |
29 |
+#include "libavutil/attributes.h" |
|
29 | 30 |
#include "libavutil/avassert.h" |
31 |
+ |
|
30 | 32 |
#include "avcodec.h" |
31 | 33 |
#include "h264dsp.h" |
32 | 34 |
#include "h264idct.h" |
... | ... |
@@ -60,7 +62,8 @@ |
60 | 60 |
#include "h264addpx_template.c" |
61 | 61 |
#undef BIT_DEPTH |
62 | 62 |
|
63 |
-void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, const int chroma_format_idc) |
|
63 |
+av_cold void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, |
|
64 |
+ const int chroma_format_idc) |
|
64 | 65 |
{ |
65 | 66 |
#undef FUNC |
66 | 67 |
#define FUNC(a, depth) a ## _ ## depth ## _c |
... | ... |
@@ -25,6 +25,7 @@ |
25 | 25 |
* @author Michael Niedermayer <michaelni@gmx.at> |
26 | 26 |
*/ |
27 | 27 |
|
28 |
+#include "libavutil/attributes.h" |
|
28 | 29 |
#include "libavutil/avassert.h" |
29 | 30 |
#include "dsputil.h" |
30 | 31 |
#include "h264pred.h" |
... | ... |
@@ -407,8 +408,9 @@ static void pred8x8_tm_vp8_c(uint8_t *src, ptrdiff_t stride) |
407 | 407 |
/** |
408 | 408 |
* Set the intra prediction function pointers. |
409 | 409 |
*/ |
410 |
-void ff_h264_pred_init(H264PredContext *h, int codec_id, const int bit_depth, |
|
411 |
- int chroma_format_idc) |
|
410 |
+av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id, |
|
411 |
+ const int bit_depth, |
|
412 |
+ int chroma_format_idc) |
|
412 | 413 |
{ |
413 | 414 |
#undef FUNC |
414 | 415 |
#undef FUNCC |
... | ... |
@@ -19,6 +19,7 @@ |
19 | 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 |
*/ |
21 | 21 |
|
22 |
+#include "libavutil/attributes.h" |
|
22 | 23 |
#include "h264qpel.h" |
23 | 24 |
|
24 | 25 |
#define pixeltmp int16_t |
... | ... |
@@ -45,7 +46,7 @@ |
45 | 45 |
#undef BIT_DEPTH |
46 | 46 |
|
47 | 47 |
|
48 |
-void ff_h264qpel_init(H264QpelContext *c, int bit_depth) |
|
48 |
+av_cold void ff_h264qpel_init(H264QpelContext *c, int bit_depth) |
|
49 | 49 |
{ |
50 | 50 |
#undef FUNCC |
51 | 51 |
#define FUNCC(f, depth) f ## _ ## depth ## _c |
... | ... |
@@ -26,6 +26,7 @@ |
26 | 26 |
|
27 | 27 |
#include "iirfilter.h" |
28 | 28 |
#include <math.h> |
29 |
+#include "libavutil/attributes.h" |
|
29 | 30 |
#include "libavutil/common.h" |
30 | 31 |
|
31 | 32 |
/** |
... | ... |
@@ -48,10 +49,11 @@ typedef struct FFIIRFilterState{ |
48 | 48 |
/// maximum supported filter order |
49 | 49 |
#define MAXORDER 30 |
50 | 50 |
|
51 |
-static int butterworth_init_coeffs(void *avc, struct FFIIRFilterCoeffs *c, |
|
52 |
- enum IIRFilterMode filt_mode, |
|
53 |
- int order, float cutoff_ratio, |
|
54 |
- float stopband) |
|
51 |
+static av_cold int butterworth_init_coeffs(void *avc, |
|
52 |
+ struct FFIIRFilterCoeffs *c, |
|
53 |
+ enum IIRFilterMode filt_mode, |
|
54 |
+ int order, float cutoff_ratio, |
|
55 |
+ float stopband) |
|
55 | 56 |
{ |
56 | 57 |
int i, j; |
57 | 58 |
double wa; |
... | ... |
@@ -113,9 +115,9 @@ static int butterworth_init_coeffs(void *avc, struct FFIIRFilterCoeffs *c, |
113 | 113 |
return 0; |
114 | 114 |
} |
115 | 115 |
|
116 |
-static int biquad_init_coeffs(void *avc, struct FFIIRFilterCoeffs *c, |
|
117 |
- enum IIRFilterMode filt_mode, int order, |
|
118 |
- float cutoff_ratio, float stopband) |
|
116 |
+static av_cold int biquad_init_coeffs(void *avc, struct FFIIRFilterCoeffs *c, |
|
117 |
+ enum IIRFilterMode filt_mode, int order, |
|
118 |
+ float cutoff_ratio, float stopband) |
|
119 | 119 |
{ |
120 | 120 |
double cos_w0, sin_w0; |
121 | 121 |
double a0, x0, x1; |
... | ... |
@@ -32,6 +32,7 @@ |
32 | 32 |
//#define DEBUG |
33 | 33 |
#include <limits.h> |
34 | 34 |
|
35 |
+#include "libavutil/attributes.h" |
|
35 | 36 |
#include "libavutil/internal.h" |
36 | 37 |
#include "libavutil/mathematics.h" |
37 | 38 |
#include "avcodec.h" |
... | ... |
@@ -100,7 +101,7 @@ static VLC cbpc_b_vlc; |
100 | 100 |
/* init vlcs */ |
101 | 101 |
|
102 | 102 |
/* XXX: find a better solution to handle static init */ |
103 |
-void ff_h263_decode_init_vlc(void) |
|
103 |
+av_cold void ff_h263_decode_init_vlc(void) |
|
104 | 104 |
{ |
105 | 105 |
static volatile int done = 0; |
106 | 106 |
|
... | ... |
@@ -30,6 +30,7 @@ |
30 | 30 |
//#define DEBUG |
31 | 31 |
#include <limits.h> |
32 | 32 |
|
33 |
+#include "libavutil/attributes.h" |
|
33 | 34 |
#include "avcodec.h" |
34 | 35 |
#include "mpegvideo.h" |
35 | 36 |
#include "h263.h" |
... | ... |
@@ -679,7 +680,7 @@ void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code) |
679 | 679 |
} |
680 | 680 |
} |
681 | 681 |
|
682 |
-static void init_mv_penalty_and_fcode(MpegEncContext *s) |
|
682 |
+static av_cold void init_mv_penalty_and_fcode(MpegEncContext *s) |
|
683 | 683 |
{ |
684 | 684 |
int f_code; |
685 | 685 |
int mv; |
... | ... |
@@ -721,7 +722,9 @@ static void init_mv_penalty_and_fcode(MpegEncContext *s) |
721 | 721 |
} |
722 | 722 |
} |
723 | 723 |
|
724 |
-static void init_uni_h263_rl_tab(RLTable *rl, uint32_t *bits_tab, uint8_t *len_tab){ |
|
724 |
+static av_cold void init_uni_h263_rl_tab(RLTable *rl, uint32_t *bits_tab, |
|
725 |
+ uint8_t *len_tab) |
|
726 |
+{ |
|
725 | 727 |
int slevel, run, last; |
726 | 728 |
|
727 | 729 |
av_assert0(MAX_LEVEL >= 64); |
... | ... |
@@ -764,7 +767,7 @@ static void init_uni_h263_rl_tab(RLTable *rl, uint32_t *bits_tab, uint8_t *len_t |
764 | 764 |
} |
765 | 765 |
} |
766 | 766 |
|
767 |
-void ff_h263_encode_init(MpegEncContext *s) |
|
767 |
+av_cold void ff_h263_encode_init(MpegEncContext *s) |
|
768 | 768 |
{ |
769 | 769 |
static int done = 0; |
770 | 770 |
|
... | ... |
@@ -100,7 +100,7 @@ static int ivi_create_huff_from_desc(const IVIHuffDesc *cb, VLC *vlc, int flag) |
100 | 100 |
(flag ? INIT_VLC_USE_NEW_STATIC : 0) | INIT_VLC_LE); |
101 | 101 |
} |
102 | 102 |
|
103 |
-void ff_ivi_init_static_vlc(void) |
|
103 |
+av_cold void ff_ivi_init_static_vlc(void) |
|
104 | 104 |
{ |
105 | 105 |
int i; |
106 | 106 |
static VLC_TYPE table_data[8192 * 16][2]; |
... | ... |
@@ -23,8 +23,9 @@ |
23 | 23 |
* function definitions common to libschroedinger decoder and encoder |
24 | 24 |
*/ |
25 | 25 |
|
26 |
-#include "libschroedinger.h" |
|
26 |
+#include "libavutil/attributes.h" |
|
27 | 27 |
#include "libavutil/mem.h" |
28 |
+#include "libschroedinger.h" |
|
28 | 29 |
|
29 | 30 |
static const SchroVideoFormatInfo ff_schro_video_format_info[] = { |
30 | 31 |
{ 640, 480, 24000, 1001}, |
... | ... |
@@ -66,7 +67,7 @@ static unsigned int get_video_format_idx(AVCodecContext *avctx) |
66 | 66 |
return ret_idx; |
67 | 67 |
} |
68 | 68 |
|
69 |
-void ff_schro_queue_init(FFSchroQueue *queue) |
|
69 |
+av_cold void ff_schro_queue_init(FFSchroQueue *queue) |
|
70 | 70 |
{ |
71 | 71 |
queue->p_head = queue->p_tail = NULL; |
72 | 72 |
queue->size = 0; |
... | ... |
@@ -31,6 +31,7 @@ |
31 | 31 |
#include <schroedinger/schrodebug.h> |
32 | 32 |
#include <schroedinger/schrovideoformat.h> |
33 | 33 |
|
34 |
+#include "libavutil/attributes.h" |
|
34 | 35 |
#include "libavutil/avassert.h" |
35 | 36 |
#include "avcodec.h" |
36 | 37 |
#include "internal.h" |
... | ... |
@@ -100,7 +101,7 @@ static int set_chroma_format(AVCodecContext *avctx) |
100 | 100 |
return -1; |
101 | 101 |
} |
102 | 102 |
|
103 |
-static int libschroedinger_encode_init(AVCodecContext *avctx) |
|
103 |
+static av_cold int libschroedinger_encode_init(AVCodecContext *avctx) |
|
104 | 104 |
{ |
105 | 105 |
SchroEncoderParams *p_schro_params = avctx->priv_data; |
106 | 106 |
SchroVideoFormatEnum preset; |
... | ... |
@@ -23,6 +23,7 @@ |
23 | 23 |
#include "config.h" |
24 | 24 |
#include <xvid.h> |
25 | 25 |
#include <unistd.h> |
26 |
+#include "libavutil/attributes.h" |
|
26 | 27 |
#include "libavutil/file.h" |
27 | 28 |
#include "avcodec.h" |
28 | 29 |
#include "libxvid.h" |
... | ... |
@@ -31,7 +32,8 @@ |
31 | 31 |
#undef NDEBUG |
32 | 32 |
#include <assert.h> |
33 | 33 |
|
34 |
-int ff_xvid_rate_control_init(MpegEncContext *s){ |
|
34 |
+av_cold int ff_xvid_rate_control_init(MpegEncContext *s) |
|
35 |
+{ |
|
35 | 36 |
char *tmp_name; |
36 | 37 |
int fd, i; |
37 | 38 |
xvid_plg_create_t xvid_plg_create = { 0 }; |
... | ... |
@@ -20,6 +20,7 @@ |
20 | 20 |
*/ |
21 | 21 |
|
22 | 22 |
#include "config.h" |
23 |
+#include "libavutil/attributes.h" |
|
23 | 24 |
#include "mlpdsp.h" |
24 | 25 |
#include "mlp.h" |
25 | 26 |
|
... | ... |
@@ -56,7 +57,7 @@ static void mlp_filter_channel(int32_t *state, const int32_t *coeff, |
56 | 56 |
} |
57 | 57 |
} |
58 | 58 |
|
59 |
-void ff_mlpdsp_init(MLPDSPContext *c) |
|
59 |
+av_cold void ff_mlpdsp_init(MLPDSPContext *c) |
|
60 | 60 |
{ |
61 | 61 |
c->mlp_filter_channel = mlp_filter_channel; |
62 | 62 |
if (ARCH_X86) |
... | ... |
@@ -26,6 +26,7 @@ |
26 | 26 |
* divided into 32 subbands. |
27 | 27 |
*/ |
28 | 28 |
|
29 |
+#include "libavutil/attributes.h" |
|
29 | 30 |
#include "avcodec.h" |
30 | 31 |
#include "get_bits.h" |
31 | 32 |
#include "mpegaudiodsp.h" |
... | ... |
@@ -34,7 +35,7 @@ |
34 | 34 |
#include "mpc.h" |
35 | 35 |
#include "mpcdata.h" |
36 | 36 |
|
37 |
-void ff_mpc_init(void) |
|
37 |
+av_cold void ff_mpc_init(void) |
|
38 | 38 |
{ |
39 | 39 |
ff_mpa_synth_init_fixed(ff_mpa_synth_window_fixed); |
40 | 40 |
} |
... | ... |
@@ -28,6 +28,7 @@ |
28 | 28 |
#define UNCHECKED_BITSTREAM_READER 1 |
29 | 29 |
|
30 | 30 |
//#define DEBUG |
31 |
+#include "libavutil/attributes.h" |
|
31 | 32 |
#include "libavutil/avassert.h" |
32 | 33 |
#include "libavutil/timecode.h" |
33 | 34 |
|
... | ... |
@@ -58,7 +59,7 @@ uint8_t ff_mpeg12_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3]; |
58 | 58 |
init_2d_vlc_rl(&rl);\ |
59 | 59 |
} |
60 | 60 |
|
61 |
-static void init_2d_vlc_rl(RLTable *rl) |
|
61 |
+static av_cold void init_2d_vlc_rl(RLTable *rl) |
|
62 | 62 |
{ |
63 | 63 |
int i; |
64 | 64 |
|
... | ... |
@@ -91,7 +92,7 @@ static void init_2d_vlc_rl(RLTable *rl) |
91 | 91 |
} |
92 | 92 |
} |
93 | 93 |
|
94 |
-void ff_mpeg12_common_init(MpegEncContext *s) |
|
94 |
+av_cold void ff_mpeg12_common_init(MpegEncContext *s) |
|
95 | 95 |
{ |
96 | 96 |
|
97 | 97 |
s->y_dc_scale_table = |
... | ... |
@@ -32,6 +32,8 @@ |
32 | 32 |
#include "mpeg12.h" |
33 | 33 |
#include "mpeg12data.h" |
34 | 34 |
#include "bytestream.h" |
35 |
+ |
|
36 |
+#include "libavutil/attributes.h" |
|
35 | 37 |
#include "libavutil/log.h" |
36 | 38 |
#include "libavutil/opt.h" |
37 | 39 |
#include "libavutil/avassert.h" |
... | ... |
@@ -68,7 +70,8 @@ static uint32_t mpeg1_chr_dc_uni[512]; |
68 | 68 |
static uint8_t mpeg1_index_run[2][64]; |
69 | 69 |
static int8_t mpeg1_max_level[2][64]; |
70 | 70 |
|
71 |
-static void init_uni_ac_vlc(RLTable *rl, uint8_t *uni_ac_vlc_len){ |
|
71 |
+static av_cold void init_uni_ac_vlc(RLTable *rl, uint8_t *uni_ac_vlc_len) |
|
72 |
+{ |
|
72 | 73 |
int i; |
73 | 74 |
|
74 | 75 |
for(i=0; i<128; i++){ |
... | ... |
@@ -741,7 +744,7 @@ static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code) |
741 | 741 |
} |
742 | 742 |
} |
743 | 743 |
|
744 |
-void ff_mpeg1_encode_init(MpegEncContext *s) |
|
744 |
+av_cold void ff_mpeg1_encode_init(MpegEncContext *s) |
|
745 | 745 |
{ |
746 | 746 |
static int done=0; |
747 | 747 |
|
... | ... |
@@ -20,6 +20,7 @@ |
20 | 20 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
21 | 21 |
*/ |
22 | 22 |
|
23 |
+#include "libavutil/attributes.h" |
|
23 | 24 |
#include "libavutil/log.h" |
24 | 25 |
#include "libavutil/opt.h" |
25 | 26 |
#include "mpegvideo.h" |
... | ... |
@@ -1095,7 +1096,7 @@ void ff_mpeg4_encode_picture_header(MpegEncContext * s, int picture_number) |
1095 | 1095 |
} |
1096 | 1096 |
|
1097 | 1097 |
|
1098 |
-static void init_uni_dc_tab(void) |
|
1098 |
+static av_cold void init_uni_dc_tab(void) |
|
1099 | 1099 |
{ |
1100 | 1100 |
int level, uni_code, uni_len; |
1101 | 1101 |
|
... | ... |
@@ -1147,7 +1148,9 @@ static void init_uni_dc_tab(void) |
1147 | 1147 |
} |
1148 | 1148 |
} |
1149 | 1149 |
|
1150 |
-static void init_uni_mpeg4_rl_tab(RLTable *rl, uint32_t *bits_tab, uint8_t *len_tab){ |
|
1150 |
+static av_cold void init_uni_mpeg4_rl_tab(RLTable *rl, uint32_t *bits_tab, |
|
1151 |
+ uint8_t *len_tab) |
|
1152 |
+{ |
|
1151 | 1153 |
int slevel, run, last; |
1152 | 1154 |
|
1153 | 1155 |
av_assert0(MAX_LEVEL >= 64); |
... | ... |
@@ -24,6 +24,7 @@ |
24 | 24 |
* MPEG Audio decoder |
25 | 25 |
*/ |
26 | 26 |
|
27 |
+#include "libavutil/attributes.h" |
|
27 | 28 |
#include "libavutil/avassert.h" |
28 | 29 |
#include "libavutil/channel_layout.h" |
29 | 30 |
#include "libavutil/float_dsp.h" |
... | ... |
@@ -1846,7 +1847,7 @@ static av_cold int decode_close_mp3on4(AVCodecContext * avctx) |
1846 | 1846 |
} |
1847 | 1847 |
|
1848 | 1848 |
|
1849 |
-static int decode_init_mp3on4(AVCodecContext * avctx) |
|
1849 |
+static av_cold int decode_init_mp3on4(AVCodecContext * avctx) |
|
1850 | 1850 |
{ |
1851 | 1851 |
MP3On4DecodeContext *s = avctx->priv_data; |
1852 | 1852 |
MPEG4AudioConfig cfg; |
... | ... |
@@ -19,11 +19,12 @@ |
19 | 19 |
*/ |
20 | 20 |
|
21 | 21 |
#include "config.h" |
22 |
+#include "libavutil/attributes.h" |
|
22 | 23 |
#include "mpegaudiodsp.h" |
23 | 24 |
#include "dct.h" |
24 | 25 |
#include "dct32.h" |
25 | 26 |
|
26 |
-void ff_mpadsp_init(MPADSPContext *s) |
|
27 |
+av_cold void ff_mpadsp_init(MPADSPContext *s) |
|
27 | 28 |
{ |
28 | 29 |
DCTContext dct; |
29 | 30 |
|
... | ... |
@@ -20,6 +20,7 @@ |
20 | 20 |
|
21 | 21 |
#include <stdint.h> |
22 | 22 |
|
23 |
+#include "libavutil/attributes.h" |
|
23 | 24 |
#include "libavutil/mem.h" |
24 | 25 |
#include "dct32.h" |
25 | 26 |
#include "mathops.h" |
... | ... |
@@ -220,7 +221,7 @@ av_cold void RENAME(ff_mpa_synth_init)(MPA_INT *window) |
220 | 220 |
window[512+128+16*i+j] = window[64*i+48-j]; |
221 | 221 |
} |
222 | 222 |
|
223 |
-void RENAME(ff_init_mpadsp_tabs)(void) |
|
223 |
+av_cold void RENAME(ff_init_mpadsp_tabs)(void) |
|
224 | 224 |
{ |
225 | 225 |
int i, j; |
226 | 226 |
/* compute mdct windows */ |
... | ... |
@@ -27,6 +27,7 @@ |
27 | 27 |
* The simplest mpeg encoder (well, it was the simplest!). |
28 | 28 |
*/ |
29 | 29 |
|
30 |
+#include "libavutil/attributes.h" |
|
30 | 31 |
#include "libavutil/avassert.h" |
31 | 32 |
#include "libavutil/imgutils.h" |
32 | 33 |
#include "avcodec.h" |
... | ... |
@@ -1301,8 +1302,8 @@ void ff_MPV_common_end(MpegEncContext *s) |
1301 | 1301 |
s->linesize = s->uvlinesize = 0; |
1302 | 1302 |
} |
1303 | 1303 |
|
1304 |
-void ff_init_rl(RLTable *rl, |
|
1305 |
- uint8_t static_store[2][2 * MAX_RUN + MAX_LEVEL + 3]) |
|
1304 |
+av_cold void ff_init_rl(RLTable *rl, |
|
1305 |
+ uint8_t static_store[2][2 * MAX_RUN + MAX_LEVEL + 3]) |
|
1306 | 1306 |
{ |
1307 | 1307 |
int8_t max_level[MAX_RUN + 1], max_run[MAX_LEVEL + 1]; |
1308 | 1308 |
uint8_t index_run[MAX_RUN + 1]; |
... | ... |
@@ -1353,7 +1354,7 @@ void ff_init_rl(RLTable *rl, |
1353 | 1353 |
} |
1354 | 1354 |
} |
1355 | 1355 |
|
1356 |
-void ff_init_vlc_rl(RLTable *rl) |
|
1356 |
+av_cold void ff_init_vlc_rl(RLTable *rl) |
|
1357 | 1357 |
{ |
1358 | 1358 |
int i, q; |
1359 | 1359 |
|
... | ... |
@@ -30,6 +30,7 @@ |
30 | 30 |
#include <stdint.h> |
31 | 31 |
#include <string.h> |
32 | 32 |
|
33 |
+#include "libavutil/attributes.h" |
|
33 | 34 |
#include "libavutil/avutil.h" |
34 | 35 |
#include "libavutil/mem.h" |
35 | 36 |
#include "mpegvideo.h" |
... | ... |
@@ -45,7 +46,7 @@ |
45 | 45 |
static uint8_t rl_length[NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2]; |
46 | 46 |
|
47 | 47 |
/* build the table which associate a (x,y) motion vector to a vlc */ |
48 |
-static void init_mv_table(MVTable *tab) |
|
48 |
+static av_cold void init_mv_table(MVTable *tab) |
|
49 | 49 |
{ |
50 | 50 |
int i, x, y; |
51 | 51 |
|
... | ... |
@@ -19,6 +19,7 @@ |
19 | 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 |
*/ |
21 | 21 |
|
22 |
+#include "libavutil/attributes.h" |
|
22 | 23 |
#include "libavutil/common.h" |
23 | 24 |
#include "png.h" |
24 | 25 |
#include "pngdsp.h" |
... | ... |
@@ -39,7 +40,7 @@ static void add_bytes_l2_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w) |
39 | 39 |
dst[i] = src1[i] + src2[i]; |
40 | 40 |
} |
41 | 41 |
|
42 |
-void ff_pngdsp_init(PNGDSPContext *dsp) |
|
42 |
+av_cold void ff_pngdsp_init(PNGDSPContext *dsp) |
|
43 | 43 |
{ |
44 | 44 |
dsp->add_bytes_l2 = add_bytes_l2_c; |
45 | 45 |
dsp->add_paeth_prediction = ff_add_png_paeth_prediction; |
... | ... |
@@ -20,11 +20,12 @@ |
20 | 20 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
21 | 21 |
*/ |
22 | 22 |
|
23 |
+#include "libavutil/attributes.h" |
|
24 |
+#include "libavutil/common.h" |
|
23 | 25 |
#include "dct.h" |
24 | 26 |
#include "dsputil.h" |
25 | 27 |
#include "proresdsp.h" |
26 | 28 |
#include "simple_idct.h" |
27 |
-#include "libavutil/common.h" |
|
28 | 29 |
|
29 | 30 |
#define BIAS (1 << (PRORES_BITS_PER_SAMPLE - 1)) ///< bias value for converting signed pixels into unsigned ones |
30 | 31 |
#define CLIP_MIN (1 << (PRORES_BITS_PER_SAMPLE - 8)) ///< minimum value for clipping resulting pixels |
... | ... |
@@ -71,7 +72,7 @@ static void prores_fdct_c(const uint16_t *src, int linesize, int16_t *block) |
71 | 71 |
} |
72 | 72 |
#endif |
73 | 73 |
|
74 |
-void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx) |
|
74 |
+av_cold void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx) |
|
75 | 75 |
{ |
76 | 76 |
#if CONFIG_PRORES_DECODER | CONFIG_PRORES_LGPL_DECODER |
77 | 77 |
dsp->idct_put = prores_idct_put_c; |
... | ... |
@@ -26,6 +26,7 @@ |
26 | 26 |
* Dedicated to the mastermind behind it, Ralph Wiggum. |
27 | 27 |
*/ |
28 | 28 |
|
29 |
+#include "libavutil/attributes.h" |
|
29 | 30 |
#include "libavutil/channel_layout.h" |
30 | 31 |
#include "avcodec.h" |
31 | 32 |
#include "get_bits.h" |
... | ... |
@@ -72,7 +73,7 @@ typedef struct RALFContext { |
72 | 72 |
|
73 | 73 |
#define MAX_ELEMS 644 // no RALF table uses more than that |
74 | 74 |
|
75 |
-static int init_ralf_vlc(VLC *vlc, const uint8_t *data, int elems) |
|
75 |
+static av_cold int init_ralf_vlc(VLC *vlc, const uint8_t *data, int elems) |
|
76 | 76 |
{ |
77 | 77 |
uint8_t lens[MAX_ELEMS]; |
78 | 78 |
uint16_t codes[MAX_ELEMS]; |
... | ... |
@@ -33,12 +33,13 @@ |
33 | 33 |
|
34 | 34 |
#include <string.h> |
35 | 35 |
|
36 |
+#include "libavutil/attributes.h" |
|
36 | 37 |
#include "libavutil/avassert.h" |
37 | 38 |
#include "avcodec.h" |
38 | 39 |
#include "rangecoder.h" |
39 | 40 |
#include "bytestream.h" |
40 | 41 |
|
41 |
-void ff_init_range_encoder(RangeCoder *c, uint8_t *buf, int buf_size) |
|
42 |
+av_cold void ff_init_range_encoder(RangeCoder *c, uint8_t *buf, int buf_size) |
|
42 | 43 |
{ |
43 | 44 |
c->bytestream_start = |
44 | 45 |
c->bytestream = buf; |
... | ... |
@@ -49,7 +50,8 @@ void ff_init_range_encoder(RangeCoder *c, uint8_t *buf, int buf_size) |
49 | 49 |
c->outstanding_byte = -1; |
50 | 50 |
} |
51 | 51 |
|
52 |
-void ff_init_range_decoder(RangeCoder *c, const uint8_t *buf, int buf_size) |
|
52 |
+av_cold void ff_init_range_decoder(RangeCoder *c, const uint8_t *buf, |
|
53 |
+ int buf_size) |
|
53 | 54 |
{ |
54 | 55 |
/* cast to avoid compiler warning */ |
55 | 56 |
ff_init_range_encoder(c, (uint8_t *)buf, buf_size); |
... | ... |
@@ -25,6 +25,7 @@ |
25 | 25 |
* Rate control for video encoders. |
26 | 26 |
*/ |
27 | 27 |
|
28 |
+#include "libavutil/attributes.h" |
|
28 | 29 |
#include "avcodec.h" |
29 | 30 |
#include "ratecontrol.h" |
30 | 31 |
#include "mpegvideo.h" |
... | ... |
@@ -83,7 +84,7 @@ static inline double bits2qp(RateControlEntry *rce, double bits) |
83 | 83 |
return rce->qscale * (double)(rce->i_tex_bits + rce->p_tex_bits + 1) / bits; |
84 | 84 |
} |
85 | 85 |
|
86 |
-int ff_rate_control_init(MpegEncContext *s) |
|
86 |
+av_cold int ff_rate_control_init(MpegEncContext *s) |
|
87 | 87 |
{ |
88 | 88 |
RateControlContext *rcc = &s->rc_context; |
89 | 89 |
int i, res; |
... | ... |
@@ -296,7 +297,7 @@ int ff_rate_control_init(MpegEncContext *s) |
296 | 296 |
return 0; |
297 | 297 |
} |
298 | 298 |
|
299 |
-void ff_rate_control_uninit(MpegEncContext *s) |
|
299 |
+av_cold void ff_rate_control_uninit(MpegEncContext *s) |
|
300 | 300 |
{ |
301 | 301 |
RateControlContext *rcc = &s->rc_context; |
302 | 302 |
emms_c(); |
... | ... |
@@ -56,6 +56,7 @@ |
56 | 56 |
|
57 | 57 |
#include <string.h> |
58 | 58 |
|
59 |
+#include "libavutil/attributes.h" |
|
59 | 60 |
#include "roqvideo.h" |
60 | 61 |
#include "bytestream.h" |
61 | 62 |
#include "elbg.h" |
... | ... |
@@ -952,7 +953,7 @@ static int roq_encode_end(AVCodecContext *avctx) |
952 | 952 |
return 0; |
953 | 953 |
} |
954 | 954 |
|
955 |
-static int roq_encode_init(AVCodecContext *avctx) |
|
955 |
+static av_cold int roq_encode_init(AVCodecContext *avctx) |
|
956 | 956 |
{ |
957 | 957 |
RoqContext *enc = avctx->priv_data; |
958 | 958 |
|
... | ... |
@@ -24,6 +24,7 @@ |
24 | 24 |
#include <math.h> |
25 | 25 |
|
26 | 26 |
#include "sipr.h" |
27 |
+#include "libavutil/attributes.h" |
|
27 | 28 |
#include "libavutil/common.h" |
28 | 29 |
#include "libavutil/float_dsp.h" |
29 | 30 |
#include "libavutil/mathematics.h" |
... | ... |
@@ -268,7 +269,7 @@ void ff_sipr_decode_frame_16k(SiprContext *ctx, SiprParameters *params, |
268 | 268 |
memcpy(ctx->iir_mem, Az[1], LP_FILTER_ORDER_16k * sizeof(float)); |
269 | 269 |
} |
270 | 270 |
|
271 |
-void ff_sipr_init_16k(SiprContext *ctx) |
|
271 |
+av_cold void ff_sipr_init_16k(SiprContext *ctx) |
|
272 | 272 |
{ |
273 | 273 |
int i; |
274 | 274 |
|
... | ... |
@@ -26,6 +26,7 @@ |
26 | 26 |
*/ |
27 | 27 |
|
28 | 28 |
#include "config.h" |
29 |
+#include "libavutil/attributes.h" |
|
29 | 30 |
#include "libavutil/avassert.h" |
30 | 31 |
#include "libavutil/avstring.h" |
31 | 32 |
#include "libavutil/bprint.h" |
... | ... |
@@ -133,7 +134,7 @@ AVCodec *av_codec_next(const AVCodec *c) |
133 | 133 |
return first_avcodec; |
134 | 134 |
} |
135 | 135 |
|
136 |
-static void avcodec_init(void) |
|
136 |
+static av_cold void avcodec_init(void) |
|
137 | 137 |
{ |
138 | 138 |
static int initialized = 0; |
139 | 139 |
|
... | ... |
@@ -155,7 +156,7 @@ int av_codec_is_decoder(const AVCodec *codec) |
155 | 155 |
return codec && codec->decode; |
156 | 156 |
} |
157 | 157 |
|
158 |
-void avcodec_register(AVCodec *codec) |
|
158 |
+av_cold void avcodec_register(AVCodec *codec) |
|
159 | 159 |
{ |
160 | 160 |
AVCodec **p; |
161 | 161 |
avcodec_init(); |
... | ... |
@@ -27,6 +27,7 @@ |
27 | 27 |
* |
28 | 28 |
*/ |
29 | 29 |
|
30 |
+#include "libavutil/attributes.h" |
|
30 | 31 |
#include "internal.h" |
31 | 32 |
#include "avcodec.h" |
32 | 33 |
#include "mpegvideo.h" |
... | ... |
@@ -1575,7 +1576,7 @@ static const uint16_t vlc_offs[] = { |
1575 | 1575 |
* @param v The VC1Context to initialize |
1576 | 1576 |
* @return Status |
1577 | 1577 |
*/ |
1578 |
-int ff_vc1_init_common(VC1Context *v) |
|
1578 |
+av_cold int ff_vc1_init_common(VC1Context *v) |
|
1579 | 1579 |
{ |
1580 | 1580 |
static int done = 0; |
1581 | 1581 |
int i = 0; |
... | ... |
@@ -25,6 +25,7 @@ |
25 | 25 |
* VC-1 and WMV3 parser |
26 | 26 |
*/ |
27 | 27 |
|
28 |
+#include "libavutil/attributes.h" |
|
28 | 29 |
#include "parser.h" |
29 | 30 |
#include "vc1.h" |
30 | 31 |
#include "get_bits.h" |
... | ... |
@@ -189,7 +190,7 @@ static int vc1_split(AVCodecContext *avctx, |
189 | 189 |
return 0; |
190 | 190 |
} |
191 | 191 |
|
192 |
-static int vc1_parse_init(AVCodecParserContext *s) |
|
192 |
+static av_cold int vc1_parse_init(AVCodecParserContext *s) |
|
193 | 193 |
{ |
194 | 194 |
VC1ParseContext *vpc = s->priv_data; |
195 | 195 |
vpc->v.s.slice_context_count = 1; |
... | ... |
@@ -18,6 +18,7 @@ |
18 | 18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
19 | 19 |
*/ |
20 | 20 |
|
21 |
+#include "libavutil/attributes.h" |
|
21 | 22 |
#include "libavutil/avassert.h" |
22 | 23 |
#include "libavutil/common.h" |
23 | 24 |
#include "videodsp.h" |
... | ... |
@@ -34,7 +35,7 @@ static void just_return(uint8_t *buf, ptrdiff_t stride, int h) |
34 | 34 |
{ |
35 | 35 |
} |
36 | 36 |
|
37 |
-void ff_videodsp_init(VideoDSPContext *ctx, int bpc) |
|
37 |
+av_cold void ff_videodsp_init(VideoDSPContext *ctx, int bpc) |
|
38 | 38 |
{ |
39 | 39 |
ctx->prefetch = just_return; |
40 | 40 |
if (bpc <= 8) { |
... | ... |
@@ -17,10 +17,11 @@ |
17 | 17 |
*/ |
18 | 18 |
|
19 | 19 |
#include "config.h" |
20 |
+#include "libavutil/attributes.h" |
|
20 | 21 |
#include "vorbisdsp.h" |
21 | 22 |
#include "vorbis.h" |
22 | 23 |
|
23 |
-void ff_vorbisdsp_init(VorbisDSPContext *dsp) |
|
24 |
+av_cold void ff_vorbisdsp_init(VorbisDSPContext *dsp) |
|
24 | 25 |
{ |
25 | 26 |
dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling; |
26 | 27 |
|
... | ... |
@@ -20,6 +20,8 @@ |
20 | 20 |
*/ |
21 | 21 |
|
22 | 22 |
#include <stdint.h> |
23 |
+ |
|
24 |
+#include "libavutil/attributes.h" |
|
23 | 25 |
#include "avcodec.h" |
24 | 26 |
#include "vp56dsp.h" |
25 | 27 |
#include "libavutil/common.h" |
... | ... |
@@ -75,7 +77,7 @@ VP56_EDGE_FILTER(vp5, ver, stride, 1) |
75 | 75 |
VP56_EDGE_FILTER(vp6, hor, 1, stride) |
76 | 76 |
VP56_EDGE_FILTER(vp6, ver, stride, 1) |
77 | 77 |
|
78 |
-void ff_vp56dsp_init(VP56DSPContext *s, enum AVCodecID codec) |
|
78 |
+av_cold void ff_vp56dsp_init(VP56DSPContext *s, enum AVCodecID codec) |
|
79 | 79 |
{ |
80 | 80 |
if (codec == AV_CODEC_ID_VP5) { |
81 | 81 |
s->edge_filter_hor = vp5_edge_filter_hor; |
... | ... |
@@ -19,6 +19,7 @@ |
19 | 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 |
*/ |
21 | 21 |
|
22 |
+#include "libavutil/attributes.h" |
|
22 | 23 |
#include "avcodec.h" |
23 | 24 |
#include "sinewin.h" |
24 | 25 |
#include "wma.h" |
... | ... |
@@ -30,9 +31,9 @@ |
30 | 30 |
|
31 | 31 |
/* XXX: use same run/length optimization as mpeg decoders */ |
32 | 32 |
//FIXME maybe split decode / encode or pass flag |
33 |
-static void init_coef_vlc(VLC *vlc, uint16_t **prun_table, |
|
34 |
- float **plevel_table, uint16_t **pint_table, |
|
35 |
- const CoefVLCTable *vlc_table) |
|
33 |
+static av_cold void init_coef_vlc(VLC *vlc, uint16_t **prun_table, |
|
34 |
+ float **plevel_table, uint16_t **pint_table, |
|
35 |
+ const CoefVLCTable *vlc_table) |
|
36 | 36 |
{ |
37 | 37 |
int n = vlc_table->n; |
38 | 38 |
const uint8_t *table_bits = vlc_table->huffbits; |
... | ... |
@@ -68,7 +69,7 @@ static void init_coef_vlc(VLC *vlc, uint16_t **prun_table, |
68 | 68 |
av_free(level_table); |
69 | 69 |
} |
70 | 70 |
|
71 |
-int ff_wma_init(AVCodecContext *avctx, int flags2) |
|
71 |
+av_cold int ff_wma_init(AVCodecContext *avctx, int flags2) |
|
72 | 72 |
{ |
73 | 73 |
WMACodecContext *s = avctx->priv_data; |
74 | 74 |
int i; |
... | ... |
@@ -33,6 +33,7 @@ |
33 | 33 |
* should be 4 extra bytes for v1 data and 6 extra bytes for v2 data. |
34 | 34 |
*/ |
35 | 35 |
|
36 |
+#include "libavutil/attributes.h" |
|
36 | 37 |
#include "avcodec.h" |
37 | 38 |
#include "internal.h" |
38 | 39 |
#include "wma.h" |
... | ... |
@@ -66,7 +67,7 @@ static void dump_floats(WMACodecContext *s, const char *name, int prec, const fl |
66 | 66 |
} |
67 | 67 |
#endif |
68 | 68 |
|
69 |
-static int wma_decode_init(AVCodecContext * avctx) |
|
69 |
+static av_cold int wma_decode_init(AVCodecContext * avctx) |
|
70 | 70 |
{ |
71 | 71 |
WMACodecContext *s = avctx->priv_data; |
72 | 72 |
int i, flags2; |
... | ... |
@@ -150,7 +151,7 @@ static inline float pow_m1_4(WMACodecContext *s, float x) |
150 | 150 |
return s->lsp_pow_e_table[e] * (a + b * t.f); |
151 | 151 |
} |
152 | 152 |
|
153 |
-static void wma_lsp_to_curve_init(WMACodecContext *s, int frame_len) |
|
153 |
+static av_cold void wma_lsp_to_curve_init(WMACodecContext *s, int frame_len) |
|
154 | 154 |
{ |
155 | 155 |
float wdel, a, b; |
156 | 156 |
int i, e, m; |
... | ... |
@@ -19,13 +19,15 @@ |
19 | 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | 20 |
*/ |
21 | 21 |
|
22 |
+#include "libavutil/attributes.h" |
|
22 | 23 |
#include "avcodec.h" |
23 | 24 |
#include "internal.h" |
24 | 25 |
#include "wma.h" |
25 | 26 |
#include "libavutil/avassert.h" |
26 | 27 |
|
27 | 28 |
|
28 |
-static int encode_init(AVCodecContext * avctx){ |
|
29 |
+static av_cold int encode_init(AVCodecContext *avctx) |
|
30 |
+{ |
|
29 | 31 |
WMACodecContext *s = avctx->priv_data; |
30 | 32 |
int i, flags1, flags2, block_align; |
31 | 33 |
uint8_t *extradata; |
... | ... |
@@ -19,6 +19,7 @@ |
19 | 19 |
#include <stdint.h> |
20 | 20 |
|
21 | 21 |
#include "config.h" |
22 |
+#include "libavutil/attributes.h" |
|
22 | 23 |
#include "libavutil/cpu.h" |
23 | 24 |
#include "libavutil/x86/cpu.h" |
24 | 25 |
#include "libavcodec/h264chroma.h" |
... | ... |
@@ -66,7 +67,7 @@ CHROMA_MC(avg, 8, 10, sse2) |
66 | 66 |
CHROMA_MC(put, 8, 10, avx) |
67 | 67 |
CHROMA_MC(avg, 8, 10, avx) |
68 | 68 |
|
69 |
-void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth) |
|
69 |
+av_cold void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth) |
|
70 | 70 |
{ |
71 | 71 |
#if HAVE_YASM |
72 | 72 |
int high_bit_depth = bit_depth > 8; |
... | ... |
@@ -20,6 +20,7 @@ |
20 | 20 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
21 | 21 |
*/ |
22 | 22 |
|
23 |
+#include "libavutil/attributes.h" |
|
23 | 24 |
#include "libavutil/x86/cpu.h" |
24 | 25 |
#include "libavcodec/dsputil.h" |
25 | 26 |
#include "libavcodec/proresdsp.h" |
... | ... |
@@ -31,7 +32,7 @@ void ff_prores_idct_put_10_sse4(uint16_t *dst, int linesize, |
31 | 31 |
void ff_prores_idct_put_10_avx (uint16_t *dst, int linesize, |
32 | 32 |
int16_t *block, const int16_t *qmat); |
33 | 33 |
|
34 |
-void ff_proresdsp_x86_init(ProresDSPContext *dsp, AVCodecContext *avctx) |
|
34 |
+av_cold void ff_proresdsp_x86_init(ProresDSPContext *dsp, AVCodecContext *avctx) |
|
35 | 35 |
{ |
36 | 36 |
#if ARCH_X86_64 |
37 | 37 |
int flags = av_get_cpu_flags(); |