FFmpeg
Data Structures | Macros | Functions | Variables
af_haas.c File Reference
#include "libavutil/channel_layout.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  HaasContext
 

Macros

#define MAX_HAAS_DELAY   40
 
#define OFFSET(x)   offsetof(HaasContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (haas)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption haas_options []
 
static const AVFilterPad inputs []
 
const AVFilter ff_af_haas
 

Macro Definition Documentation

◆ MAX_HAAS_DELAY

#define MAX_HAAS_DELAY   40

Definition at line 27 of file af_haas.c.

◆ OFFSET

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

Definition at line 56 of file af_haas.c.

◆ A

Definition at line 57 of file af_haas.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( haas  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 82 of file af_haas.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 97 of file af_haas.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 129 of file af_haas.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 192 of file af_haas.c.

Variable Documentation

◆ haas_options

const AVOption haas_options[]
static
Initial value:
= {
{ "level_in", "set level in", OFFSET(level_in), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
{ "level_out", "set level out", OFFSET(level_out), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
{ "side_gain", "set side gain", OFFSET(par_side_gain), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
{ "middle_source", "set middle source", OFFSET(par_m_source), AV_OPT_TYPE_INT, {.i64=2}, 0, 3, A, .unit = "source" },
{ "left", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, A, .unit = "source" },
{ "right", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, A, .unit = "source" },
{ "mid", "L+R", 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, A, .unit = "source" },
{ "side", "L-R", 0, AV_OPT_TYPE_CONST, {.i64=3}, 0, 0, A, .unit = "source" },
{ "middle_phase", "set middle phase", OFFSET(par_middle_phase), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
{ "left_delay", "set left delay", OFFSET(par_delay0), AV_OPT_TYPE_DOUBLE, {.dbl=2.05}, 0, MAX_HAAS_DELAY, A },
{ "left_balance", "set left balance", OFFSET(par_balance0), AV_OPT_TYPE_DOUBLE, {.dbl=-1.0}, -1, 1, A },
{ "left_gain", "set left gain", OFFSET(par_gain0), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
{ "left_phase", "set left phase", OFFSET(par_phase0), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
{ "right_delay", "set right delay", OFFSET(par_delay1), AV_OPT_TYPE_DOUBLE, {.dbl=2.12}, 0, MAX_HAAS_DELAY, A },
{ "right_balance", "set right balance", OFFSET(par_balance1), AV_OPT_TYPE_DOUBLE, {.dbl=1}, -1, 1, A },
{ "right_gain", "set right gain", OFFSET(par_gain1), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.015625, 64, A },
{ "right_phase", "set right phase", OFFSET(par_phase1), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, A },
{ NULL }
}

Definition at line 59 of file af_haas.c.

◆ inputs

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

Definition at line 200 of file af_haas.c.

◆ ff_af_haas

const AVFilter ff_af_haas
Initial value:
= {
.name = "haas",
.description = NULL_IF_CONFIG_SMALL("Apply Haas Stereo Enhancer."),
.priv_size = sizeof(HaasContext),
.priv_class = &haas_class,
}

Definition at line 209 of file af_haas.c.

config_input
static int config_input(AVFilterLink *inlink)
Definition: af_haas.c:97
A
#define A
Definition: af_haas.c:57
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_haas.c:82
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:159
OFFSET
#define OFFSET(x)
Definition: af_haas.c:56
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_haas.c:129
MAX_HAAS_DELAY
#define MAX_HAAS_DELAY
Definition: af_haas.c:27
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:237
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
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
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
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_haas.c:192
inputs
static const AVFilterPad inputs[]
Definition: af_haas.c:200
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:251
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
HaasContext
Definition: af_haas.c:29
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:244