webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Classes | Macros | Typedefs | Functions
kiss_fft.h File Reference
#include <stdlib.h>
#include <math.h>
#include "arch.h"
#include "cpu_support.h"

Go to the source code of this file.

Classes

struct  kiss_fft_cpx
 
struct  kiss_twiddle_cpx
 
struct  arch_fft_state
 
struct  kiss_fft_state
 

Macros

#define KISS_FFT_MALLOC   opus_alloc
 
#define kiss_fft_scalar   float
 
#define kiss_twiddle_scalar   float
 
#define KF_SUFFIX   _celt_single
 
#define MAXFACTORS   8
 
#define opus_fft_alloc_arch(_st, arch)   ((void)(arch), opus_fft_alloc_arch_c(_st))
 
#define opus_fft_free_arch(_st, arch)   ((void)(arch), opus_fft_free_arch_c(_st))
 
#define opus_fft(_cfg, _fin, _fout, arch)   ((void)(arch), opus_fft_c(_cfg, _fin, _fout))
 
#define opus_ifft(_cfg, _fin, _fout, arch)   ((void)(arch), opus_ifft_c(_cfg, _fin, _fout))
 

Typedefs

typedef struct arch_fft_state arch_fft_state
 
typedef struct kiss_fft_state kiss_fft_state
 

Functions

kiss_fft_stateopus_fft_alloc_twiddles (int nfft, void *mem, size_t *lenmem, const kiss_fft_state *base, int arch)
 
kiss_fft_stateopus_fft_alloc (int nfft, void *mem, size_t *lenmem, int arch)
 
void opus_fft_c (const kiss_fft_state *cfg, const kiss_fft_cpx *fin, kiss_fft_cpx *fout)
 
void opus_ifft_c (const kiss_fft_state *cfg, const kiss_fft_cpx *fin, kiss_fft_cpx *fout)
 
void opus_fft_impl (const kiss_fft_state *st, kiss_fft_cpx *fout)
 
void opus_ifft_impl (const kiss_fft_state *st, kiss_fft_cpx *fout)
 
void opus_fft_free (const kiss_fft_state *cfg, int arch)
 
void opus_fft_free_arch_c (kiss_fft_state *st)
 
int opus_fft_alloc_arch_c (kiss_fft_state *st)
 

Macro Definition Documentation

◆ KF_SUFFIX

#define KF_SUFFIX   _celt_single

◆ KISS_FFT_MALLOC

#define KISS_FFT_MALLOC   opus_alloc

◆ kiss_fft_scalar

#define kiss_fft_scalar   float

◆ kiss_twiddle_scalar

#define kiss_twiddle_scalar   float

◆ MAXFACTORS

#define MAXFACTORS   8

◆ opus_fft

#define opus_fft (   _cfg,
  _fin,
  _fout,
  arch 
)    ((void)(arch), opus_fft_c(_cfg, _fin, _fout))

◆ opus_fft_alloc_arch

#define opus_fft_alloc_arch (   _st,
  arch 
)    ((void)(arch), opus_fft_alloc_arch_c(_st))

◆ opus_fft_free_arch

#define opus_fft_free_arch (   _st,
  arch 
)    ((void)(arch), opus_fft_free_arch_c(_st))

◆ opus_ifft

#define opus_ifft (   _cfg,
  _fin,
  _fout,
  arch 
)    ((void)(arch), opus_ifft_c(_cfg, _fin, _fout))

Typedef Documentation

◆ arch_fft_state

◆ kiss_fft_state

Function Documentation

◆ opus_fft_alloc()

kiss_fft_state* opus_fft_alloc ( int  nfft,
void mem,
size_t lenmem,
int  arch 
)

◆ opus_fft_alloc_arch_c()

int opus_fft_alloc_arch_c ( kiss_fft_state st)

◆ opus_fft_alloc_twiddles()

kiss_fft_state* opus_fft_alloc_twiddles ( int  nfft,
void mem,
size_t lenmem,
const kiss_fft_state base,
int  arch 
)

opus_fft_alloc

Initialize a FFT (or IFFT) algorithm's cfg/state buffer.

typical usage: kiss_fft_cfg mycfg=opus_fft_alloc(1024,0,NULL,NULL);

The return value from fft_alloc is a cfg buffer used internally by the fft routine or NULL.

If lenmem is NULL, then opus_fft_alloc will allocate a cfg buffer using malloc. The returned value should be free()d when done to avoid memory leaks.

The state can be placed in a user supplied buffer 'mem': If lenmem is not NULL and mem is not NULL and *lenmem is large enough, then the function places the cfg in mem and the size used in *lenmem and returns mem.

If lenmem is not NULL and ( mem is NULL or *lenmem is not large enough), then the function returns NULL and places the minimum cfg buffer size in *lenmem.

◆ opus_fft_c()

void opus_fft_c ( const kiss_fft_state cfg,
const kiss_fft_cpx fin,
kiss_fft_cpx fout 
)

opus_fft(cfg,in_out_buf)

Perform an FFT on a complex input buffer. for a forward FFT, fin should be f[0] , f[1] , ... ,f[nfft-1] fout will be F[0] , F[1] , ... ,F[nfft-1] Note that each element is complex and can be accessed like f[k].r and f[k].i

◆ opus_fft_free()

void opus_fft_free ( const kiss_fft_state cfg,
int  arch 
)

◆ opus_fft_free_arch_c()

void opus_fft_free_arch_c ( kiss_fft_state st)

◆ opus_fft_impl()

void opus_fft_impl ( const kiss_fft_state st,
kiss_fft_cpx fout 
)

◆ opus_ifft_c()

void opus_ifft_c ( const kiss_fft_state cfg,
const kiss_fft_cpx fin,
kiss_fft_cpx fout 
)

◆ opus_ifft_impl()

void opus_ifft_impl ( const kiss_fft_state st,
kiss_fft_cpx fout 
)