FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
af_flanger.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
#include "avfilter.h"
#include "audio.h"
#include "internal.h"
#include "generate_wave_table.h"

Go to the source code of this file.

Data Structures

struct  FlangerContext
 

Macros

#define INTERPOLATION_LINEAR   0
 
#define INTERPOLATION_QUADRATIC   1
 
#define OFFSET(x)   offsetof(FlangerContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (flanger)
 
static int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption flanger_options []
 
static const AVFilterPad flanger_inputs []
 
static const AVFilterPad flanger_outputs []
 
AVFilter ff_af_flanger
 

Macro Definition Documentation

#define INTERPOLATION_LINEAR   0

Definition at line 29 of file af_flanger.c.

Referenced by filter_frame().

#define INTERPOLATION_QUADRATIC   1

Definition at line 30 of file af_flanger.c.

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

Definition at line 52 of file af_flanger.c.

Definition at line 53 of file af_flanger.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( flanger  )
static int init ( AVFilterContext ctx)
static

Definition at line 75 of file af_flanger.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 91 of file af_flanger.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 117 of file af_flanger.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 138 of file af_flanger.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 201 of file af_flanger.c.

Variable Documentation

const AVOption flanger_options[]
static
Initial value:
= {
{ "delay", "base delay in milliseconds", OFFSET(delay_min), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 30, A },
{ "depth", "added swept delay in milliseconds", OFFSET(delay_depth), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 0, 10, A },
{ "regen", "percentage regeneration (delayed signal feedback)", OFFSET(feedback_gain), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -95, 95, A },
{ "width", "percentage of delayed signal mixed with original", OFFSET(delay_gain), AV_OPT_TYPE_DOUBLE, {.dbl=71}, 0, 100, A },
{ "speed", "sweeps per second (Hz)", OFFSET(speed), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0.1, 10, A },
{ "shape", "swept wave shape", OFFSET(wave_shape), AV_OPT_TYPE_INT, {.i64=WAVE_SIN}, WAVE_SIN, WAVE_NB-1, A, "type" },
{ "triangular", NULL, 0, AV_OPT_TYPE_CONST, {.i64=WAVE_TRI}, 0, 0, A, "type" },
{ "t", NULL, 0, AV_OPT_TYPE_CONST, {.i64=WAVE_TRI}, 0, 0, A, "type" },
{ "sinusoidal", NULL, 0, AV_OPT_TYPE_CONST, {.i64=WAVE_SIN}, 0, 0, A, "type" },
{ "s", NULL, 0, AV_OPT_TYPE_CONST, {.i64=WAVE_SIN}, 0, 0, A, "type" },
{ "phase", "swept wave percentage phase-shift for multi-channel", OFFSET(channel_phase), AV_OPT_TYPE_DOUBLE, {.dbl=25}, 0, 100, A },
{ "interp", "delay-line interpolation", OFFSET(interpolation), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, A, "itype" },
{ "linear", NULL, 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATION_LINEAR}, 0, 0, A, "itype" },
{ "quadratic", NULL, 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATION_QUADRATIC}, 0, 0, A, "itype" },
{ NULL }
}

Definition at line 55 of file af_flanger.c.

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

Definition at line 213 of file af_flanger.c.

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

Definition at line 223 of file af_flanger.c.

AVFilter ff_af_flanger
Initial value:
= {
.name = "flanger",
.description = NULL_IF_CONFIG_SMALL("Apply a flanging effect to the audio."),
.query_formats = query_formats,
.priv_size = sizeof(FlangerContext),
.priv_class = &flanger_class,
.init = init,
}

Definition at line 231 of file af_flanger.c.