FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
af_biquads.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/ffmath.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ChanCache
 
struct  BiquadsContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define BIQUAD_FILTER(name, type, min, max, need_clipping)
 
#define BIQUAD_DII_FILTER(name, type, min, max, need_clipping)
 
#define BIQUAD_TDII_FILTER(name, type, min, max, need_clipping)
 
#define BIQUAD_LATT_FILTER(name, type, min, max, need_clipping)
 
#define OFFSET(x)   offsetof(BiquadsContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
#define AF   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define DEFINE_BIQUAD_FILTER(name_, description_)
 

Enumerations

enum  FilterType {
  DC_TYPE, AC_TYPE, SQ_TYPE, PS_TYPE,
  NB_TYPES, BUTTERWORTH, CHEBYSHEV1, CHEBYSHEV2,
  NB_TYPES, biquad, equalizer, bass,
  treble, bandpass, bandreject, allpass,
  highpass, lowpass, lowshelf, highshelf,
  WEAK, STRONG, NB_FILTER, LOWPASS,
  FLAT, AFLAT, CHROMA, COLOR,
  ACOLOR, XFLAT, YFLAT, NB_FILTERS
}
 
enum  WidthType {
  NONE, HERTZ, OCTAVE, QFACTOR,
  SLOPE, KHERTZ, NB_WTYPE
}
 
enum  TransformType {
  PREDICTOR_TRANSFORM = 0, COLOR_TRANSFORM = 1, SUBTRACT_GREEN = 2, COLOR_INDEXING_TRANSFORM = 3,
  DI, DII, TDII, LATT,
  NB_TTYPE
}
 

Functions

static int query_formats (AVFilterContext *ctx)
 
static void convert_dir2latt (BiquadsContext *s)
 
static int config_filter (AVFilterLink *outlink, int reset)
 
static int config_output (AVFilterLink *outlink)
 
static int filter_channel (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *buf)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 

Macro Definition Documentation

◆ BIQUAD_FILTER

#define BIQUAD_FILTER (   name,
  type,
  min,
  max,
  need_clipping 
)

Definition at line 203 of file af_biquads.c.

◆ BIQUAD_DII_FILTER

#define BIQUAD_DII_FILTER (   name,
  type,
  min,
  max,
  need_clipping 
)

Definition at line 286 of file af_biquads.c.

◆ BIQUAD_TDII_FILTER

#define BIQUAD_TDII_FILTER (   name,
  type,
  min,
  max,
  need_clipping 
)

Definition at line 334 of file af_biquads.c.

◆ BIQUAD_LATT_FILTER

#define BIQUAD_LATT_FILTER (   name,
  type,
  min,
  max,
  need_clipping 
)

Definition at line 381 of file af_biquads.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(BiquadsContext, x)

Definition at line 867 of file af_biquads.c.

◆ FLAGS

Definition at line 868 of file af_biquads.c.

◆ AF

Definition at line 869 of file af_biquads.c.

◆ DEFINE_BIQUAD_FILTER

#define DEFINE_BIQUAD_FILTER (   name_,
  description_ 
)
Value:
static av_cold int name_##_init(AVFilterContext *ctx) \
{ \
BiquadsContext *s = ctx->priv; \
s->filter_type = name_; \
return 0; \
} \
\
AVFilter ff_af_##name_ = { \
.name = #name_, \
.description = NULL_IF_CONFIG_SMALL(description_), \
.priv_size = sizeof(BiquadsContext), \
.init = name_##_init, \
.uninit = uninit, \
.inputs = inputs, \
.priv_class = &name_##_class, \
}

Definition at line 871 of file af_biquads.c.

Enumeration Type Documentation

◆ FilterType

enum FilterType
Enumerator
DC_TYPE 
AC_TYPE 
SQ_TYPE 
PS_TYPE 
NB_TYPES 
BUTTERWORTH 
CHEBYSHEV1 
CHEBYSHEV2 
NB_TYPES 
biquad 
equalizer 
bass 
treble 
bandpass 
bandreject 
allpass 
highpass 
lowpass 
lowshelf 
highshelf 
WEAK 
STRONG 
NB_FILTER 
LOWPASS 
FLAT 
AFLAT 
CHROMA 
COLOR 
ACOLOR 
XFLAT 
YFLAT 
NB_FILTERS 

Definition at line 72 of file af_biquads.c.

◆ WidthType

enum WidthType
Enumerator
NONE 
HERTZ 
OCTAVE 
QFACTOR 
SLOPE 
KHERTZ 
NB_WTYPE 

Definition at line 86 of file af_biquads.c.

◆ TransformType

Enumerator
PREDICTOR_TRANSFORM 
COLOR_TRANSFORM 
SUBTRACT_GREEN 
COLOR_INDEXING_TRANSFORM 
DI 
DII 
TDII 
LATT 
NB_TTYPE 

Definition at line 96 of file af_biquads.c.

Function Documentation

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 145 of file af_biquads.c.

◆ convert_dir2latt()

static void convert_dir2latt ( BiquadsContext s)
static

Definition at line 436 of file af_biquads.c.

Referenced by config_filter().

◆ config_filter()

static int config_filter ( AVFilterLink outlink,
int  reset 
)
static

Definition at line 453 of file af_biquads.c.

Referenced by config_output(), and process_command().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 753 of file af_biquads.c.

◆ filter_channel()

static int filter_channel ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 762 of file af_biquads.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame buf 
)
static

Definition at line 789 of file af_biquads.c.

◆ process_command()

static int process_command ( AVFilterContext ctx,
const char *  cmd,
const char *  args,
char *  res,
int  res_len,
int  flags 
)
static

Definition at line 829 of file af_biquads.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 842 of file af_biquads.c.

Variable Documentation

◆ inputs

const AVFilterPad inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
{ NULL }
}

Definition at line 849 of file af_biquads.c.

◆ outputs

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}

Definition at line 858 of file af_biquads.c.

init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:31
BiquadsContext
Definition: af_biquads.c:110
outputs
static const AVFilterPad outputs[]
Definition: af_biquads.c:858
av_cold
#define av_cold
Definition: attributes.h:90
s
#define s(width, name)
Definition: cbs_vp9.c:257
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
ctx
AVFormatContext * ctx
Definition: movenc.c:48
NULL
#define NULL
Definition: coverity.c:32
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
Definition: af_biquads.c:789
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_biquads.c:829
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_biquads.c:753
inputs
static const AVFilterPad inputs[]
Definition: af_biquads.c:849
AVFILTER_DEFINE_CLASS
#define AVFILTER_DEFINE_CLASS(fname)
Definition: internal.h:288
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_biquads.c:145
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_biquads.c:842
AVFilterContext
An instance of a filter.
Definition: avfilter.h:341
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:117
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:134
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561