FFmpeg 6.1.1
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 {
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 */
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
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);
88
89/* Real Discrete Fourier Transform */
90
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 */
113
114/* Discrete Cosine Transform */
115
116typedef struct DCTContext DCTContext;
117
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 */
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
attribute_deprecated FFTContext * av_fft_init(int nbits, int inverse)
Set up a complex FFT.
attribute_deprecated void av_dct_calc(DCTContext *s, FFTSample *data)
attribute_deprecated void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
attribute_deprecated void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input)
attribute_deprecated FFTContext * av_mdct_init(int nbits, int inverse, double scale)
attribute_deprecated void av_dct_end(DCTContext *s)
RDFTransformType
Definition: avfft.h:91
attribute_deprecated RDFTContext * av_rdft_init(int nbits, enum RDFTransformType trans)
Set up a real FFT.
struct DCTContext DCTContext
Definition: avfft.h:116
attribute_deprecated void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
attribute_deprecated void av_fft_calc(FFTContext *s, FFTComplex *z)
Do a complex FFT with the parameters defined in av_fft_init().
attribute_deprecated void av_mdct_end(FFTContext *s)
float FFTSample
Definition: avfft.h:39
struct FFTContext FFTContext
Definition: avfft.h:45
attribute_deprecated void av_rdft_end(RDFTContext *s)
attribute_deprecated void av_fft_permute(FFTContext *s, FFTComplex *z)
Do the permutation needed BEFORE calling ff_fft_calc().
struct RDFTContext RDFTContext
Definition: avfft.h:98
attribute_deprecated DCTContext * av_dct_init(int nbits, enum DCTTransformType type)
Set up DCT.
DCTTransformType
Definition: avfft.h:118
attribute_deprecated void av_fft_end(FFTContext *s)
attribute_deprecated void av_rdft_calc(RDFTContext *s, FFTSample *data)
@ DFT_R2C
Definition: avfft.h:92
@ IDFT_R2C
Definition: avfft.h:94
@ DFT_C2R
Definition: avfft.h:95
@ IDFT_C2R
Definition: avfft.h:93
@ DCT_I
Definition: avfft.h:121
@ DCT_III
Definition: avfft.h:120
@ DCT_II
Definition: avfft.h:119
@ DST_I
Definition: avfft.h:122
swscale version macros
FFTSample re
Definition: avfft.h:42
FFTSample im
Definition: avfft.h:42