FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 lin_knee_stop, double range)
 
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 63 of file af_agate.c.

Definition at line 64 of file af_agate.c.

#define FAKE_INFINITY   (65536.0 * 65536.0)

Definition at line 108 of file af_agate.c.

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

Definition at line 111 of file af_agate.c.

Referenced by output_gain().

Function Documentation

static int agate_config_input ( AVFilterLink inlink)
static

Definition at line 85 of file af_agate.c.

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

Definition at line 113 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 137 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 },
{ "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:63
#define A
Definition: af_agate.c:64

Definition at line 66 of file af_agate.c.