iirfilter.h File Reference

IIR filter interface. More...

#include "avcodec.h"
Include dependency graph for iirfilter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  FFIIRFilterContext
 

Typedefs

typedef struct FFIIRFilterContext FFIIRFilterContext
 

Enumerations

enum  IIRFilterType {
  FF_FILTER_TYPE_BESSEL, FF_FILTER_TYPE_BIQUAD, FF_FILTER_TYPE_BUTTERWORTH, FF_FILTER_TYPE_CHEBYSHEV,
  FF_FILTER_TYPE_ELLIPTIC
}
 
enum  IIRFilterMode { FF_FILTER_MODE_LOWPASS, FF_FILTER_MODE_HIGHPASS, FF_FILTER_MODE_BANDPASS, FF_FILTER_MODE_BANDSTOP }
 

Functions

void ff_iir_filter_init (FFIIRFilterContext *f)
 Initialize FFIIRFilterContext. More...
 
void ff_iir_filter_init_mips (FFIIRFilterContext *f)
 
struct FFIIRFilterCoeffsff_iir_filter_init_coeffs (void *avc, enum IIRFilterType filt_type, enum IIRFilterMode filt_mode, int order, float cutoff_ratio, float stopband, float ripple)
 Initialize filter coefficients. More...
 
struct FFIIRFilterStateff_iir_filter_init_state (int order)
 Create new filter state. More...
 
void ff_iir_filter_free_coeffs (struct FFIIRFilterCoeffs *coeffs)
 Free filter coefficients. More...
 
void ff_iir_filter_free_state (struct FFIIRFilterState *state)
 Free filter state. More...
 
void ff_iir_filter (const struct FFIIRFilterCoeffs *coeffs, struct FFIIRFilterState *state, int size, const int16_t *src, int sstep, int16_t *dst, int dstep)
 Perform IIR filtering on signed 16-bit input samples. More...
 
void ff_iir_filter_flt (const struct FFIIRFilterCoeffs *coeffs, struct FFIIRFilterState *state, int size, const float *src, int sstep, float *dst, int dstep)
 Perform IIR filtering on floating-point input samples. More...
 

Detailed Description

IIR filter interface.

Definition in file iirfilter.h.

Typedef Documentation

Enumeration Type Documentation

Enumerator
FF_FILTER_MODE_LOWPASS 
FF_FILTER_MODE_HIGHPASS 
FF_FILTER_MODE_BANDPASS 
FF_FILTER_MODE_BANDSTOP 

Definition at line 43 of file iirfilter.h.

Enumerator
FF_FILTER_TYPE_BESSEL 
FF_FILTER_TYPE_BIQUAD 
FF_FILTER_TYPE_BUTTERWORTH 
FF_FILTER_TYPE_CHEBYSHEV 
FF_FILTER_TYPE_ELLIPTIC 

Definition at line 35 of file iirfilter.h.

Function Documentation

void ff_iir_filter ( const struct FFIIRFilterCoeffs coeffs,
struct FFIIRFilterState state,
int  size,
const int16_t *  src,
int  sstep,
int16_t *  dst,
int  dstep 
)

Perform IIR filtering on signed 16-bit input samples.

Parameters
coeffspointer to filter coefficients
statepointer to filter state
sizeinput length
srcsource samples
sstepsource stride
dstfiltered samples (destination may be the same as input)
dstepdestination stride

Definition at line 274 of file iirfilter.c.

Referenced by ff_iir_filter_init().

void ff_iir_filter_flt ( const struct FFIIRFilterCoeffs coeffs,
struct FFIIRFilterState state,
int  size,
const float *  src,
int  sstep,
float *  dst,
int  dstep 
)

Perform IIR filtering on floating-point input samples.

Parameters
coeffspointer to filter coefficients
statepointer to filter state
sizeinput length
srcsource samples
sstepsource stride
dstfiltered samples (destination may be the same as input)
dstepdestination stride

Definition at line 287 of file iirfilter.c.

Referenced by ff_iir_filter_init().

void ff_iir_filter_free_coeffs ( struct FFIIRFilterCoeffs coeffs)

Free filter coefficients.

Parameters
coeffspointer allocated with ff_iir_filter_init_coeffs()

Definition at line 305 of file iirfilter.c.

Referenced by ff_iir_filter_init(), ff_iir_filter_init_coeffs(), and ff_psy_preprocess_end().

void ff_iir_filter_free_state ( struct FFIIRFilterState state)

Free filter state.

Parameters
statepointer allocated with ff_iir_filter_init_state()

Definition at line 300 of file iirfilter.c.

Referenced by ff_iir_filter_init(), and ff_psy_preprocess_end().

void ff_iir_filter_init ( FFIIRFilterContext f)

Initialize FFIIRFilterContext.

Definition at line 314 of file iirfilter.c.

Referenced by ff_psy_preprocess_init().

struct FFIIRFilterCoeffs* ff_iir_filter_init_coeffs ( void avc,
enum IIRFilterType  filt_type,
enum IIRFilterMode  filt_mode,
int  order,
float  cutoff_ratio,
float  stopband,
float  ripple 
)

Initialize filter coefficients.

Parameters
avca pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct
filt_typefilter type (e.g. Butterworth)
filt_modefilter mode (e.g. lowpass)
orderfilter order
cutoff_ratiocutoff to input frequency ratio
stopbandstopband to input frequency ratio (used by bandpass and bandstop filter modes)
rippleripple factor (used only in Chebyshev filters)
Returns
pointer to filter coefficients structure or NULL if filter cannot be created

Definition at line 159 of file iirfilter.c.

Referenced by ff_iir_filter_init(), and ff_psy_preprocess_init().

void ff_iir_filter_init_mips ( FFIIRFilterContext f)

Definition at line 200 of file iirfilter_mips.c.

Referenced by ff_iir_filter_init().

struct FFIIRFilterState* ff_iir_filter_init_state ( int  order)

Create new filter state.

Parameters
orderfilter order
Returns
pointer to new filter state or NULL if state creation fails

Definition at line 201 of file iirfilter.c.

Referenced by ff_iir_filter_init(), and ff_psy_preprocess_init().