comparison mdct.c @ 8737:eeca2fc122f8 libavcodec

Add av_cold attributes to *_init and *_end functions.
author alexc
date Tue, 03 Feb 2009 23:09:00 +0000
parents e9d9d946f213
children 0975a4c09974
comparison
equal deleted inserted replaced
8736:f973fff63599 8737:eeca2fc122f8
25 * MDCT/IMDCT transforms. 25 * MDCT/IMDCT transforms.
26 */ 26 */
27 27
28 // Generate a Kaiser-Bessel Derived Window. 28 // Generate a Kaiser-Bessel Derived Window.
29 #define BESSEL_I0_ITER 50 // default: 50 iterations of Bessel I0 approximation 29 #define BESSEL_I0_ITER 50 // default: 50 iterations of Bessel I0 approximation
30 void ff_kbd_window_init(float *window, float alpha, int n) 30 av_cold void ff_kbd_window_init(float *window, float alpha, int n)
31 { 31 {
32 int i, j; 32 int i, j;
33 double sum = 0.0, bessel, tmp; 33 double sum = 0.0, bessel, tmp;
34 double local_window[n]; 34 double local_window[n];
35 double alpha2 = (alpha * M_PI / n) * (alpha * M_PI / n); 35 double alpha2 = (alpha * M_PI / n) * (alpha * M_PI / n);
57 float *ff_sine_windows[6] = { 57 float *ff_sine_windows[6] = {
58 ff_sine_128, ff_sine_256, ff_sine_512, ff_sine_1024, ff_sine_2048, ff_sine_4096 58 ff_sine_128, ff_sine_256, ff_sine_512, ff_sine_1024, ff_sine_2048, ff_sine_4096
59 }; 59 };
60 60
61 // Generate a sine window. 61 // Generate a sine window.
62 void ff_sine_window_init(float *window, int n) { 62 av_cold void ff_sine_window_init(float *window, int n) {
63 int i; 63 int i;
64 for(i = 0; i < n; i++) 64 for(i = 0; i < n; i++)
65 window[i] = sinf((i + 0.5) * (M_PI / (2.0 * n))); 65 window[i] = sinf((i + 0.5) * (M_PI / (2.0 * n)));
66 } 66 }
67 67
68 /** 68 /**
69 * init MDCT or IMDCT computation. 69 * init MDCT or IMDCT computation.
70 */ 70 */
71 int ff_mdct_init(MDCTContext *s, int nbits, int inverse) 71 av_cold int ff_mdct_init(MDCTContext *s, int nbits, int inverse)
72 { 72 {
73 int n, n4, i; 73 int n, n4, i;
74 double alpha; 74 double alpha;
75 75
76 memset(s, 0, sizeof(*s)); 76 memset(s, 0, sizeof(*s));
221 x[n8+i ].re = r1; 221 x[n8+i ].re = r1;
222 x[n8+i ].im = i1; 222 x[n8+i ].im = i1;
223 } 223 }
224 } 224 }
225 225
226 void ff_mdct_end(MDCTContext *s) 226 av_cold void ff_mdct_end(MDCTContext *s)
227 { 227 {
228 av_freep(&s->tcos); 228 av_freep(&s->tcos);
229 av_freep(&s->tsin); 229 av_freep(&s->tsin);
230 ff_fft_end(&s->fft); 230 ff_fft_end(&s->fft);
231 } 231 }