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

Go to the source code of this file.

Data Structures

struct  ASubBoostContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define OFFSET(x)   offsetof(ASubBoostContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 

Functions

static int get_coeffs (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_channels (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 
 AVFILTER_DEFINE_CLASS (asubboost)
 

Variables

static const AVOption asubboost_options []
 
static const AVFilterPad inputs []
 
const AVFilter ff_af_asubboost
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 214 of file af_asubboost.c.

◆ FLAGS

Definition at line 215 of file af_asubboost.c.

Function Documentation

◆ get_coeffs()

static int get_coeffs ( AVFilterContext ctx)
static

Definition at line 52 of file af_asubboost.c.

Referenced by config_input(), and process_command().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 77 of file af_asubboost.c.

◆ filter_channels()

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

Definition at line 95 of file af_asubboost.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 156 of file af_asubboost.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 192 of file af_asubboost.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 202 of file af_asubboost.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( asubboost  )

Variable Documentation

◆ asubboost_options

const AVOption asubboost_options[]
static
Initial value:
= {
{ "dry", "set dry gain", OFFSET(dry_gain), AV_OPT_TYPE_DOUBLE, {.dbl=1.0}, 0, 1, FLAGS },
{ "wet", "set wet gain", OFFSET(wet_gain), AV_OPT_TYPE_DOUBLE, {.dbl=1.0}, 0, 1, FLAGS },
{ "boost", "set max boost",OFFSET(max_boost),AV_OPT_TYPE_DOUBLE, {.dbl=2.0}, 1, 12, FLAGS },
{ "decay", "set decay", OFFSET(decay), AV_OPT_TYPE_DOUBLE, {.dbl=0.0}, 0, 1, FLAGS },
{ "feedback", "set feedback", OFFSET(feedback), AV_OPT_TYPE_DOUBLE, {.dbl=0.9}, 0, 1, FLAGS },
{ "cutoff", "set cutoff", OFFSET(cutoff), AV_OPT_TYPE_DOUBLE, {.dbl=100}, 50, 900, FLAGS },
{ "slope", "set slope", OFFSET(slope), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0.0001, 1, FLAGS },
{ "delay", "set delay", OFFSET(delay), AV_OPT_TYPE_DOUBLE, {.dbl=20}, 1, 100, FLAGS },
{ "channels", "set channels to filter", OFFSET(ch_layout_str), AV_OPT_TYPE_STRING, {.str="all"}, 0, 0, FLAGS },
{ NULL }
}

Definition at line 217 of file af_asubboost.c.

◆ inputs

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

Definition at line 232 of file af_asubboost.c.

◆ ff_af_asubboost

const AVFilter ff_af_asubboost
Initial value:
= {
.name = "asubboost",
.description = NULL_IF_CONFIG_SMALL("Boost subwoofer frequencies."),
.priv_size = sizeof(ASubBoostContext),
.priv_class = &asubboost_class,
.process_command = process_command,
}

Definition at line 241 of file af_asubboost.c.

inputs
static const AVFilterPad inputs[]
Definition: af_asubboost.c:232
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_asubboost.c:202
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_asubboost.c:77
ASubBoostContext
Definition: af_asubboost.c:27
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
Definition: opt.h:267
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
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:34
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_asubboost.c:156
FLAGS
#define FLAGS
Definition: af_asubboost.c:215
FILTER_SINGLE_SAMPLEFMT
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
Definition: filters.h:255
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:94
OFFSET
#define OFFSET(x)
Definition: af_asubboost.c:214
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_asubboost.c:192
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:152
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:190
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition: opt.h:276