Mercurial > libavcodec.hg
annotate avfft.c @ 11671:7f301b81b503 libavcodec
Move the SBR patch count check to prevent overwrites.
Thanks to Chromium.
author | alexc |
---|---|
date | Fri, 30 Apr 2010 23:08:44 +0000 |
parents | f468aac92300 |
children | fb37ee915b73 |
rev | line source |
---|---|
11392 | 1 /* |
2 * This file is part of FFmpeg. | |
3 * | |
4 * FFmpeg is free software; you can redistribute it and/or | |
5 * modify it under the terms of the GNU Lesser General Public | |
6 * License as published by the Free Software Foundation; either | |
7 * version 2.1 of the License, or (at your option) any later version. | |
8 * | |
9 * FFmpeg is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 * Lesser General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU Lesser General Public | |
15 * License along with FFmpeg; if not, write to the Free Software | |
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
17 */ | |
18 | |
19 #include "libavutil/mem.h" | |
20 #include "avfft.h" | |
21 #include "fft.h" | |
22 | |
23 /* FFT */ | |
24 | |
25 FFTContext *av_fft_init(int nbits, int inverse) | |
26 { | |
27 FFTContext *s = av_malloc(sizeof(*s)); | |
28 | |
29 if (s) | |
30 ff_fft_init(s, nbits, inverse); | |
31 | |
32 return s; | |
33 } | |
34 | |
35 void av_fft_permute(FFTContext *s, FFTComplex *z) | |
36 { | |
37 s->fft_permute(s, z); | |
38 } | |
39 | |
40 void av_fft_calc(FFTContext *s, FFTComplex *z) | |
41 { | |
42 s->fft_calc(s, z); | |
43 } | |
44 | |
45 void av_fft_end(FFTContext *s) | |
46 { | |
47 if (s) { | |
48 ff_fft_end(s); | |
49 av_free(s); | |
50 } | |
51 } | |
52 | |
53 #if CONFIG_MDCT | |
54 | |
55 FFTContext *av_mdct_init(int nbits, int inverse, double scale) | |
56 { | |
57 FFTContext *s = av_malloc(sizeof(*s)); | |
58 | |
59 if (s) | |
60 ff_mdct_init(s, nbits, inverse, scale); | |
61 | |
62 return s; | |
63 } | |
64 | |
65 void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input) | |
66 { | |
67 s->imdct_calc(s, output, input); | |
68 } | |
69 | |
70 void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input) | |
71 { | |
72 s->imdct_half(s, output, input); | |
73 } | |
74 | |
75 void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input) | |
76 { | |
77 s->mdct_calc(s, output, input); | |
78 } | |
79 | |
80 void av_mdct_end(FFTContext *s) | |
81 { | |
82 if (s) { | |
83 ff_mdct_end(s); | |
84 av_free(s); | |
85 } | |
86 } | |
87 | |
88 #endif /* CONFIG_MDCT */ | |
89 | |
90 #if CONFIG_RDFT | |
91 | |
92 RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans) | |
93 { | |
94 RDFTContext *s = av_malloc(sizeof(*s)); | |
95 | |
96 if (s) | |
97 ff_rdft_init(s, nbits, trans); | |
98 | |
99 return s; | |
100 } | |
101 | |
102 void av_rdft_calc(RDFTContext *s, FFTSample *data) | |
103 { | |
104 ff_rdft_calc(s, data); | |
105 } | |
106 | |
107 void av_rdft_end(RDFTContext *s) | |
108 { | |
109 if (s) { | |
110 ff_rdft_end(s); | |
111 av_free(s); | |
112 } | |
113 } | |
114 | |
115 #endif /* CONFIG_RDFT */ | |
116 | |
117 #if CONFIG_DCT | |
118 | |
11535
f468aac92300
Implement the discrete sine/cosine transforms DCT-I and DST-I
vitor
parents:
11392
diff
changeset
|
119 DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse) |
11392 | 120 { |
121 DCTContext *s = av_malloc(sizeof(*s)); | |
122 | |
123 if (s) | |
124 ff_dct_init(s, nbits, inverse); | |
125 | |
126 return s; | |
127 } | |
128 | |
129 void av_dct_calc(DCTContext *s, FFTSample *data) | |
130 { | |
131 ff_dct_calc(s, data); | |
132 } | |
133 | |
134 void av_dct_end(DCTContext *s) | |
135 { | |
136 if (s) { | |
137 ff_dct_end(s); | |
138 av_free(s); | |
139 } | |
140 } | |
141 | |
142 #endif /* CONFIG_DCT */ |