FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Enumerations | Functions | Variables
fft-test.c File Reference

FFT and MDCT tests. More...

#include "config.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libavutil/cpu.h"
#include "libavutil/lfg.h"
#include "libavutil/log.h"
#include "libavutil/mathematics.h"
#include "libavutil/time.h"
#include "fft.h"
#include "dct.h"
#include "rdft.h"
#include "compat/getopt.c"

Go to the source code of this file.

Macros

#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 int fft_ref_init (int nbits, int inverse)
 
static void fft_ref (FFTComplex *tabr, FFTComplex *tab, int nbits)
 
static FFTSample frandom (AVLFG *prng)
 
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.

Macro Definition Documentation

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

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

Referenced by apply_window_int16_c(), celt_cos(), ff_dot_product(), pRNG(), and synth_frame().

#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 52 of file fft-test.c.

Referenced by fft_ref().

#define RANGE   1.0

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

Referenced by check_diff(), and frandom().

#define REF_SCALE (   x,
  bits 
)    (x)

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

Referenced by fft_ref().

#define FMT   "%10.6f"

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

Referenced by check_diff().

Enumeration Type Documentation

Enumerator:
TRANSFORM_FFT 
TRANSFORM_MDCT 
TRANSFORM_RDFT 
TRANSFORM_DCT 

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

Function Documentation

static int fft_ref_init ( int  nbits,
int  inverse 
)
static

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

Referenced by main().

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

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

Referenced by main().

static FFTSample frandom ( AVLFG prng)
static

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

Referenced by main().

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

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

Referenced by main().

static void help ( void  )
static

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

Referenced by main().

int main ( int  argc,
char **  argv 
)

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

Variable Documentation

float re
float im
struct { ... } * exptab