FFmpeg
Macros | Enumerations | Functions | Variables
fft.c File Reference
#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   8388608
 
#define REF_SCALE(x, bits)   (x)
 
#define FMT   "%6d"
 

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 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

◆ AVFFT

#define AVFFT   0

Definition at line 29 of file fft.c.

◆ MUL16

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

Definition at line 59 of file fft.c.

◆ CMAC

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

◆ RANGE

#define RANGE   8388608

Definition at line 72 of file fft.c.

◆ REF_SCALE

#define REF_SCALE (   x,
  bits 
)    (x)

Definition at line 73 of file fft.c.

◆ FMT

#define FMT   "%6d"

Definition at line 74 of file fft.c.

Enumeration Type Documentation

◆ tf_transform

Enumerator
TRANSFORM_FFT 
TRANSFORM_MDCT 
TRANSFORM_RDFT 
TRANSFORM_DCT 

Definition at line 361 of file fft.c.

Function Documentation

◆ fft_ref_init()

static int fft_ref_init ( int  nbits,
int  inverse 
)
static

Definition at line 81 of file fft.c.

Referenced by main().

◆ fft_ref()

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

Definition at line 100 of file fft.c.

Referenced by main().

◆ frandom()

static FFTSample frandom ( AVLFG prng)
static

Definition at line 194 of file fft.c.

Referenced by main().

◆ check_diff()

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

Definition at line 199 of file fft.c.

Referenced by main().

◆ fft_init()

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

Definition at line 219 of file fft.c.

Referenced by main().

◆ mdct_init()

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

Definition at line 228 of file fft.c.

Referenced by main().

◆ mdct_calc()

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

Definition at line 237 of file fft.c.

Referenced by main().

◆ imdct_calc()

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

Definition at line 246 of file fft.c.

Referenced by main().

◆ fft_permute()

static void fft_permute ( FFTContext s,
FFTComplex z 
)
inlinestatic

Definition at line 255 of file fft.c.

Referenced by main().

◆ fft_calc()

static void fft_calc ( FFTContext s,
FFTComplex z 
)
inlinestatic

Definition at line 264 of file fft.c.

Referenced by main().

◆ mdct_end()

static void mdct_end ( FFTContext s)
inlinestatic

Definition at line 273 of file fft.c.

Referenced by main().

◆ fft_end()

static void fft_end ( FFTContext s)
inlinestatic

Definition at line 282 of file fft.c.

Referenced by main().

◆ help()

static void help ( void  )
static

Definition at line 347 of file fft.c.

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 372 of file fft.c.

Variable Documentation

◆ re

float re

Definition at line 78 of file fft.c.

Referenced by add_noise(), add_wave(), add_wave0(), asv2_get_vlc2(), cfhd_decode(), cmul(), complex_divide(), complex_multiply(), complex_xcorrelate(), compute_band_corr(), compute_band_energy(), convert_coeffs(), decode_422_bitstream(), decode_ac_coeffs(), decode_bgr_1(), decode_block(), decode_block_intra(), decode_block_progressive(), decode_block_refinement(), decode_dc_coeffs(), decode_gray_bitstream(), decode_plane_bitstream(), decode_spectrum_and_dequant(), direct(), dv_decode_ac(), expand(), export_row16(), export_row8(), fast_convolute_nonlinear(), ff_imdct_half_c(), ff_mdct_calc_c(), ff_mpeg1_decode_block_intra(), ff_msmpeg4_decode_block(), fft15_c(), fft3(), fft4(), fft7(), fft8(), fft9(), filter_channel(), filter_frame(), filter_plane2d(), filter_plane3d1(), get_bits(), get_bits_le(), get_input(), get_interleaved_se_golomb(), get_interleaved_ue_golomb(), get_level_prefix(), get_output(), get_sbits(), get_se_golomb(), get_ue_golomb(), get_ue_golomb_31(), get_ur_golomb(), get_ur_golomb_jpegls(), get_vlc2(), get_xbits(), get_xbits_le(), get_xoutput(), h261_decode_block(), h263_decode_block(), headphone_fast_convolute(), imc_imdct256(), import_plane(), inverse_transform(), mdct15(), mdec_decode_block_intra(), monolithic_imdct(), mpeg1_decode_block_inter(), mpeg1_fast_decode_block_inter(), mpeg2_decode_block_intra(), mpeg2_decode_block_non_intra(), mpeg2_fast_decode_block_intra(), mpeg2_fast_decode_block_non_intra(), mpeg4_decode_block(), postrotate_c(), rgb_from_cqt(), show_bits(), skip_bits(), sofalizer_fast_convolute(), and yuv_from_cqt().

◆ im

float im

◆ exptab

struct { ... } * exptab
MUL16
#define MUL16(a, b)
Definition: fft.c:59