FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Enumerations | Functions | Variables
fft.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 "libavcodec/avfft.h"
#include "libavcodec/dct.h"
#include "libavcodec/rdft.h"
#include "compat/getopt.c"
#include "libavcodec/fft.h"

Go to the source code of this file.

Macros

#define AVFFT   0
 
#define MUL16(a, b)   ((a) * (b))
 
#define CMAC(pre, pim, are, aim, bre, bim)
 
#define RANGE   16384
 
#define REF_SCALE(x, bits)   ((x) / (1 << (bits)))
 
#define FMT   "%6d"
 

Enumerations

enum  tf_transform {
  TRANSFORM_FFT, TRANSFORM_MDCT, TRANSFORM_RDFT, TRANSFORM_DCT,
  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 fft_init (FFTContext **s, int nbits, int inverse)
 
static void mdct_init (FFTContext **s, int nbits, int inverse, double scale)
 
static void mdct_calc (FFTContext *s, FFTSample *output, const FFTSample *input)
 
static void imdct_calc (struct FFTContext *s, FFTSample *output, const FFTSample *input)
 
static void fft_permute (FFTContext *s, FFTComplex *z)
 
static void fft_calc (FFTContext *s, FFTComplex *z)
 
static void mdct_end (FFTContext *s)
 
static void fft_end (FFTContext *s)
 
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.c.

Macro Definition Documentation

#define AVFFT   0

Definition at line 29 of file fft.c.

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

Definition at line 59 of file fft.c.

#define CMAC (   pre,
  pim,
  are,
  aim,
  bre,
  bim 
)
Value:
{ \
pre += (MUL16(are, bre) - MUL16(aim, bim)); \
pim += (MUL16(are, bim) + MUL16(bre, aim)); \
}
#define MUL16(a, b)
Definition: fft.c:59

Definition at line 61 of file fft.c.

Referenced by fft_ref().

#define RANGE   16384

Definition at line 76 of file fft.c.

Referenced by check_diff(), and frandom().

#define REF_SCALE (   x,
  bits 
)    ((x) / (1 << (bits)))

Definition at line 77 of file fft.c.

Referenced by fft_ref().

#define FMT   "%6d"

Definition at line 78 of file fft.c.

Referenced by check_diff().

Enumeration Type Documentation

Enumerator
TRANSFORM_FFT 
TRANSFORM_MDCT 
TRANSFORM_RDFT 
TRANSFORM_DCT 
TRANSFORM_FFT 
TRANSFORM_MDCT 
TRANSFORM_RDFT 
TRANSFORM_DCT 

Definition at line 365 of file fft.c.

Function Documentation

static int fft_ref_init ( int  nbits,
int  inverse 
)
static

Definition at line 85 of file fft.c.

Referenced by main().

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

Definition at line 104 of file fft.c.

Referenced by main().

static FFTSample frandom ( AVLFG prng)
static

Definition at line 198 of file fft.c.

Referenced by main().

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

Definition at line 203 of file fft.c.

Referenced by main().

static void fft_init ( FFTContext **  s,
int  nbits,
int  inverse 
)
inlinestatic

Definition at line 223 of file fft.c.

Referenced by main().

static void mdct_init ( FFTContext **  s,
int  nbits,
int  inverse,
double  scale 
)
inlinestatic

Definition at line 232 of file fft.c.

Referenced by main().

static void mdct_calc ( FFTContext s,
FFTSample output,
const FFTSample input 
)
inlinestatic

Definition at line 241 of file fft.c.

Referenced by main().

static void imdct_calc ( struct FFTContext s,
FFTSample output,
const FFTSample input 
)
inlinestatic

Definition at line 250 of file fft.c.

Referenced by main().

static void fft_permute ( FFTContext s,
FFTComplex z 
)
inlinestatic

Definition at line 259 of file fft.c.

Referenced by main().

static void fft_calc ( FFTContext s,
FFTComplex z 
)
inlinestatic

Definition at line 268 of file fft.c.

Referenced by main().

static void mdct_end ( FFTContext s)
inlinestatic

Definition at line 277 of file fft.c.

Referenced by main().

static void fft_end ( FFTContext s)
inlinestatic

Definition at line 286 of file fft.c.

Referenced by main().

static void help ( void  )
static

Definition at line 351 of file fft.c.

Referenced by main().

int main ( int  argc,
char **  argv 
)

Definition at line 376 of file fft.c.

Variable Documentation

float re

Definition at line 82 of file fft.c.

float im

Definition at line 82 of file fft.c.

struct { ... } * exptab

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