Path: blob/a-new-beginning/libavcodec.xcframework/macos-arm64/libavcodec.framework/Versions/A/Headers/avfft.h
2 views
/*1* This file is part of FFmpeg.2*3* FFmpeg is free software; you can redistribute it and/or4* modify it under the terms of the GNU Lesser General Public5* License as published by the Free Software Foundation; either6* version 2.1 of the License, or (at your option) any later version.7*8* FFmpeg is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU11* Lesser General Public License for more details.12*13* You should have received a copy of the GNU Lesser General Public14* License along with FFmpeg; if not, write to the Free Software15* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA16*/1718#ifndef AVCODEC_AVFFT_H19#define AVCODEC_AVFFT_H2021/**22* @file23* @ingroup lavc_fft24* FFT functions25*/2627/**28* @defgroup lavc_fft FFT functions29* @ingroup lavc_misc30*31* @{32*/3334typedef float FFTSample;3536typedef struct FFTComplex {37FFTSample re, im;38} FFTComplex;3940typedef struct FFTContext FFTContext;4142/**43* Set up a complex FFT.44* @param nbits log2 of the length of the input array45* @param inverse if 0 perform the forward transform, if 1 perform the inverse46*/47FFTContext *av_fft_init(int nbits, int inverse);4849/**50* Do the permutation needed BEFORE calling ff_fft_calc().51*/52void av_fft_permute(FFTContext *s, FFTComplex *z);5354/**55* Do a complex FFT with the parameters defined in av_fft_init(). The56* input data must be permuted before. No 1.0/sqrt(n) normalization is done.57*/58void av_fft_calc(FFTContext *s, FFTComplex *z);5960void av_fft_end(FFTContext *s);6162FFTContext *av_mdct_init(int nbits, int inverse, double scale);63void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);64void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input);65void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);66void av_mdct_end(FFTContext *s);6768/* Real Discrete Fourier Transform */6970enum RDFTransformType {71DFT_R2C,72IDFT_C2R,73IDFT_R2C,74DFT_C2R,75};7677typedef struct RDFTContext RDFTContext;7879/**80* Set up a real FFT.81* @param nbits log2 of the length of the input array82* @param trans the type of transform83*/84RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);85void av_rdft_calc(RDFTContext *s, FFTSample *data);86void av_rdft_end(RDFTContext *s);8788/* Discrete Cosine Transform */8990typedef struct DCTContext DCTContext;9192enum DCTTransformType {93DCT_II = 0,94DCT_III,95DCT_I,96DST_I,97};9899/**100* Set up DCT.101*102* @param nbits size of the input array:103* (1 << nbits) for DCT-II, DCT-III and DST-I104* (1 << nbits) + 1 for DCT-I105* @param type the type of transform106*107* @note the first element of the input of DST-I is ignored108*/109DCTContext *av_dct_init(int nbits, enum DCTTransformType type);110void av_dct_calc(DCTContext *s, FFTSample *data);111void av_dct_end (DCTContext *s);112113/**114* @}115*/116117#endif /* AVCODEC_AVFFT_H */118119120