Mercurial > libavcodec.hg
comparison avfft.c @ 12157:65462b406d6b libavcodec
100l: really fix fft external API init functions
author | mru |
---|---|
date | Tue, 13 Jul 2010 06:54:31 +0000 |
parents | fb37ee915b73 |
children | 3212dfbe4c96 |
comparison
equal
deleted
inserted
replaced
12156:b1c9654b8d68 | 12157:65462b406d6b |
---|---|
24 | 24 |
25 FFTContext *av_fft_init(int nbits, int inverse) | 25 FFTContext *av_fft_init(int nbits, int inverse) |
26 { | 26 { |
27 FFTContext *s = av_malloc(sizeof(*s)); | 27 FFTContext *s = av_malloc(sizeof(*s)); |
28 | 28 |
29 if (s) | 29 if (s && ff_fft_init(s, nbits, inverse)) |
30 ff_fft_init(s, nbits, inverse); | |
31 else | |
32 av_freep(&s); | 30 av_freep(&s); |
33 | 31 |
34 return s; | 32 return s; |
35 } | 33 } |
36 | 34 |
56 | 54 |
57 FFTContext *av_mdct_init(int nbits, int inverse, double scale) | 55 FFTContext *av_mdct_init(int nbits, int inverse, double scale) |
58 { | 56 { |
59 FFTContext *s = av_malloc(sizeof(*s)); | 57 FFTContext *s = av_malloc(sizeof(*s)); |
60 | 58 |
61 if (s) | 59 if (s && ff_mdct_init(s, nbits, inverse, scale)) |
62 ff_mdct_init(s, nbits, inverse, scale); | |
63 else | |
64 av_freep(&s); | 60 av_freep(&s); |
65 | 61 |
66 return s; | 62 return s; |
67 } | 63 } |
68 | 64 |
95 | 91 |
96 RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans) | 92 RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans) |
97 { | 93 { |
98 RDFTContext *s = av_malloc(sizeof(*s)); | 94 RDFTContext *s = av_malloc(sizeof(*s)); |
99 | 95 |
100 if (s) | 96 if (s && ff_rdft_init(s, nbits, trans)) |
101 ff_rdft_init(s, nbits, trans); | |
102 else | |
103 av_freep(&s); | 97 av_freep(&s); |
104 | 98 |
105 return s; | 99 return s; |
106 } | 100 } |
107 | 101 |
124 | 118 |
125 DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse) | 119 DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse) |
126 { | 120 { |
127 DCTContext *s = av_malloc(sizeof(*s)); | 121 DCTContext *s = av_malloc(sizeof(*s)); |
128 | 122 |
129 if (s) | 123 if (s && (ff_dct_init(s, nbits, inverse))) |
130 ff_dct_init(s, nbits, inverse); | |
131 else | |
132 av_freep(&s); | 124 av_freep(&s); |
133 | 125 |
134 return s; | 126 return s; |
135 } | 127 } |
136 | 128 |