Libav
|
00001 /* 00002 * This file is part of FFmpeg. 00003 * 00004 * FFmpeg is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * FFmpeg is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with FFmpeg; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00017 */ 00018 00019 #ifndef AVCODEC_AVFFT_H 00020 #define AVCODEC_AVFFT_H 00021 00022 typedef float FFTSample; 00023 00024 typedef struct FFTComplex { 00025 FFTSample re, im; 00026 } FFTComplex; 00027 00028 typedef struct FFTContext FFTContext; 00029 00035 FFTContext *av_fft_init(int nbits, int inverse); 00036 00040 void av_fft_permute(FFTContext *s, FFTComplex *z); 00041 00046 void av_fft_calc(FFTContext *s, FFTComplex *z); 00047 00048 void av_fft_end(FFTContext *s); 00049 00050 FFTContext *av_mdct_init(int nbits, int inverse, double scale); 00051 void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); 00052 void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input); 00053 void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); 00054 void av_mdct_end(FFTContext *s); 00055 00056 /* Real Discrete Fourier Transform */ 00057 00058 enum RDFTransformType { 00059 DFT_R2C, 00060 IDFT_C2R, 00061 IDFT_R2C, 00062 DFT_C2R, 00063 }; 00064 00065 typedef struct RDFTContext RDFTContext; 00066 00072 RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans); 00073 void av_rdft_calc(RDFTContext *s, FFTSample *data); 00074 void av_rdft_end(RDFTContext *s); 00075 00076 /* Discrete Cosine Transform */ 00077 00078 typedef struct DCTContext DCTContext; 00079 00080 enum DCTTransformType { 00081 DCT_II = 0, 00082 DCT_III, 00083 DCT_I, 00084 DST_I, 00085 }; 00086 00095 DCTContext *av_dct_init(int nbits, enum DCTTransformType type); 00096 void av_dct_calc(DCTContext *s, FFTSample *data); 00097 void av_dct_end (DCTContext *s); 00098 00099 #endif /* AVCODEC_AVFFT_H */