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"
#include "formats.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 []
 
static const AVFilterPad outputs []
 
const AVFilter ff_af_adecorrelate
 

Macro Definition Documentation

◆ MAX_STAGES

#define MAX_STAGES   16

Definition at line 31 of file af_adecorrelate.c.

◆ FILTER_FC

#define FILTER_FC   1100.0

Definition at line 32 of file af_adecorrelate.c.

◆ RT60_LF

#define RT60_LF   0.1

Definition at line 33 of file af_adecorrelate.c.

◆ RT60_HF

#define RT60_HF   0.008

Definition at line 34 of file af_adecorrelate.c.

◆ OFFSET

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

Definition at line 213 of file af_adecorrelate.c.

◆ FLAGS

Definition at line 214 of file af_adecorrelate.c.

Function Documentation

◆ ap_init()

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

Definition at line 58 of file af_adecorrelate.c.

Referenced by config_input().

◆ ap_free()

static void ap_free ( APContext ap)
static

Definition at line 85 of file af_adecorrelate.c.

Referenced by uninit().

◆ ap_run()

static double ap_run ( APContext ap,
double  x 
)
static

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

Referenced by config_input().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 124 of file af_adecorrelate.c.

◆ filter_channels()

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

Definition at line 157 of file af_adecorrelate.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 172 of file af_adecorrelate.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 199 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 216 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 224 of file af_adecorrelate.c.

◆ outputs

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

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

inputs
static const AVFilterPad inputs[]
Definition: af_adecorrelate.c:224
FILTER_SINGLE_SAMPLEFMT
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
Definition: internal.h:184
MAX_STAGES
#define MAX_STAGES
Definition: af_adecorrelate.c:31
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_adecorrelate.c:124
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_adecorrelate.c:172
FLAGS
#define FLAGS
Definition: af_adecorrelate.c:214
OFFSET
#define OFFSET(x)
Definition: af_adecorrelate.c:213
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Definition: opt.h:225
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:191
NULL
#define NULL
Definition: coverity.c:32
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:117
ADecorrelateContext
Definition: af_adecorrelate.c:42
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_adecorrelate.c:199
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:146
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
AV_SAMPLE_FMT_DBLP
@ AV_SAMPLE_FMT_DBLP
double, planar
Definition: samplefmt.h:70
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:121
outputs
static const AVFilterPad outputs[]
Definition: af_adecorrelate.c:233
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:192