2 * This file is part of FFmpeg.
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.
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.
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
25 typedef struct AVTXContext AVTXContext;
27 typedef struct AVComplexFloat {
31 typedef struct AVComplexDouble {
37 * Standard complex to complex FFT with sample data type AVComplexFloat.
38 * Output is not 1/len normalized. Scaling currently unsupported.
42 * Standard MDCT with sample data type of float and a scale type of
43 * float. Length is the frame size, not the window size (which is 2x frame)
47 * Same as AV_TX_FLOAT_FFT with a data type of AVComplexDouble.
51 * Same as AV_TX_FLOAT_MDCT with data and scale type of double.
53 AV_TX_DOUBLE_MDCT = 3,
57 * Function pointer to a function to perform the transform.
59 * @note Using a different context than the one allocated during av_tx_init()
62 * @param s the transform context
63 * @param out the output array
64 * @param in the input array
65 * @param stride the input or output stride (depending on transform direction)
66 * in bytes, currently implemented for all MDCT transforms
68 typedef void (*av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride);
71 * Initialize a transform context with the given configuration
72 * Currently power of two lengths from 4 to 131072 are supported, along with
73 * any length decomposable to a power of two and either 3, 5 or 15.
75 * @param ctx the context to allocate, will be NULL on error
76 * @param tx pointer to the transform function pointer to set
77 * @param type type the type of transform
78 * @param inv whether to do an inverse or a forward transform
79 * @param len the size of the transform in samples
80 * @param scale pointer to the value to scale the output if supported by type
81 * @param flags currently unused
83 * @return 0 on success, negative error code on failure
85 int av_tx_init(AVTXContext **ctx, av_tx_fn *tx, enum AVTXType type,
86 int inv, int len, const void *scale, uint64_t flags);
89 * Frees a context and sets ctx to NULL, does nothing when ctx == NULL
91 void av_tx_uninit(AVTXContext **ctx);
93 #endif /* AVUTIL_TX_H */