comparison h264.c @ 6517:48759bfbd073 libavcodec

Apply 'cold' attribute to init/uninit functions in libavcodec
author zuxy
date Fri, 21 Mar 2008 03:11:20 +0000
parents bb799e3bc64b
children 01647ac078a7
comparison
equal deleted inserted replaced
6516:dbb902bb2347 6517:48759bfbd073
1950 } 1950 }
1951 1951
1952 prefetch_motion(h, 1); 1952 prefetch_motion(h, 1);
1953 } 1953 }
1954 1954
1955 static void decode_init_vlc(void){ 1955 static av_cold void decode_init_vlc(void){
1956 static int done = 0; 1956 static int done = 0;
1957 1957
1958 if (!done) { 1958 if (!done) {
1959 int i; 1959 int i;
1960 done = 1; 1960 done = 1;
2164 return 0; 2164 return 0;
2165 fail: 2165 fail:
2166 return -1; // free_tables will clean up for us 2166 return -1; // free_tables will clean up for us
2167 } 2167 }
2168 2168
2169 static void common_init(H264Context *h){ 2169 static av_cold void common_init(H264Context *h){
2170 MpegEncContext * const s = &h->s; 2170 MpegEncContext * const s = &h->s;
2171 2171
2172 s->width = s->avctx->width; 2172 s->width = s->avctx->width;
2173 s->height = s->avctx->height; 2173 s->height = s->avctx->height;
2174 s->codec_id= s->avctx->codec->id; 2174 s->codec_id= s->avctx->codec->id;
2181 2181
2182 memset(h->pps.scaling_matrix4, 16, 6*16*sizeof(uint8_t)); 2182 memset(h->pps.scaling_matrix4, 16, 6*16*sizeof(uint8_t));
2183 memset(h->pps.scaling_matrix8, 16, 2*64*sizeof(uint8_t)); 2183 memset(h->pps.scaling_matrix8, 16, 2*64*sizeof(uint8_t));
2184 } 2184 }
2185 2185
2186 static int decode_init(AVCodecContext *avctx){ 2186 static av_cold int decode_init(AVCodecContext *avctx){
2187 H264Context *h= avctx->priv_data; 2187 H264Context *h= avctx->priv_data;
2188 MpegEncContext * const s = &h->s; 2188 MpegEncContext * const s = &h->s;
2189 2189
2190 MPV_decode_defaults(s); 2190 MPV_decode_defaults(s);
2191 2191
8052 return 0; 8052 return 0;
8053 } 8053 }
8054 #endif /* TEST */ 8054 #endif /* TEST */
8055 8055
8056 8056
8057 static int decode_end(AVCodecContext *avctx) 8057 static av_cold int decode_end(AVCodecContext *avctx)
8058 { 8058 {
8059 H264Context *h = avctx->priv_data; 8059 H264Context *h = avctx->priv_data;
8060 MpegEncContext *s = &h->s; 8060 MpegEncContext *s = &h->s;
8061 8061
8062 av_freep(&h->rbsp_buffer[0]); 8062 av_freep(&h->rbsp_buffer[0]);