Path: blob/master/dep/ffmpeg/include/libavcodec/avfft.h
4216 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#include "libavutil/attributes.h"22#include "version_major.h"23#if FF_API_AVFFT2425/**26* @file27* @ingroup lavc_fft28* FFT functions29*/3031/**32* @defgroup lavc_fft FFT functions33* @ingroup lavc_misc34*35* @{36*/3738typedef float FFTSample;3940typedef struct FFTComplex {41FFTSample re, im;42} FFTComplex;4344typedef struct FFTContext FFTContext;4546/**47* Set up a complex FFT.48* @param nbits log2 of the length of the input array49* @param inverse if 0 perform the forward transform, if 1 perform the inverse50* @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_FFT51*/52attribute_deprecated53FFTContext *av_fft_init(int nbits, int inverse);5455/**56* Do the permutation needed BEFORE calling ff_fft_calc().57* @deprecated without replacement58*/59attribute_deprecated60void av_fft_permute(FFTContext *s, FFTComplex *z);6162/**63* Do a complex FFT with the parameters defined in av_fft_init(). The64* input data must be permuted before. No 1.0/sqrt(n) normalization is done.65* @deprecated use the av_tx_fn value returned by av_tx_init, which also does permutation66*/67attribute_deprecated68void av_fft_calc(FFTContext *s, FFTComplex *z);6970attribute_deprecated71void av_fft_end(FFTContext *s);7273/**74* @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_MDCT,75* with a flag of AV_TX_FULL_IMDCT for a replacement to av_imdct_calc.76*/77attribute_deprecated78FFTContext *av_mdct_init(int nbits, int inverse, double scale);79attribute_deprecated80void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);81attribute_deprecated82void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input);83attribute_deprecated84void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);85attribute_deprecated86void av_mdct_end(FFTContext *s);8788/* Real Discrete Fourier Transform */8990enum RDFTransformType {91DFT_R2C,92IDFT_C2R,93IDFT_R2C,94DFT_C2R,95};9697typedef struct RDFTContext RDFTContext;9899/**100* Set up a real FFT.101* @param nbits log2 of the length of the input array102* @param trans the type of transform103*104* @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_RDFT105*/106attribute_deprecated107RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);108attribute_deprecated109void av_rdft_calc(RDFTContext *s, FFTSample *data);110attribute_deprecated111void av_rdft_end(RDFTContext *s);112113/* Discrete Cosine Transform */114115typedef struct DCTContext DCTContext;116117enum DCTTransformType {118DCT_II = 0,119DCT_III,120DCT_I,121DST_I,122};123124/**125* Set up DCT.126*127* @param nbits size of the input array:128* (1 << nbits) for DCT-II, DCT-III and DST-I129* (1 << nbits) + 1 for DCT-I130* @param type the type of transform131*132* @note the first element of the input of DST-I is ignored133*134* @deprecated use av_tx_init from libavutil/tx.h with an appropriate type of AV_TX_FLOAT_DCT135*/136attribute_deprecated137DCTContext *av_dct_init(int nbits, enum DCTTransformType type);138attribute_deprecated139void av_dct_calc(DCTContext *s, FFTSample *data);140attribute_deprecated141void av_dct_end (DCTContext *s);142143/**144* @}145*/146147#endif /* FF_API_AVFFT */148#endif /* AVCODEC_AVFFT_H */149150151