Mercurial > libavcodec.hg
comparison cook.c @ 9007:043574c5c153 libavcodec
Add missing av_cold in static init/close functions.
Patch by Daniel Verkamp daniel at drv dot nu.
author | stefano |
---|---|
date | Sun, 22 Feb 2009 13:48:55 +0000 |
parents | 15ea0238bade |
children | fb675a9727f0 |
comparison
equal
deleted
inserted
replaced
9006:37ac731fe32c | 9007:043574c5c153 |
---|---|
181 #endif | 181 #endif |
182 | 182 |
183 /*************** init functions ***************/ | 183 /*************** init functions ***************/ |
184 | 184 |
185 /* table generator */ | 185 /* table generator */ |
186 static void init_pow2table(void){ | 186 static av_cold void init_pow2table(void){ |
187 int i; | 187 int i; |
188 for (i=-63 ; i<64 ; i++){ | 188 for (i=-63 ; i<64 ; i++){ |
189 pow2tab[63+i]= pow(2, i); | 189 pow2tab[63+i]= pow(2, i); |
190 rootpow2tab[63+i]=sqrt(pow(2, i)); | 190 rootpow2tab[63+i]=sqrt(pow(2, i)); |
191 } | 191 } |
192 } | 192 } |
193 | 193 |
194 /* table generator */ | 194 /* table generator */ |
195 static void init_gain_table(COOKContext *q) { | 195 static av_cold void init_gain_table(COOKContext *q) { |
196 int i; | 196 int i; |
197 q->gain_size_factor = q->samples_per_channel/8; | 197 q->gain_size_factor = q->samples_per_channel/8; |
198 for (i=0 ; i<23 ; i++) { | 198 for (i=0 ; i<23 ; i++) { |
199 q->gain_table[i] = pow(pow2tab[i+52] , | 199 q->gain_table[i] = pow(pow2tab[i+52] , |
200 (1.0/(double)q->gain_size_factor)); | 200 (1.0/(double)q->gain_size_factor)); |
201 } | 201 } |
202 } | 202 } |
203 | 203 |
204 | 204 |
205 static int init_cook_vlc_tables(COOKContext *q) { | 205 static av_cold int init_cook_vlc_tables(COOKContext *q) { |
206 int i, result; | 206 int i, result; |
207 | 207 |
208 result = 0; | 208 result = 0; |
209 for (i=0 ; i<13 ; i++) { | 209 for (i=0 ; i<13 ; i++) { |
210 result |= init_vlc (&q->envelope_quant_index[i], 9, 24, | 210 result |= init_vlc (&q->envelope_quant_index[i], 9, 24, |
227 | 227 |
228 av_log(NULL,AV_LOG_DEBUG,"VLC tables initialized.\n"); | 228 av_log(NULL,AV_LOG_DEBUG,"VLC tables initialized.\n"); |
229 return result; | 229 return result; |
230 } | 230 } |
231 | 231 |
232 static int init_cook_mlt(COOKContext *q) { | 232 static av_cold int init_cook_mlt(COOKContext *q) { |
233 int j; | 233 int j; |
234 int mlt_size = q->samples_per_channel; | 234 int mlt_size = q->samples_per_channel; |
235 | 235 |
236 if ((q->mlt_window = av_malloc(sizeof(float)*mlt_size)) == 0) | 236 if ((q->mlt_window = av_malloc(sizeof(float)*mlt_size)) == 0) |
237 return -1; | 237 return -1; |
256 { | 256 { |
257 if (1) | 257 if (1) |
258 return ptr; | 258 return ptr; |
259 } | 259 } |
260 | 260 |
261 static void init_cplscales_table (COOKContext *q) { | 261 static av_cold void init_cplscales_table (COOKContext *q) { |
262 int i; | 262 int i; |
263 for (i=0;i<5;i++) | 263 for (i=0;i<5;i++) |
264 q->cplscales[i] = maybe_reformat_buffer32 (q, cplscales[i], (1<<(i+2))-1); | 264 q->cplscales[i] = maybe_reformat_buffer32 (q, cplscales[i], (1<<(i+2))-1); |
265 } | 265 } |
266 | 266 |
312 | 312 |
313 /** | 313 /** |
314 * Cook uninit | 314 * Cook uninit |
315 */ | 315 */ |
316 | 316 |
317 static int cook_decode_close(AVCodecContext *avctx) | 317 static av_cold int cook_decode_close(AVCodecContext *avctx) |
318 { | 318 { |
319 int i; | 319 int i; |
320 COOKContext *q = avctx->priv_data; | 320 COOKContext *q = avctx->priv_data; |
321 av_log(avctx,AV_LOG_DEBUG, "Deallocating memory.\n"); | 321 av_log(avctx,AV_LOG_DEBUG, "Deallocating memory.\n"); |
322 | 322 |