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

Audio (Sidechain) Gate filter. More...

#include "libavutil/audio_fifo.h"
#include "libavutil/avassert.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)   offsetof(AudioGateContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define FAKE_INFINITY   (65536.0 * 65536.0)
 
#define IS_FAKE_INFINITY(value)   (fabs(value-FAKE_INFINITY) < 1.0)
 

Functions

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

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

Definition at line 65 of file af_agate.c.

Definition at line 66 of file af_agate.c.

#define FAKE_INFINITY   (65536.0 * 65536.0)

Definition at line 112 of file af_agate.c.

#define IS_FAKE_INFINITY (   value)    (fabs(value-FAKE_INFINITY) < 1.0)

Definition at line 115 of file af_agate.c.

Referenced by output_gain().

Function Documentation

static int agate_config_input ( AVFilterLink inlink)
static

Definition at line 90 of file af_agate.c.

Referenced by gate().

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 117 of file af_agate.c.

Referenced by 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 141 of file af_agate.c.

Variable Documentation

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, "mode" },
{ "downward",0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, A, "mode" },
{ "upward", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, A, "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, "detection" },
{ "peak", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, A, "detection" },
{ "rms", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, A, "detection" },
{ "link", "set link", OFFSET(link), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, A, "link" },
{ "average", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, A, "link" },
{ "maximum", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, A, "link" },
{ "level_sc", "set sidechain gain", OFFSET(level_sc), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: af_agate.c:65
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a link
#define A
Definition: af_agate.c:66
mode
Use these values in ebur128_init (or&#39;ed).
Definition: ebur128.h:83

Definition at line 68 of file af_agate.c.