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

Functions

static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
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

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

Definition at line 176 of file af_biquads.c.

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

Definition at line 541 of file af_biquads.c.

Definition at line 542 of file af_biquads.c.

Definition at line 543 of file af_biquads.c.

#define DEFINE_BIQUAD_FILTER (   name_,
  description_ 
)
Value:
static av_cold int name_##_init(AVFilterContext *ctx) \
{ \
BiquadsContext *s = ctx->priv; \
s->class = &name_##_class; \
s->filter_type = name_; \
} \
\
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, \
}
static const AVFilterPad inputs[]
Definition: af_biquads.c:523
#define av_cold
Definition: attributes.h:82
static const AVFilterPad outputs[]
Definition: af_biquads.c:532
static av_cold int init(AVFilterContext *ctx)
Definition: af_biquads.c:128
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
AVFormatContext * ctx
Definition: movenc.c:48
#define s(width, name)
Definition: cbs_vp9.c:257
static int query_formats(AVFilterContext *ctx)
Definition: af_biquads.c:143
#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:133
#define flags(name, subs,...)
Definition: cbs_av1.c:561
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_biquads.c:516
#define AVFILTER_DEFINE_CLASS(fname)
Definition: internal.h:334
An instance of a filter.
Definition: avfilter.h:338
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a it should return
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_biquads.c:503

Definition at line 545 of file af_biquads.c.

Enumeration Type Documentation

enum FilterType
Enumerator
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.

enum WidthType
Enumerator
NONE 
HERTZ 
OCTAVE 
QFACTOR 
SLOPE 
KHERTZ 
NB_WTYPE 

Definition at line 86 of file af_biquads.c.

Function Documentation

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 128 of file af_biquads.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 143 of file af_biquads.c.

static int config_filter ( AVFilterLink outlink,
int  reset 
)
static

Definition at line 259 of file af_biquads.c.

Referenced by config_output(), and process_command().

static int config_output ( AVFilterLink outlink)
static

Definition at line 430 of file af_biquads.c.

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

Definition at line 439 of file af_biquads.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame buf 
)
static

Definition at line 466 of file af_biquads.c.

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

Definition at line 503 of file af_biquads.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 516 of file af_biquads.c.

Variable Documentation

const AVFilterPad inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
Definition: af_biquads.c:466

Definition at line 523 of file af_biquads.c.

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_output(AVFilterLink *outlink)
Definition: af_biquads.c:430

Definition at line 532 of file af_biquads.c.