2 * This file is part of Libav.
4 * Libav 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.
9 * Libav 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.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with Libav; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #include "libavutil/mem.h"
27 FFTContext *av_fft_init(int nbits, int inverse)
29 FFTContext *s = av_malloc(sizeof(*s));
31 if (s && ff_fft_init(s, nbits, inverse))
37 void av_fft_permute(FFTContext *s, FFTComplex *z)
42 void av_fft_calc(FFTContext *s, FFTComplex *z)
47 void av_fft_end(FFTContext *s)
57 FFTContext *av_mdct_init(int nbits, int inverse, double scale)
59 FFTContext *s = av_malloc(sizeof(*s));
61 if (s && ff_mdct_init(s, nbits, inverse, scale))
67 void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
69 s->imdct_calc(s, output, input);
72 void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input)
74 s->imdct_half(s, output, input);
77 void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
79 s->mdct_calc(s, output, input);
82 void av_mdct_end(FFTContext *s)
90 #endif /* CONFIG_MDCT */
94 RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans)
96 RDFTContext *s = av_malloc(sizeof(*s));
98 if (s && ff_rdft_init(s, nbits, trans))
104 void av_rdft_calc(RDFTContext *s, FFTSample *data)
106 s->rdft_calc(s, data);
109 void av_rdft_end(RDFTContext *s)
117 #endif /* CONFIG_RDFT */
121 DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse)
123 DCTContext *s = av_malloc(sizeof(*s));
125 if (s && ff_dct_init(s, nbits, inverse))
131 void av_dct_calc(DCTContext *s, FFTSample *data)
133 s->dct_calc(s, data);
136 void av_dct_end(DCTContext *s)
144 #endif /* CONFIG_DCT */