FFmpeg
Data Structures | Macros | Functions | Variables
af_adecorrelate.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/ffmath.h"
#include "libavutil/lfg.h"
#include "libavutil/random_seed.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "audio.h"

Go to the source code of this file.

Data Structures

struct  APContext
 
struct  ADecorrelateContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define MAX_STAGES   16
 
#define FILTER_FC   1100.0
 
#define RT60_LF   0.1
 
#define RT60_HF   0.008
 
#define OFFSET(x)   offsetof(ADecorrelateContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

static int ap_init (APContext *ap, int fs, double delay)
 
static void ap_free (APContext *ap)
 
static double ap_run (APContext *ap, double x)
 
static void filter_channel_dbl (AVFilterContext *ctx, int ch, AVFrame *in, AVFrame *out)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_channels (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (adecorrelate)
 

Variables

static const AVOption adecorrelate_options []
 
static const AVFilterPad inputs []
 
const AVFilter ff_af_adecorrelate
 

Macro Definition Documentation

◆ MAX_STAGES

#define MAX_STAGES   16

Definition at line 30 of file af_adecorrelate.c.

◆ FILTER_FC

#define FILTER_FC   1100.0

Definition at line 31 of file af_adecorrelate.c.

◆ RT60_LF

#define RT60_LF   0.1

Definition at line 32 of file af_adecorrelate.c.

◆ RT60_HF

#define RT60_HF   0.008

Definition at line 33 of file af_adecorrelate.c.

◆ OFFSET

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

Definition at line 212 of file af_adecorrelate.c.

◆ FLAGS

Definition at line 213 of file af_adecorrelate.c.

Function Documentation

◆ ap_init()

static int ap_init ( APContext ap,
int  fs,
double  delay 
)
static

Definition at line 57 of file af_adecorrelate.c.

Referenced by config_input().

◆ ap_free()

static void ap_free ( APContext ap)
static

Definition at line 84 of file af_adecorrelate.c.

Referenced by uninit().

◆ ap_run()

static double ap_run ( APContext ap,
double  x 
)
static

Definition at line 90 of file af_adecorrelate.c.

Referenced by filter_channel_dbl().

◆ filter_channel_dbl()

static void filter_channel_dbl ( AVFilterContext ctx,
int  ch,
AVFrame in,
AVFrame out 
)
static

Definition at line 103 of file af_adecorrelate.c.

Referenced by config_input().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 123 of file af_adecorrelate.c.

◆ filter_channels()

static int filter_channels ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 156 of file af_adecorrelate.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 171 of file af_adecorrelate.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 198 of file af_adecorrelate.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( adecorrelate  )

Variable Documentation

◆ adecorrelate_options

const AVOption adecorrelate_options[]
static
Initial value:
= {
{ "stages", "set filtering stages", OFFSET(stages), AV_OPT_TYPE_INT, {.i64=6}, 1, MAX_STAGES, FLAGS },
{ "seed", "set random seed", OFFSET(seed), AV_OPT_TYPE_INT64, {.i64=-1}, -1, UINT_MAX, FLAGS },
{ NULL }
}

Definition at line 215 of file af_adecorrelate.c.

◆ inputs

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

Definition at line 223 of file af_adecorrelate.c.

◆ ff_af_adecorrelate

const AVFilter ff_af_adecorrelate
Initial value:
= {
.name = "adecorrelate",
.description = NULL_IF_CONFIG_SMALL("Apply decorrelation to input audio."),
.priv_size = sizeof(ADecorrelateContext),
.priv_class = &adecorrelate_class,
}

Definition at line 232 of file af_adecorrelate.c.

inputs
static const AVFilterPad inputs[]
Definition: af_adecorrelate.c:223
FILTER_SINGLE_SAMPLEFMT
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
Definition: internal.h:175
MAX_STAGES
#define MAX_STAGES
Definition: af_adecorrelate.c:30
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_adecorrelate.c:123
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_adecorrelate.c:171
FLAGS
#define FLAGS
Definition: af_adecorrelate.c:213
OFFSET
#define OFFSET(x)
Definition: af_adecorrelate.c:212
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Definition: opt.h:236
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
NULL
#define NULL
Definition: coverity.c:32
ff_audio_default_filterpad
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
Definition: audio.c:33
seed
static unsigned int seed
Definition: videogen.c:78
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:106
ADecorrelateContext
Definition: af_adecorrelate.c:41
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_adecorrelate.c:198
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:147
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
AV_SAMPLE_FMT_DBLP
@ AV_SAMPLE_FMT_DBLP
double, planar
Definition: samplefmt.h:67
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:117
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183