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"
#include "formats.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 []
 
static const AVFilterPad outputs []
 
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 205 of file af_asupercut.c.

◆ OFFSET

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

Definition at line 315 of file af_asupercut.c.

◆ FLAGS

Definition at line 316 of file af_asupercut.c.

Function Documentation

◆ calc_q_factors()

static void calc_q_factors ( int  n,
double q 
)
static

Definition at line 56 of file af_asupercut.c.

Referenced by get_coeffs().

◆ get_coeffs()

static int get_coeffs ( AVFilterContext ctx)
static

Definition at line 62 of file af_asupercut.c.

Referenced by config_input(), and process_command().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 248 of file af_asupercut.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

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

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 308 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 52 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 318 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 327 of file af_asupercut.c.

◆ outputs

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

Definition at line 336 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 343 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 357 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 366 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 380 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 391 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 405 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:316
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_asupercut.c:248
level
uint8_t level
Definition: svq3.c:206
ASuperCutContext
Definition: af_asupercut.c:34
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:315
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:190
NULL
#define NULL
Definition: coverity.c:32
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
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
FILTER_SAMPLEFMTS_ARRAY
#define FILTER_SAMPLEFMTS_ARRAY(array)
Definition: internal.h:173
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_asupercut.c:308
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:152
inputs
static const AVFilterPad inputs[]
Definition: af_asupercut.c:327
sample_fmts
static enum AVSampleFormat sample_fmts[]
Definition: af_asupercut.c:52
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:296
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:127
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_asupercut.c:265
outputs
static const AVFilterPad outputs[]
Definition: af_asupercut.c:336