libavcodec/fft-test.c File Reference

FFT and MDCT tests. More...

#include "libavutil/mathematics.h"
#include "libavutil/lfg.h"
#include "libavutil/log.h"
#include "fft.h"
#include <math.h>
#include <unistd.h>
#include <sys/time.h>
#include <stdlib.h>
#include <string.h>
#include "dct.h"
#include "rdft.h"

Go to the source code of this file.

Defines

#define MUL16(a, b)   ((a) * (b))
#define CMAC(pre, pim, are, aim, bre, bim)
#define RANGE   1.0
#define REF_SCALE(x, bits)   (x)
#define FMT   "%10.6f"

Enumerations

enum  tf_transform { TRANSFORM_FFT, TRANSFORM_MDCT, TRANSFORM_RDFT, TRANSFORM_DCT }

Functions

static void fft_ref_init (int nbits, int inverse)
static void fft_ref (FFTComplex *tabr, FFTComplex *tab, int nbits)
static void imdct_ref (FFTSample *out, FFTSample *in, int nbits)
static void mdct_ref (FFTSample *output, FFTSample *input, int nbits)
static void idct_ref (float *output, float *input, int nbits)
static void dct_ref (float *output, float *input, int nbits)
static FFTSample frandom (AVLFG *prng)
static int64_t gettime (void)
static int check_diff (FFTSample *tab1, FFTSample *tab2, int n, double scale)
static void help (void)
int main (int argc, char **argv)

Variables

struct {
   float   re
   float   im
exptab


Detailed Description

FFT and MDCT tests.

Definition in file fft-test.c.


Define Documentation

#define CMAC ( pre,
pim,
are,
aim,
bre,
bim   ) 

Value:

{\
   pre += (MUL16(are, bre) - MUL16(aim, bim));\
   pim += (MUL16(are, bim) + MUL16(bre, aim));\
}

Definition at line 46 of file fft-test.c.

Referenced by fft_ref().

#define FMT   "%10.6f"

Definition at line 55 of file fft-test.c.

Referenced by check_diff().

#define MUL16 ( a,
 )     ((a) * (b))

Definition at line 44 of file fft-test.c.

#define RANGE   1.0

Definition at line 53 of file fft-test.c.

Referenced by check_diff(), and frandom().

#define REF_SCALE ( x,
bits   )     (x)

Definition at line 54 of file fft-test.c.

Referenced by fft_ref(), imdct_ref(), and mdct_ref().


Enumeration Type Documentation

Enumerator:
TRANSFORM_FFT 
TRANSFORM_MDCT 
TRANSFORM_RDFT 
TRANSFORM_DCT 

Definition at line 234 of file fft-test.c.


Function Documentation

static int check_diff ( FFTSample tab1,
FFTSample tab2,
int  n,
double  scale 
) [static]

Definition at line 197 of file fft-test.c.

Referenced by main().

static void dct_ref ( float *  output,
float *  input,
int  nbits 
) [static]

Definition at line 166 of file fft-test.c.

Referenced by main().

static void fft_ref ( FFTComplex tabr,
FFTComplex tab,
int  nbits 
) [static]

Definition at line 85 of file fft-test.c.

Referenced by main().

static void fft_ref_init ( int  nbits,
int  inverse 
) [static]

Definition at line 66 of file fft-test.c.

Referenced by main().

static FFTSample frandom ( AVLFG prng  )  [static]

Definition at line 185 of file fft-test.c.

Referenced by main().

static int64_t gettime ( void   )  [static]

Definition at line 190 of file fft-test.c.

static void help ( void   )  [static]

Definition at line 219 of file fft-test.c.

static void idct_ref ( float *  output,
float *  input,
int  nbits 
) [static]

Definition at line 150 of file fft-test.c.

Referenced by main().

static void imdct_ref ( FFTSample out,
FFTSample in,
int  nbits 
) [static]

Definition at line 114 of file fft-test.c.

Referenced by main().

int main ( int  argc,
char **  argv 
)

Definition at line 241 of file fft-test.c.

static void mdct_ref ( FFTSample output,
FFTSample input,
int  nbits 
) [static]

Definition at line 132 of file fft-test.c.

Referenced by main().


Variable Documentation

struct { ... } * exptab

Referenced by fft_ref(), fft_ref_init(), and main().

float im

float re


Generated on Fri Oct 26 02:38:16 2012 for FFmpeg by  doxygen 1.5.8