FFmpeg
Macros | Functions
rdft.c File Reference

(Inverse) Real Discrete Fourier Transforms. More...

#include <stdlib.h>
#include <math.h>
#include "libavutil/mathematics.h"
#include "rdft.h"

Macros

#define RDFT_UNMANGLE(sign0, sign1)
 

Functions

av_cold int ff_rdft_init (RDFTContext *s, int nbits, enum RDFTransformType trans)
 Set up a real FFT. More...
 
av_cold void ff_rdft_end (RDFTContext *s)
 

Detailed Description

(Inverse) Real Discrete Fourier Transforms.

Macro Definition Documentation

§ RDFT_UNMANGLE

#define RDFT_UNMANGLE (   sign0,
  sign1 
)
Value:
for (i = 1; i < (n>>2); i++) { \
i1 = 2*i; \
i2 = n-i1; \
/* Separate even and odd FFTs */ \
ev.re = k1*(data[i1 ]+data[i2 ]); \
od.im = k2*(data[i2 ]-data[i1 ]); \
ev.im = k1*(data[i1+1]-data[i2+1]); \
od.re = k2*(data[i1+1]+data[i2+1]); \
/* Apply twiddle factors to the odd FFT and add to the even FFT */ \
odsum.re = od.re*tcos[i] sign0 od.im*tsin[i]; \
odsum.im = od.im*tcos[i] sign1 od.re*tsin[i]; \
data[i1 ] = ev.re + odsum.re; \
data[i1+1] = ev.im + odsum.im; \
data[i2 ] = ev.re - odsum.re; \
data[i2+1] = odsum.im - ev.im; \
}

Function Documentation

§ ff_rdft_init()

av_cold int ff_rdft_init ( RDFTContext s,
int  nbits,
enum RDFTransformType  trans 
)

Set up a real FFT.

Parameters
nbitslog2 of the length of the input array
transthe type of transform