FFmpeg
Data Structures | Macros | Functions | Variables
af_acrossover.c File Reference

Crossover filter. More...

#include "libavutil/attributes.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/eval.h"
#include "libavutil/float_dsp.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  BiquadCoeffs
 
struct  AudioCrossoverContext
 

Macros

#define MAX_SPLITS   16
 
#define MAX_BANDS   MAX_SPLITS + 1
 
#define B0   0
 
#define B1   1
 
#define B2   2
 
#define A1   3
 
#define A2   4
 
#define OFFSET(x)   offsetof(AudioCrossoverContext, x)
 
#define AF   AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
 
#define BIQUAD_PROCESS(name, type)
 
#define XOVER_PROCESS(name, type, one, ff)
 

Functions

 AVFILTER_DEFINE_CLASS (acrossover)
 
static int parse_gains (AVFilterContext *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 
static void set_lp (BiquadCoeffs *b, double fc, double q, double sr)
 
static void set_hp (BiquadCoeffs *b, double fc, double q, double sr)
 
static void set_ap (BiquadCoeffs *b, double fc, double q, double sr)
 
static void set_ap1 (BiquadCoeffs *b, double fc, double sr)
 
static void calc_q_factors (int order, double *q)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption acrossover_options []
 
static const AVFilterPad inputs []
 
AVFilter ff_af_acrossover
 

Detailed Description

Crossover filter.

Split an audio stream into several bands.

Definition in file af_acrossover.c.

Macro Definition Documentation

#define MAX_SPLITS   16

Definition at line 39 of file af_acrossover.c.

Referenced by init().

#define MAX_BANDS   MAX_SPLITS + 1

Definition at line 40 of file af_acrossover.c.

Referenced by parse_gains().

#define B0   0

Definition at line 42 of file af_acrossover.c.

Referenced by set_ap(), set_ap1(), set_hp(), and set_lp().

#define B1   1

Definition at line 43 of file af_acrossover.c.

Referenced by set_ap(), set_ap1(), set_hp(), and set_lp().

#define B2   2

Definition at line 44 of file af_acrossover.c.

Referenced by set_ap(), set_ap1(), set_hp(), and set_lp().

#define A1   3

Definition at line 45 of file af_acrossover.c.

Referenced by set_ap(), set_ap1(), set_hp(), and set_lp().

#define A2   4

Definition at line 46 of file af_acrossover.c.

Referenced by set_ap(), set_ap1(), set_hp(), and set_lp().

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

Definition at line 84 of file af_acrossover.c.

Definition at line 85 of file af_acrossover.c.

#define BIQUAD_PROCESS (   name,
  type 
)

Definition at line 336 of file af_acrossover.c.

#define XOVER_PROCESS (   name,
  type,
  one,
  ff 
)

Definition at line 385 of file af_acrossover.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( acrossover  )
static int parse_gains ( AVFilterContext ctx)
static

Definition at line 107 of file af_acrossover.c.

Referenced by init().

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 142 of file af_acrossover.c.

static void set_lp ( BiquadCoeffs b,
double  fc,
double  q,
double  sr 
)
static

Definition at line 203 of file af_acrossover.c.

Referenced by config_input().

static void set_hp ( BiquadCoeffs b,
double  fc,
double  q,
double  sr 
)
static

Definition at line 229 of file af_acrossover.c.

Referenced by config_input().

static void set_ap ( BiquadCoeffs b,
double  fc,
double  q,
double  sr 
)
static

Definition at line 255 of file af_acrossover.c.

Referenced by config_input().

static void set_ap1 ( BiquadCoeffs b,
double  fc,
double  sr 
)
static

Definition at line 281 of file af_acrossover.c.

Referenced by config_input().

static void calc_q_factors ( int  order,
double *  q 
)
static

Definition at line 298 of file af_acrossover.c.

Referenced by config_input().

static int query_formats ( AVFilterContext ctx)
static

Definition at line 306 of file af_acrossover.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 460 of file af_acrossover.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 509 of file af_acrossover.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 550 of file af_acrossover.c.

Variable Documentation

const AVOption acrossover_options[]
static
Initial value:
= {
{ "split", "set split frequencies", OFFSET(splits_str), AV_OPT_TYPE_STRING, {.str="500"}, 0, 0, AF },
{ "order", "set filter order", OFFSET(order_opt), AV_OPT_TYPE_INT, {.i64=1}, 0, 9, AF, "m" },
{ "2nd", "2nd order (12 dB/8ve)", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, AF, "m" },
{ "4th", "4th order (24 dB/8ve)", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, AF, "m" },
{ "6th", "6th order (36 dB/8ve)", 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, AF, "m" },
{ "8th", "8th order (48 dB/8ve)", 0, AV_OPT_TYPE_CONST, {.i64=3}, 0, 0, AF, "m" },
{ "10th", "10th order (60 dB/8ve)",0, AV_OPT_TYPE_CONST, {.i64=4}, 0, 0, AF, "m" },
{ "12th", "12th order (72 dB/8ve)",0, AV_OPT_TYPE_CONST, {.i64=5}, 0, 0, AF, "m" },
{ "14th", "14th order (84 dB/8ve)",0, AV_OPT_TYPE_CONST, {.i64=6}, 0, 0, AF, "m" },
{ "16th", "16th order (96 dB/8ve)",0, AV_OPT_TYPE_CONST, {.i64=7}, 0, 0, AF, "m" },
{ "18th", "18th order (108 dB/8ve)",0, AV_OPT_TYPE_CONST, {.i64=8}, 0, 0, AF, "m" },
{ "20th", "20th order (120 dB/8ve)",0, AV_OPT_TYPE_CONST, {.i64=9}, 0, 0, AF, "m" },
{ "level", "set input gain", OFFSET(level_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, AF },
{ "gain", "set output bands gain", OFFSET(gains_str), AV_OPT_TYPE_STRING, {.str="1.f"}, 0, 0, AF },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define AF
Definition: af_acrossover.c:85
#define OFFSET(x)
Definition: af_acrossover.c:84

Definition at line 87 of file af_acrossover.c.

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

Definition at line 562 of file af_acrossover.c.

AVFilter ff_af_acrossover
Initial value:
= {
.name = "acrossover",
.description = NULL_IF_CONFIG_SMALL("Split audio into per-bands streams."),
.priv_size = sizeof(AudioCrossoverContext),
.priv_class = &acrossover_class,
.init = init,
}
#define NULL
Definition: coverity.c:32
static av_cold int init(AVFilterContext *ctx)
static const AVFilterPad inputs[]
#define AVFILTER_FLAG_DYNAMIC_OUTPUTS
The number of the filter outputs is not determined just by AVFilter.outputs.
Definition: avfilter.h:112
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:153
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:117
static int query_formats(AVFilterContext *ctx)
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
#define flags(name, subs,...)
Definition: cbs_av1.c:560
static av_cold void uninit(AVFilterContext *ctx)

Definition at line 572 of file af_acrossover.c.