Go to the documentation of this file.
87 float scale_f =
scale;
155 1 << nbits, &
scale, 0x0);
178 float *
src =
w->inv ?
w->tmp : (
float *)
data;
179 float *dst =
w->inv ? (
float *)
data :
w->tmp;
182 memcpy(
src,
data,
w->len*
sizeof(
float));
188 w->fn(
w->ctx, dst, (
void *)
src,
w->stride);
191 dst[1] = dst[
w->len];
192 memcpy(
data, dst,
w->len*
sizeof(
float));
209 const float scale_map[] = {
211 [
DCT_III] = 1.0f / (1 << nbits),
215 static const enum AVTXType type_map[] = {
226 s->len = (1 << nbits);
237 if (
s->out_of_place) {
238 s->tmp =
av_malloc((1 << (nbits + 1))*
sizeof(
float));
252 if (
w->out_of_place) {
253 memcpy(
w->tmp,
data,
w->len*
sizeof(
float));
254 w->fn(
w->ctx, (
void *)
data,
w->tmp,
sizeof(
float));
256 w->fn(
w->ctx,
data, (
void *)
data,
sizeof(
float));
struct RDFTContext RDFTContext
void av_dct_calc(DCTContext *s, FFTSample *data)
void av_fft_calc(FFTContext *s, FFTComplex *z)
Do a complex FFT with the parameters defined in av_fft_init().
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
void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input)
av_cold int av_tx_init(AVTXContext **ctx, av_tx_fn *tx, enum AVTXType type, int inv, int len, const void *scale, uint64_t flags)
Initialize a transform context with the given configuration (i)MDCTs with an odd length are currently...
static av_always_inline float scale(float x, float s)
struct FFTContext FFTContext
av_cold void av_mdct_end(FFTContext *s)
void(* av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride)
Function pointer to a function to perform the transform.
@ AV_TX_FLOAT_MDCT
Standard MDCT with a sample data type of float, double or int32_t, respecively.
void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
@ AV_TX_FLOAT_FFT
Standard complex to complex FFT with sample data type of AVComplexFloat, AVComplexDouble or AVComplex...
@ AV_TX_FULL_IMDCT
Performs a full inverse MDCT rather than leaving out samples that can be derived through symmetry.
FFTContext * av_fft_init(int nbits, int inverse)
Set up a complex FFT.
@ AV_TX_INPLACE
Allows for in-place transformations, where input == output.
struct DCTContext DCTContext
av_cold void av_rdft_end(RDFTContext *s)
FFTContext * av_mdct_init(int nbits, int inverse, double scale)
@ AV_TX_FLOAT_DCT_I
Discrete Cosine Transform I.
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
av_cold void av_tx_uninit(AVTXContext **ctx)
Frees a context and sets *ctx to NULL, does nothing when *ctx == NULL.
void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
DCTContext * av_dct_init(int nbits, enum DCTTransformType inverse)
Set up DCT.
@ AV_TX_FLOAT_RDFT
Real to complex and complex to real DFTs.
@ AV_TX_FLOAT_DST_I
Discrete Sine Transform I.
void av_rdft_calc(RDFTContext *s, FFTSample *data)
av_cold void av_dct_end(DCTContext *s)
@ AV_TX_FLOAT_DCT
Real to real (DCT) transforms.
av_cold void av_fft_end(FFTContext *s)
RDFTContext * av_rdft_init(int nbits, enum RDFTransformType trans)
Set up a real FFT.
void av_fft_permute(FFTContext *s, FFTComplex *z)
Do the permutation needed BEFORE calling ff_fft_calc().