FFmpeg
Macros | Functions
rdft.c File Reference
#include <stdlib.h>
#include <math.h>
#include "libavutil/error.h"
#include "libavutil/mathematics.h"
#include "rdft.h"

Go to the source code of this file.

Macros

#define RDFT_UNMANGLE(sign0, sign1)
 

Functions

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

◆ 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

◆ rdft_calc_c()

static void rdft_calc_c ( RDFTContext s,
FFTSample data 
)
static

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 36 of file rdft.c.

Referenced by ff_rdft_init().

◆ 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

Definition at line 89 of file rdft.c.

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

◆ ff_rdft_end()

av_cold void ff_rdft_end ( RDFTContext s)

Definition at line 117 of file rdft.c.

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

data
const char data[16]
Definition: mxf.c:143
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269