FFmpeg
Loading...
Searching...
No Matches
af_agate.c File Reference

Audio (Sidechain) Gate filter. More...

#include "config_components.h"
#include "libavutil/audio_fifo.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "audio.h"
#include "filters.h"
#include "formats.h"
#include "hermite.h"

Go to the source code of this file.

Data Structures

struct  AudioGateContext
 

Macros

#define OFFSET(x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
#define FAKE_INFINITY   (65536.0 * 65536.0)
 
#define IS_FAKE_INFINITY(value)
 

Functions

 AVFILTER_DEFINE_CLASS_EXT (agate_sidechaingate, "agate/sidechaingate", options)
 
static int agate_config_input (AVFilterLink *inlink)
 
static double output_gain (double lin_slope, double ratio, double thres, double knee, double knee_start, double knee_stop, double range, int mode)
 
static void gate (AudioGateContext *s, const double *src, double *dst, const double *scsrc, int nb_samples, double level_in, double level_sc, AVFilterLink *inlink, AVFilterLink *sclink)
 

Variables

static const AVOption options []
 

Detailed Description

Audio (Sidechain) Gate filter.

Definition in file af_agate.c.

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 66 of file af_agate.c.

◆ A

◆ FAKE_INFINITY

#define FAKE_INFINITY   (65536.0 * 65536.0)

Definition at line 115 of file af_agate.c.

◆ IS_FAKE_INFINITY

#define IS_FAKE_INFINITY ( value)
Value:
#define FAKE_INFINITY
Definition af_agate.c:115
static __device__ float fabs(float a)
double value
Definition eval.c:102

Definition at line 118 of file af_agate.c.

Referenced by output_gain().

Function Documentation

◆ AVFILTER_DEFINE_CLASS_EXT()

AVFILTER_DEFINE_CLASS_EXT ( agate_sidechaingate ,
"agate/sidechaingate" ,
options  )

◆ agate_config_input()

static int agate_config_input ( AVFilterLink * inlink)
static

Definition at line 93 of file af_agate.c.

◆ output_gain()

static double output_gain ( double lin_slope,
double ratio,
double thres,
double knee,
double knee_start,
double knee_stop,
double range,
int mode )
static

Definition at line 120 of file af_agate.c.

Referenced by gate().

◆ gate()

static void gate ( AudioGateContext * s,
const double * src,
double * dst,
const double * scsrc,
int nb_samples,
double level_in,
double level_sc,
AVFilterLink * inlink,
AVFilterLink * sclink )
static

Definition at line 144 of file af_agate.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "level_in", "set input level", OFFSET(level_in), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
{ "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, A, .unit = "mode" },
{ "downward",0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, A, .unit = "mode" },
{ "upward", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, A, .unit = "mode" },
{ "range", "set max gain reduction", OFFSET(range), AV_OPT_TYPE_DOUBLE, {.dbl=0.06125}, 0, 1, A },
{ "threshold", "set threshold", OFFSET(threshold), AV_OPT_TYPE_DOUBLE, {.dbl=0.125}, 0, 1, A },
{ "ratio", "set ratio", OFFSET(ratio), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 1, 9000, A },
{ "attack", "set attack", OFFSET(attack), AV_OPT_TYPE_DOUBLE, {.dbl=20}, 0.01, 9000, A },
{ "release", "set release", OFFSET(release), AV_OPT_TYPE_DOUBLE, {.dbl=250}, 0.01, 9000, A },
{ "makeup", "set makeup gain", OFFSET(makeup), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 1, 64, A },
{ "knee", "set knee", OFFSET(knee), AV_OPT_TYPE_DOUBLE, {.dbl=2.828427125}, 1, 8, A },
{ "detection", "set detection", OFFSET(detection), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, A, .unit = "detection" },
{ "peak", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, A, .unit = "detection" },
{ "rms", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, A, .unit = "detection" },
{ "link", "set link", OFFSET(link), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, A, .unit = "link" },
{ "average", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, A, .unit = "link" },
{ "maximum", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, A, .unit = "link" },
{ "level_sc", "set sidechain gain", OFFSET(level_sc), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
{ NULL }
}
#define A(x)
Definition vpx_arith.h:28
#define NULL
Definition coverity.c:32
mode
Use these values in ebur128_init (or'ed).
Definition ebur128.h:83
#define OFFSET(x)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
Definition opt.h:266
enum AVColorRange range

Definition at line 69 of file af_agate.c.