FFmpeg  4.0
Data Structures | Macros | Functions | Variables
af_alimiter.c File Reference

Lookahead limiter filter. More...

#include "libavutil/avassert.h"
#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 query_formats (AVFilterContext *ctx)
 
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 []
 
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 65 of file af_alimiter.c.

◆ A

#define A   AV_OPT_FLAG_AUDIO_PARAM

Definition at line 66 of file af_alimiter.c.

◆ F

Definition at line 67 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 83 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 96 of file af_alimiter.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 115 of file af_alimiter.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 280 of file af_alimiter.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 310 of file af_alimiter.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 338 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 }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: af_alimiter.c:65
#define A
Definition: af_alimiter.c:66
#define F
Definition: af_alimiter.c:67

Definition at line 69 of file af_alimiter.c.

◆ alimiter_inputs

const AVFilterPad alimiter_inputs[]
static
Initial value:
= {
{
.name = "main",
.filter_frame = filter_frame,
.config_props = config_input,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_input(AVFilterLink *inlink)
Definition: af_alimiter.c:310
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_alimiter.c:115

Definition at line 347 of file af_alimiter.c.

◆ alimiter_outputs

const AVFilterPad alimiter_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32

Definition at line 357 of file af_alimiter.c.

◆ ff_af_alimiter

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,
}
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static av_cold int init(AVFilterContext *ctx)
Definition: af_alimiter.c:83
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_alimiter.c:338
static const AVFilterPad alimiter_inputs[]
Definition: af_alimiter.c:347
static const AVFilterPad alimiter_outputs[]
Definition: af_alimiter.c:357
static int query_formats(AVFilterContext *ctx)
Definition: af_alimiter.c:280

Definition at line 365 of file af_alimiter.c.