#include <stdint.h>
#include "config.h"
#include "libavutil/mem.h"
#include "avfft.h"
Go to the source code of this file.
Data Structures | |
struct | FFTContext |
struct | RDFTContext |
struct | DCTContext |
Defines | |
#define | FF_MDCT_PERM_NONE 0 |
#define | FF_MDCT_PERM_INTERLEAVE 1 |
#define | COSTABLE_CONST |
#define | SINTABLE_CONST |
#define | SINETABLE_CONST |
#define | COSTABLE(size) COSTABLE_CONST DECLARE_ALIGNED(16, FFTSample, ff_cos_##size)[size/2] |
#define | SINTABLE(size) SINTABLE_CONST DECLARE_ALIGNED(16, FFTSample, ff_sin_##size)[size/2] |
#define | SINETABLE(size) SINETABLE_CONST DECLARE_ALIGNED(16, float, ff_sine_##size)[size] |
Functions | |
COSTABLE (16) | |
COSTABLE (32) | |
COSTABLE (64) | |
COSTABLE (128) | |
COSTABLE (256) | |
COSTABLE (512) | |
COSTABLE (1024) | |
COSTABLE (2048) | |
COSTABLE (4096) | |
COSTABLE (8192) | |
COSTABLE (16384) | |
COSTABLE (32768) | |
COSTABLE (65536) | |
void | ff_init_ff_cos_tabs (int index) |
Initializes the cosine table in ff_cos_tabs[index]. | |
SINTABLE (16) | |
SINTABLE (32) | |
SINTABLE (64) | |
SINTABLE (128) | |
SINTABLE (256) | |
SINTABLE (512) | |
SINTABLE (1024) | |
SINTABLE (2048) | |
SINTABLE (4096) | |
SINTABLE (8192) | |
SINTABLE (16384) | |
SINTABLE (32768) | |
SINTABLE (65536) | |
int | ff_fft_init (FFTContext *s, int nbits, int inverse) |
Sets up a complex FFT. | |
void | ff_fft_permute_c (FFTContext *s, FFTComplex *z) |
void | ff_fft_calc_c (FFTContext *s, FFTComplex *z) |
void | ff_fft_init_altivec (FFTContext *s) |
void | ff_fft_init_mmx (FFTContext *s) |
void | ff_fft_init_arm (FFTContext *s) |
static void | ff_fft_permute (FFTContext *s, FFTComplex *z) |
Do the permutation needed BEFORE calling ff_fft_calc(). | |
static void | ff_fft_calc (FFTContext *s, FFTComplex *z) |
Do a complex FFT with the parameters defined in ff_fft_init(). | |
void | ff_fft_end (FFTContext *s) |
static void | ff_imdct_calc (FFTContext *s, FFTSample *output, const FFTSample *input) |
static void | ff_imdct_half (FFTContext *s, FFTSample *output, const FFTSample *input) |
static void | ff_mdct_calc (FFTContext *s, FFTSample *output, const FFTSample *input) |
void | ff_kbd_window_init (float *window, float alpha, int n) |
Generate a Kaiser-Bessel Derived Window. | |
void | ff_sine_window_init (float *window, int n) |
Generate a sine window. | |
void | ff_init_ff_sine_windows (int index) |
initialize the specified entry of ff_sine_windows | |
SINETABLE (32) | |
SINETABLE (64) | |
SINETABLE (128) | |
SINETABLE (256) | |
SINETABLE (512) | |
SINETABLE (1024) | |
SINETABLE (2048) | |
SINETABLE (4096) | |
int | ff_mdct_init (FFTContext *s, int nbits, int inverse, double scale) |
init MDCT or IMDCT computation. | |
void | ff_imdct_calc_c (FFTContext *s, FFTSample *output, const FFTSample *input) |
Compute inverse MDCT of size N = 2^nbits. | |
void | ff_imdct_half_c (FFTContext *s, FFTSample *output, const FFTSample *input) |
Compute the middle half of the inverse MDCT of size N = 2^nbits, thus excluding the parts that can be derived by symmetry. | |
void | ff_mdct_calc_c (FFTContext *s, FFTSample *output, const FFTSample *input) |
Compute MDCT of size N = 2^nbits. | |
void | ff_mdct_end (FFTContext *s) |
int | ff_rdft_init (RDFTContext *s, int nbits, enum RDFTransformType trans) |
Sets up a real FFT. | |
void | ff_rdft_end (RDFTContext *s) |
void | ff_rdft_init_arm (RDFTContext *s) |
static av_always_inline void | ff_rdft_calc (RDFTContext *s, FFTSample *data) |
int | ff_dct_init (DCTContext *s, int nbits, enum DCTTransformType type) |
Sets up DCT. | |
void | ff_dct_calc (DCTContext *s, FFTSample *data) |
void | ff_dct_end (DCTContext *s) |
Variables | |
COSTABLE_CONST FFTSample *const | ff_cos_tabs [17] |
SINETABLE_CONST float *const | ff_sine_windows [13] |
#define FF_MDCT_PERM_INTERLEAVE 1 |
#define FF_MDCT_PERM_NONE 0 |
COSTABLE | ( | 65536 | ) |
COSTABLE | ( | 32768 | ) |
COSTABLE | ( | 16384 | ) |
COSTABLE | ( | 8192 | ) |
COSTABLE | ( | 4096 | ) |
COSTABLE | ( | 2048 | ) |
COSTABLE | ( | 1024 | ) |
COSTABLE | ( | 512 | ) |
COSTABLE | ( | 256 | ) |
COSTABLE | ( | 128 | ) |
COSTABLE | ( | 64 | ) |
COSTABLE | ( | 32 | ) |
COSTABLE | ( | 16 | ) |
void ff_dct_calc | ( | DCTContext * | s, | |
FFTSample * | data | |||
) |
Definition at line 170 of file dct.c.
Referenced by calc_input_response(), decode_block(), and main().
void ff_dct_end | ( | DCTContext * | s | ) |
Definition at line 206 of file dct.c.
Referenced by decode_end(), main(), and wmavoice_decode_end().
int ff_dct_init | ( | DCTContext * | s, | |
int | nbits, | |||
enum DCTTransformType | type | |||
) |
Sets up DCT.
nbits | size of the input array: (1 << nbits) for DCT-II, DCT-III and DST-I (1 << nbits) + 1 for DCT-I |
Definition at line 175 of file dct.c.
Referenced by decode_init(), main(), and wmavoice_decode_init().
static void ff_fft_calc | ( | FFTContext * | s, | |
FFTComplex * | z | |||
) | [inline, static] |
Do a complex FFT with the parameters defined in ff_fft_init().
The input data must be permuted before. No 1.0/sqrt(n) normalization is done.
Definition at line 130 of file fft.h.
Referenced by ff_imdct_half_c(), ff_mdct_calc_c(), ff_rdft_calc_c(), imc_imdct256(), and main().
void ff_fft_calc_c | ( | FFTContext * | s, | |
FFTComplex * | z | |||
) |
void ff_fft_end | ( | FFTContext * | s | ) |
Definition at line 203 of file fft.c.
Referenced by av_fft_end(), ff_mdct_end(), ff_rdft_end(), imc_decode_close(), and main().
int ff_fft_init | ( | FFTContext * | s, | |
int | nbits, | |||
int | inverse | |||
) |
Sets up a complex FFT.
nbits | log2 of the length of the input array | |
inverse | if 0 perform the forward transform, if 1 perform the inverse |
Definition at line 81 of file fft.c.
Referenced by av_fft_init(), ff_mdct_init(), ff_rdft_init(), imc_decode_init(), and main().
void ff_fft_init_altivec | ( | FFTContext * | s | ) |
void ff_fft_init_arm | ( | FFTContext * | s | ) |
void ff_fft_init_mmx | ( | FFTContext * | s | ) |
static void ff_fft_permute | ( | FFTContext * | s, | |
FFTComplex * | z | |||
) | [inline, static] |
Do the permutation needed BEFORE calling ff_fft_calc().
Definition at line 122 of file fft.h.
Referenced by ff_rdft_calc_c(), imc_imdct256(), and main().
void ff_fft_permute_c | ( | FFTContext * | s, | |
FFTComplex * | z | |||
) |
static void ff_imdct_calc | ( | FFTContext * | s, | |
FFTSample * | output, | |||
const FFTSample * | input | |||
) | [inline, static] |
Definition at line 138 of file fft.h.
Referenced by IMLT(), imlt_gain(), main(), nelly_decode_block(), and wma_decode_block().
void ff_imdct_calc_c | ( | FFTContext * | s, | |
FFTSample * | output, | |||
const FFTSample * | input | |||
) |
Compute inverse MDCT of size N = 2^nbits.
output | N samples | |
input | N/2 samples |
Definition at line 166 of file mdct.c.
Referenced by ff_fft_init().
static void ff_imdct_half | ( | FFTContext * | s, | |
FFTSample * | output, | |||
const FFTSample * | input | |||
) | [inline, static] |
Definition at line 142 of file fft.h.
Referenced by at1_imdct(), decode_subframe(), do_imdct(), imdct_and_window(), imdct_and_windowing(), sbr_qmf_analysis(), sbr_qmf_synthesis(), synth_filter_float(), and vorbis_parse_audio_packet().
void ff_imdct_half_c | ( | FFTContext * | s, | |
FFTSample * | output, | |||
const FFTSample * | input | |||
) |
Compute the middle half of the inverse MDCT of size N = 2^nbits, thus excluding the parts that can be derived by symmetry.
output | N/2 samples | |
input | N/2 samples |
Definition at line 124 of file mdct.c.
Referenced by ff_fft_init(), and ff_imdct_calc_c().
void ff_init_ff_cos_tabs | ( | int | index | ) |
Initializes the cosine table in ff_cos_tabs[index].
index | index in ff_cos_tabs array of the table to initialize |
Definition at line 67 of file fft.c.
Referenced by ff_dct_init(), ff_fft_init(), and ff_rdft_init().
void ff_init_ff_sine_windows | ( | int | index | ) |
initialize the specified entry of ff_sine_windows
Definition at line 55 of file mdct_tablegen.h.
Referenced by aac_decode_init(), aac_encode_init(), atrac1_decode_init(), decode_init(), ff_wma_init(), init_mdct_win(), and main().
void ff_kbd_window_init | ( | float * | window, | |
float | alpha, | |||
int | n | |||
) |
Generate a Kaiser-Bessel Derived Window.
window | pointer to half window | |
alpha | determines window shape | |
n | size of half window |
Definition at line 35 of file mdct.c.
Referenced by aac_decode_init(), aac_encode_init(), and ac3_decode_init().
static void ff_mdct_calc | ( | FFTContext * | s, | |
FFTSample * | output, | |||
const FFTSample * | input | |||
) | [inline, static] |
Definition at line 147 of file fft.h.
Referenced by apply_mdct(), apply_window_and_mdct(), and main().
void ff_mdct_calc_c | ( | FFTContext * | s, | |
FFTSample * | out, | |||
const FFTSample * | input | |||
) |
Compute MDCT of size N = 2^nbits.
input | N samples | |
out | N/2 samples |
Definition at line 186 of file mdct.c.
Referenced by ff_fft_init().
void ff_mdct_end | ( | FFTContext * | s | ) |
Definition at line 228 of file mdct.c.
Referenced by aac_decode_close(), aac_encode_end(), ac3_decode_end(), atrac1_decode_end(), cook_decode_close(), dca_decode_end(), decode_end(), encode_end(), ff_aac_sbr_ctx_close(), ff_mdct_init(), ff_wma_end(), main(), twin_decode_close(), vorbis_encode_close(), and vorbis_free().
int ff_mdct_init | ( | FFTContext * | s, | |
int | nbits, | |||
int | inverse, | |||
double | scale | |||
) |
init MDCT or IMDCT computation.
Definition at line 61 of file mdct.c.
Referenced by aac_decode_init(), aac_encode_init(), ac3_decode_init(), atrac1_decode_init(), create_vorbis_context(), dca_decode_init(), decode_init(), encode_init(), ff_aac_sbr_ctx_init(), init_atrac3_transforms(), init_cook_mlt(), init_mdct_win(), main(), vorbis_parse_id_hdr(), and wma_decode_init().
static av_always_inline void ff_rdft_calc | ( | RDFTContext * | s, | |
FFTSample * | data | |||
) | [static] |
Definition at line 212 of file fft.h.
Referenced by calc_input_response(), decode_block(), ff_dct_calc_I_c(), ff_dct_calc_II_c(), ff_dct_calc_III_c(), ff_dst_calc_I_c(), main(), qdm2_calculate_fft(), and wiener_denoise().
void ff_rdft_end | ( | RDFTContext * | s | ) |
Definition at line 130 of file rdft.c.
Referenced by decode_end(), ff_dct_end(), main(), qdm2_decode_close(), and wmavoice_decode_end().
int ff_rdft_init | ( | RDFTContext * | s, | |
int | nbits, | |||
enum RDFTransformType | trans | |||
) |
Sets up a real FFT.
nbits | log2 of the length of the input array | |
trans | the type of transform |
Definition at line 99 of file rdft.c.
Referenced by decode_init(), ff_dct_init(), main(), qdm2_decode_init(), and wmavoice_decode_init().
void ff_rdft_init_arm | ( | RDFTContext * | s | ) |
Referenced by ff_rdft_init().
void ff_sine_window_init | ( | float * | window, | |
int | n | |||
) |
Generate a sine window.
window | pointer to half window | |
n | size of half window |
Definition at line 49 of file mdct_tablegen.h.
Referenced by encode_init(), ff_init_ff_sine_windows(), imc_decode_init(), init_cook_mlt(), and wmavoice_decode_init().
SINETABLE | ( | 4096 | ) |
SINETABLE | ( | 2048 | ) |
SINETABLE | ( | 1024 | ) |
SINETABLE | ( | 512 | ) |
SINETABLE | ( | 256 | ) |
SINETABLE | ( | 128 | ) |
SINETABLE | ( | 64 | ) |
SINETABLE | ( | 32 | ) |
SINTABLE | ( | 65536 | ) |
SINTABLE | ( | 32768 | ) |
SINTABLE | ( | 16384 | ) |
SINTABLE | ( | 8192 | ) |
SINTABLE | ( | 4096 | ) |
SINTABLE | ( | 2048 | ) |
SINTABLE | ( | 1024 | ) |
SINTABLE | ( | 512 | ) |
SINTABLE | ( | 256 | ) |
SINTABLE | ( | 128 | ) |
SINTABLE | ( | 64 | ) |
SINTABLE | ( | 32 | ) |
SINTABLE | ( | 16 | ) |
COSTABLE_CONST FFTSample* const ff_cos_tabs[17] |
Definition at line 50 of file fft.c.
Referenced by ff_dct_init(), ff_init_ff_cos_tabs(), and ff_rdft_init().
SINETABLE_CONST float* const ff_sine_windows[13] |
Definition at line 42 of file mdct_tablegen.h.
Referenced by decode_init(), ff_init_ff_sine_windows(), ff_wma_init(), imdct_and_window(), and main().