All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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"

Go to the source code of this file.


#define RDFT_UNMANGLE(sign0, sign1)


static void rdft_calc_c (RDFTContext *s, FFTSample *data)
 Map one real FFT into two parallel real even and odd FFTs. More...
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.

Definition in file rdft.c.

Macro Definition Documentation

#define RDFT_UNMANGLE (   sign0,
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; \
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:101
int n
Definition: avisynth_c.h:684

Referenced by rdft_calc_c().

Function Documentation

static void rdft_calc_c ( RDFTContext s,
FFTSample data 

Map one real FFT into two parallel real even and odd FFTs.

Then interleave the two real FFTs into one complex FFT. Unmangle the results. ref: http://www.engineeringproductivitytools.com/stuff/T0001/PT10.HTM

Definition at line 35 of file rdft.c.

Referenced by ff_rdft_init().

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

Set up a real FFT.

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

Definition at line 88 of file rdft.c.

Referenced by decode_init(), ff_dct_init(), qdm2_decode_init(), and wmavoice_decode_init().

av_cold void ff_rdft_end ( RDFTContext s)

Definition at line 114 of file rdft.c.

Referenced by decode_end(), ff_dct_end(), qdm2_decode_close(), and wmavoice_decode_end().