FFmpeg
Data Structures | Macros | Functions | Variables
af_alimiter.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  AudioLimiterContext
 

Macros

#define OFFSET(x)   offsetof(AudioLimiterContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM
 
#define F   AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (alimiter)
 
static av_cold int init (AVFilterContext *ctx)
 
static double get_rdelta (AudioLimiterContext *s, double release, int sample_rate, double peak, double limit, double patt, int asc)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int config_input (AVFilterLink *inlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption alimiter_options []
 
static const AVFilterPad alimiter_inputs []
 
static const AVFilterPad alimiter_outputs []
 
const AVFilter ff_af_alimiter
 

Detailed Description

Lookahead limiter filter

Definition in file af_alimiter.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 64 of file af_alimiter.c.

◆ A

#define A   AV_OPT_FLAG_AUDIO_PARAM

Definition at line 65 of file af_alimiter.c.

◆ F

Definition at line 66 of file af_alimiter.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( alimiter  )

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 82 of file af_alimiter.c.

◆ get_rdelta()

static double get_rdelta ( AudioLimiterContext s,
double  release,
int  sample_rate,
double  peak,
double  limit,
double  patt,
int  asc 
)
static

Definition at line 95 of file af_alimiter.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 114 of file af_alimiter.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 279 of file af_alimiter.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 307 of file af_alimiter.c.

Variable Documentation

◆ alimiter_options

const AVOption alimiter_options[]
static
Initial value:
= {
{ "level_in", "set input level", OFFSET(level_in), AV_OPT_TYPE_DOUBLE, {.dbl=1},.015625, 64, A|F },
{ "level_out", "set output level", OFFSET(level_out), AV_OPT_TYPE_DOUBLE, {.dbl=1},.015625, 64, A|F },
{ "limit", "set limit", OFFSET(limit), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.0625, 1, A|F },
{ "attack", "set attack", OFFSET(attack), AV_OPT_TYPE_DOUBLE, {.dbl=5}, 0.1, 80, A|F },
{ "release", "set release", OFFSET(release), AV_OPT_TYPE_DOUBLE, {.dbl=50}, 1, 8000, A|F },
{ "asc", "enable asc", OFFSET(auto_release), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A|F },
{ "asc_level", "set asc level", OFFSET(asc_coeff), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0, 1, A|F },
{ "level", "auto level", OFFSET(auto_level), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, A|F },
{ NULL }
}

Definition at line 68 of file af_alimiter.c.

◆ alimiter_inputs

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

Definition at line 316 of file af_alimiter.c.

◆ alimiter_outputs

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

Definition at line 325 of file af_alimiter.c.

◆ ff_af_alimiter

const AVFilter ff_af_alimiter
Initial value:
= {
.name = "alimiter",
.description = NULL_IF_CONFIG_SMALL("Audio lookahead limiter."),
.priv_size = sizeof(AudioLimiterContext),
.priv_class = &alimiter_class,
.init = init,
}

Definition at line 332 of file af_alimiter.c.

init
static av_cold int init(AVFilterContext *ctx)
Definition: af_alimiter.c:82
FILTER_SINGLE_SAMPLEFMT
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
Definition: internal.h:184
alimiter_inputs
static const AVFilterPad alimiter_inputs[]
Definition: af_alimiter.c:316
alimiter_outputs
static const AVFilterPad alimiter_outputs[]
Definition: af_alimiter.c:325
F
#define F
Definition: af_alimiter.c:66
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:226
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_alimiter.c:307
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:191
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_alimiter.c:114
NULL
#define NULL
Definition: coverity.c:32
AudioLimiterContext
Definition: af_alimiter.c:36
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
A
#define A
Definition: af_alimiter.c:65
limit
static double limit(double x)
Definition: vf_pseudocolor.c:128
OFFSET
#define OFFSET(x)
Definition: af_alimiter.c:64
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:241
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:192
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_alimiter.c:279
AV_SAMPLE_FMT_DBL
@ AV_SAMPLE_FMT_DBL
double
Definition: samplefmt.h:64