FFmpeg 7.1.1
Loading...
Searching...
No Matches
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
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
39typedef float FFTSample;
40
41typedef struct FFTComplex {
42 FFTSample re, im;
43} FFTComplex;
44
45typedef 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 */
54FFTContext *av_fft_init(int nbits, int inverse);
55
56/**
57 * Do the permutation needed BEFORE calling ff_fft_calc().
58 * @deprecated without replacement
59 */
61void av_fft_permute(FFTContext *s, FFTComplex *z);
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 */
69void av_fft_calc(FFTContext *s, FFTComplex *z);
70
72void 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 */
79FFTContext *av_mdct_init(int nbits, int inverse, double scale);
81void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
83void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input);
85void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
87void av_mdct_end(FFTContext *s);
88
89/* Real Discrete Fourier Transform */
90
91enum RDFTransformType {
92 DFT_R2C,
93 IDFT_C2R,
94 IDFT_R2C,
95 DFT_C2R,
96};
97
98typedef 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 */
108RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
110void av_rdft_calc(RDFTContext *s, FFTSample *data);
112void av_rdft_end(RDFTContext *s);
113
114/* Discrete Cosine Transform */
115
116typedef struct DCTContext DCTContext;
117
118enum DCTTransformType {
119 DCT_II = 0,
120 DCT_III,
121 DCT_I,
122 DST_I,
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 */
138DCTContext *av_dct_init(int nbits, enum DCTTransformType type);
140void av_dct_calc(DCTContext *s, FFTSample *data);
142void av_dct_end (DCTContext *s);
143
144/**
145 * @}
146 */
147
148#endif /* FF_API_AVFFT */
149#endif /* AVCODEC_AVFFT_H */
Macro definitions for various function/variable attributes.
#define attribute_deprecated
Definition attributes.h:100
swscale version macros