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/mem.h"
#include "libavutil/random_seed.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "audio.h"
#include "filters.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 32 of file af_adecorrelate.c.

◆ FILTER_FC

#define FILTER_FC   1100.0

Definition at line 33 of file af_adecorrelate.c.

◆ RT60_LF

#define RT60_LF   0.1

Definition at line 34 of file af_adecorrelate.c.

◆ RT60_HF

#define RT60_HF   0.008

Definition at line 35 of file af_adecorrelate.c.

◆ OFFSET

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

Definition at line 214 of file af_adecorrelate.c.

◆ FLAGS

Definition at line 215 of file af_adecorrelate.c.

Function Documentation

◆ ap_init()

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

Definition at line 59 of file af_adecorrelate.c.

Referenced by config_input().

◆ ap_free()

static void ap_free ( APContext ap)
static

Definition at line 86 of file af_adecorrelate.c.

Referenced by uninit().

◆ ap_run()

static double ap_run ( APContext ap,
double  x 
)
static

Definition at line 92 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 105 of file af_adecorrelate.c.

Referenced by config_input().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 125 of file af_adecorrelate.c.

◆ filter_channels()

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

Definition at line 158 of file af_adecorrelate.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 173 of file af_adecorrelate.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 200 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 217 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 225 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 234 of file af_adecorrelate.c.

inputs
static const AVFilterPad inputs[]
Definition: af_adecorrelate.c:225
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
MAX_STAGES
#define MAX_STAGES
Definition: af_adecorrelate.c:32
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_adecorrelate.c:125
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_adecorrelate.c:173
FLAGS
#define FLAGS
Definition: af_adecorrelate.c:215
OFFSET
#define OFFSET(x)
Definition: af_adecorrelate.c:214
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Underlying C type is int64_t.
Definition: opt.h:263
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
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:34
seed
static unsigned int seed
Definition: videogen.c:78
FILTER_SINGLE_SAMPLEFMT
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
Definition: filters.h:255
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:94
ADecorrelateContext
Definition: af_adecorrelate.c:43
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_adecorrelate.c:200
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:182
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
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:152