FFmpeg  4.0
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 []
 
static const AVFilterPad outputs []
 
AVFilter ff_af_haas
 

Macro Definition Documentation

◆ MAX_HAAS_DELAY

#define MAX_HAAS_DELAY   40

Definition at line 27 of file af_haas.c.

Referenced by config_input().

◆ 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 98 of file af_haas.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 130 of file af_haas.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 193 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, "source" },
{ "left", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, A, "source" },
{ "right", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, A, "source" },
{ "mid", "L+R", 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, A, "source" },
{ "side", "L-R", 0, AV_OPT_TYPE_CONST, {.i64=3}, 0, 0, A, "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 }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: af_haas.c:56
#define A
Definition: af_haas.c:57
#define MAX_HAAS_DELAY
Definition: af_haas.c:27

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,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_input(AVFilterLink *inlink)
Definition: af_haas.c:98
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_haas.c:130

Definition at line 201 of file af_haas.c.

◆ outputs

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32

Definition at line 211 of file af_haas.c.

◆ ff_af_haas

AVFilter ff_af_haas
Initial value:
= {
.name = "haas",
.description = NULL_IF_CONFIG_SMALL("Apply Haas Stereo Enhancer."),
.query_formats = query_formats,
.priv_size = sizeof(HaasContext),
.priv_class = &haas_class,
}
static int query_formats(AVFilterContext *ctx)
Definition: af_haas.c:82
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVFilterPad inputs[]
Definition: af_haas.c:201
static const AVFilterPad outputs[]
Definition: af_haas.c:211
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_haas.c:193

Definition at line 219 of file af_haas.c.