FFmpeg
Data Structures | Macros | Functions | Variables
af_alimiter.c File Reference
#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 }
}

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 }
}

Definition at line 347 of file af_alimiter.c.

◆ alimiter_outputs

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

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,
}

Definition at line 365 of file af_alimiter.c.

init
static av_cold int init(AVFilterContext *ctx)
Definition: af_alimiter.c:83
alimiter_inputs
static const AVFilterPad alimiter_inputs[]
Definition: af_alimiter.c:347
alimiter_outputs
static const AVFilterPad alimiter_outputs[]
Definition: af_alimiter.c:357
F
#define F
Definition: af_alimiter.c:67
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_alimiter.c:280
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:225
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_alimiter.c:338
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_alimiter.c:115
NULL
#define NULL
Definition: coverity.c:32
AudioLimiterContext
Definition: af_alimiter.c:37
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
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:188
A
#define A
Definition: af_alimiter.c:66
OFFSET
#define OFFSET(x)
Definition: af_alimiter.c:65
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:240
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_alimiter.c:310