FFmpeg
Data Structures | Macros | Functions | Variables
af_asupercut.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/ffmath.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "audio.h"

Go to the source code of this file.

Data Structures

struct  BiquadCoeffs
 
struct  ASuperCutContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define FILTER(name, type)
 
#define OFFSET(x)   offsetof(ASuperCutContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 

Functions

static void calc_q_factors (int n, double *q)
 
static int get_coeffs (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
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)
 
 AVFILTER_DEFINE_CLASS (asupercut)
 
 AVFILTER_DEFINE_CLASS (asubcut)
 
 AVFILTER_DEFINE_CLASS_EXT (asuperpass_asuperstop, "asuperpass/asuperstop", asuperpass_asuperstop_options)
 

Variables

static enum AVSampleFormat sample_fmts []
 
static const AVOption asupercut_options []
 
static const AVFilterPad inputs []
 
const AVFilter ff_af_asupercut
 
static const AVOption asubcut_options []
 
const AVFilter ff_af_asubcut
 
static const AVOption asuperpass_asuperstop_options []
 
const AVFilter ff_af_asuperpass
 
const AVFilter ff_af_asuperstop
 

Macro Definition Documentation

◆ FILTER

#define FILTER (   name,
  type 
)

Definition at line 204 of file af_asupercut.c.

◆ OFFSET

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

Definition at line 314 of file af_asupercut.c.

◆ FLAGS

Definition at line 315 of file af_asupercut.c.

Function Documentation

◆ calc_q_factors()

static void calc_q_factors ( int  n,
double q 
)
static

Definition at line 55 of file af_asupercut.c.

Referenced by get_coeffs().

◆ get_coeffs()

static int get_coeffs ( AVFilterContext ctx)
static

Definition at line 61 of file af_asupercut.c.

Referenced by config_input(), and process_command().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 247 of file af_asupercut.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 264 of file af_asupercut.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 295 of file af_asupercut.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 307 of file af_asupercut.c.

◆ AVFILTER_DEFINE_CLASS() [1/2]

AVFILTER_DEFINE_CLASS ( asupercut  )

◆ AVFILTER_DEFINE_CLASS() [2/2]

AVFILTER_DEFINE_CLASS ( asubcut  )

◆ AVFILTER_DEFINE_CLASS_EXT()

AVFILTER_DEFINE_CLASS_EXT ( asuperpass_asuperstop  ,
"asuperpass/asuperstop"  ,
asuperpass_asuperstop_options   
)

Variable Documentation

◆ sample_fmts

enum AVSampleFormat sample_fmts[]
static
Initial value:

Definition at line 51 of file af_asupercut.c.

◆ asupercut_options

const AVOption asupercut_options[]
static
Initial value:
= {
{ "cutoff", "set cutoff frequency", OFFSET(cutoff), AV_OPT_TYPE_DOUBLE, {.dbl=20000}, 20000, 192000, FLAGS },
{ "order", "set filter order", OFFSET(order), AV_OPT_TYPE_INT, {.i64=10}, 3, 20, FLAGS },
{ "level", "set input level", OFFSET(level), AV_OPT_TYPE_DOUBLE, {.dbl=1.}, 0., 1., FLAGS },
{ NULL }
}

Definition at line 317 of file af_asupercut.c.

◆ inputs

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

Definition at line 326 of file af_asupercut.c.

◆ ff_af_asupercut

const AVFilter ff_af_asupercut
Initial value:
= {
.name = "asupercut",
.description = NULL_IF_CONFIG_SMALL("Cut super frequencies."),
.priv_size = sizeof(ASuperCutContext),
.priv_class = &asupercut_class,
.process_command = process_command,
}

Definition at line 335 of file af_asupercut.c.

◆ asubcut_options

const AVOption asubcut_options[]
static
Initial value:
= {
{ "cutoff", "set cutoff frequency", OFFSET(cutoff), AV_OPT_TYPE_DOUBLE, {.dbl=20}, 2, 200, FLAGS },
{ "order", "set filter order", OFFSET(order), AV_OPT_TYPE_INT, {.i64=10}, 3, 20, FLAGS },
{ "level", "set input level", OFFSET(level), AV_OPT_TYPE_DOUBLE, {.dbl=1.}, 0., 1., FLAGS },
{ NULL }
}

Definition at line 349 of file af_asupercut.c.

◆ ff_af_asubcut

const AVFilter ff_af_asubcut
Initial value:
= {
.name = "asubcut",
.description = NULL_IF_CONFIG_SMALL("Cut subwoofer frequencies."),
.priv_size = sizeof(ASuperCutContext),
.priv_class = &asubcut_class,
.process_command = process_command,
}

Definition at line 358 of file af_asupercut.c.

◆ asuperpass_asuperstop_options

const AVOption asuperpass_asuperstop_options[]
static
Initial value:
= {
{ "centerf","set center frequency", OFFSET(cutoff), AV_OPT_TYPE_DOUBLE, {.dbl=1000}, 2, 999999, FLAGS },
{ "order", "set filter order", OFFSET(order), AV_OPT_TYPE_INT, {.i64=4}, 4, 20, FLAGS },
{ "qfactor","set Q-factor", OFFSET(qfactor),AV_OPT_TYPE_DOUBLE, {.dbl=1.},0.01, 100., FLAGS },
{ "level", "set input level", OFFSET(level), AV_OPT_TYPE_DOUBLE, {.dbl=1.}, 0., 2., FLAGS },
{ NULL }
}

Definition at line 372 of file af_asupercut.c.

◆ ff_af_asuperpass

const AVFilter ff_af_asuperpass
Initial value:
= {
.name = "asuperpass",
.description = NULL_IF_CONFIG_SMALL("Apply high order Butterworth band-pass filter."),
.priv_class = &asuperpass_asuperstop_class,
.priv_size = sizeof(ASuperCutContext),
.process_command = process_command,
}

Definition at line 383 of file af_asupercut.c.

◆ ff_af_asuperstop

const AVFilter ff_af_asuperstop
Initial value:
= {
.name = "asuperstop",
.description = NULL_IF_CONFIG_SMALL("Apply high order Butterworth band-stop filter."),
.priv_class = &asuperpass_asuperstop_class,
.priv_size = sizeof(ASuperCutContext),
.process_command = process_command,
}

Definition at line 397 of file af_asupercut.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
FLAGS
#define FLAGS
Definition: af_asupercut.c:315
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_asupercut.c:247
level
uint8_t level
Definition: svq3.c:204
ASuperCutContext
Definition: af_asupercut.c:33
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:227
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
OFFSET
#define OFFSET(x)
Definition: af_asupercut.c:314
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
NULL
#define NULL
Definition: coverity.c:32
ff_audio_default_filterpad
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
Definition: audio.c:33
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:106
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
FILTER_SAMPLEFMTS_ARRAY
#define FILTER_SAMPLEFMTS_ARRAY(array)
Definition: internal.h:165
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_asupercut.c:307
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:147
inputs
static const AVFilterPad inputs[]
Definition: af_asupercut.c:326
sample_fmts
static enum AVSampleFormat sample_fmts[]
Definition: af_asupercut.c:51
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_asupercut.c:295
AV_SAMPLE_FMT_DBLP
@ AV_SAMPLE_FMT_DBLP
double, planar
Definition: samplefmt.h:67
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
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_asupercut.c:264