FFmpeg
avfft.h
Go to the documentation of this file.
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 #ifndef AVCODEC_AVFFT_H
20 #define AVCODEC_AVFFT_H
21 
22 #include "libavutil/attributes.h"
23 #include "version_major.h"
24 #if FF_API_AVFFT
25 
26 /**
27  * @file
28  * @ingroup lavc_fft
29  * FFT functions
30  */
31 
32 /**
33  * @defgroup lavc_fft FFT functions
34  * @ingroup lavc_misc
35  *
36  * @{
37  */
38 
39 typedef float FFTSample;
40 
41 typedef struct FFTComplex {
43 } FFTComplex;
44 
45 typedef struct FFTContext FFTContext;
46 
47 /**
48  * Set up a complex FFT.
49  * @param nbits log2 of the length of the input array
50  * @param inverse if 0 perform the forward transform, if 1 perform the inverse
51  * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_FFT
52  */
54 FFTContext *av_fft_init(int nbits, int inverse);
55 
56 /**
57  * Do the permutation needed BEFORE calling ff_fft_calc().
58  * @deprecated without replacement
59  */
62 
63 /**
64  * Do a complex FFT with the parameters defined in av_fft_init(). The
65  * input data must be permuted before. No 1.0/sqrt(n) normalization is done.
66  * @deprecated use the av_tx_fn value returned by av_tx_init, which also does permutation
67  */
70 
72 void av_fft_end(FFTContext *s);
73 
74 /**
75  * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_MDCT,
76  * with a flag of AV_TX_FULL_IMDCT for a replacement to av_imdct_calc.
77  */
79 FFTContext *av_mdct_init(int nbits, int inverse, double scale);
87 void av_mdct_end(FFTContext *s);
88 
89 /* Real Discrete Fourier Transform */
90 
96 };
97 
98 typedef struct RDFTContext RDFTContext;
99 
100 /**
101  * Set up a real FFT.
102  * @param nbits log2 of the length of the input array
103  * @param trans the type of transform
104  *
105  * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_RDFT
106  */
108 RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
112 void av_rdft_end(RDFTContext *s);
113 
114 /* Discrete Cosine Transform */
115 
116 typedef struct DCTContext DCTContext;
117 
119  DCT_II = 0,
123 };
124 
125 /**
126  * Set up DCT.
127  *
128  * @param nbits size of the input array:
129  * (1 << nbits) for DCT-II, DCT-III and DST-I
130  * (1 << nbits) + 1 for DCT-I
131  * @param type the type of transform
132  *
133  * @note the first element of the input of DST-I is ignored
134  *
135  * @deprecated use av_tx_init from libavutil/tx.h with an appropriate type of AV_TX_FLOAT_DCT
136  */
138 DCTContext *av_dct_init(int nbits, enum DCTTransformType type);
142 void av_dct_end (DCTContext *s);
143 
144 /**
145  * @}
146  */
147 
148 #endif /* FF_API_AVFFT */
149 #endif /* AVCODEC_AVFFT_H */
DCT_I
@ DCT_I
Definition: avfft.h:121
RDFTContext
struct RDFTContext RDFTContext
Definition: avfft.h:98
av_dct_calc
attribute_deprecated void av_dct_calc(DCTContext *s, FFTSample *data)
Definition: avfft.c:249
inverse
inverse
Definition: af_crystalizer.c:121
av_fft_calc
attribute_deprecated void av_fft_calc(FFTContext *s, FFTComplex *z)
Do a complex FFT with the parameters defined in av_fft_init().
Definition: avfft.c:68
output
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce output
Definition: filter_design.txt:225
DFT_C2R
@ DFT_C2R
Definition: avfft.h:95
data
const char data[16]
Definition: mxf.c:148
version_major.h
av_imdct_half
attribute_deprecated void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input)
Definition: avfft.c:117
DCT_III
@ DCT_III
Definition: avfft.h:120
IDFT_C2R
@ IDFT_C2R
Definition: avfft.h:93
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
FFTContext
struct FFTContext FFTContext
Definition: avfft.h:45
av_mdct_end
attribute_deprecated void av_mdct_end(FFTContext *s)
Definition: avfft.c:129
s
#define s(width, name)
Definition: cbs_vp9.c:198
av_mdct_calc
attribute_deprecated void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
Definition: avfft.c:123
IDFT_R2C
@ IDFT_R2C
Definition: avfft.h:94
av_fft_init
attribute_deprecated FFTContext * av_fft_init(int nbits, int inverse)
Set up a complex FFT.
Definition: avfft.c:45
DFT_R2C
@ DFT_R2C
Definition: avfft.h:92
FFTSample
float FFTSample
Definition: avfft.h:39
DCTContext
struct DCTContext DCTContext
Definition: avfft.h:116
av_rdft_end
attribute_deprecated void av_rdft_end(RDFTContext *s)
Definition: avfft.c:196
av_mdct_init
attribute_deprecated FFTContext * av_mdct_init(int nbits, int inverse, double scale)
Definition: avfft.c:84
scale
static void scale(int *out, const int *in, const int w, const int h, const int shift)
Definition: vvc_intra.c:291
FFTComplex::im
FFTSample im
Definition: avfft.h:42
FFTComplex::re
FFTSample re
Definition: avfft.h:42
attribute_deprecated
#define attribute_deprecated
Definition: attributes.h:104
attributes.h
input
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some input
Definition: filter_design.txt:172
DST_I
@ DST_I
Definition: avfft.h:122
av_imdct_calc
attribute_deprecated void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
Definition: avfft.c:111
RDFTransformType
RDFTransformType
Definition: avfft.h:91
av_dct_init
attribute_deprecated DCTContext * av_dct_init(int nbits, enum DCTTransformType type)
Set up DCT.
Definition: avfft.c:206
av_rdft_calc
attribute_deprecated void av_rdft_calc(RDFTContext *s, FFTSample *data)
Definition: avfft.c:175
av_dct_end
attribute_deprecated void av_dct_end(DCTContext *s)
Definition: avfft.c:260
DCT_II
@ DCT_II
Definition: avfft.h:119
av_fft_end
attribute_deprecated void av_fft_end(FFTContext *s)
Definition: avfft.c:74
DCTTransformType
DCTTransformType
Definition: avfft.h:118
av_rdft_init
attribute_deprecated RDFTContext * av_rdft_init(int nbits, enum RDFTransformType trans)
Set up a real FFT.
Definition: avfft.c:139
av_fft_permute
attribute_deprecated void av_fft_permute(FFTContext *s, FFTComplex *z)
Do the permutation needed BEFORE calling ff_fft_calc().
Definition: avfft.c:63
FFTComplex
Definition: avfft.h:41