FFmpeg
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 av_cold 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 av_cold 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 120 of file af_flanger.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 141 of file af_flanger.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 206 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 }
}
#define NULL
Definition: coverity.c:32
#define A
Definition: af_flanger.c:53
static int interpolation(DeclickChannel *c, const double *src, int ar_order, double *acoefficients, int *index, int nb_errors, double *auxiliary, double *interpolated)
Definition: af_adeclick.c:351
#define INTERPOLATION_LINEAR
Definition: af_flanger.c:29
#define INTERPOLATION_QUADRATIC
Definition: af_flanger.c:30
#define OFFSET(x)
Definition: af_flanger.c:52

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 }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: af_flanger.c:141
static int config_input(AVFilterLink *inlink)
Definition: af_flanger.c:120

Definition at line 218 of file af_flanger.c.

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

Definition at line 228 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,
}
static av_cold int init(AVFilterContext *ctx)
Definition: af_flanger.c:75
static int query_formats(AVFilterContext *ctx)
Definition: af_flanger.c:91
#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 flanger_outputs[]
Definition: af_flanger.c:228
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_flanger.c:206
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
static const AVFilterPad flanger_inputs[]
Definition: af_flanger.c:218

Definition at line 236 of file af_flanger.c.