FFmpeg  4.0
Data Structures | Macros | Functions | Variables
af_chorus.c File Reference

chorus audio filter More...

#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "internal.h"
#include "generate_wave_table.h"

Go to the source code of this file.

Data Structures

struct  ChorusContext
 

Macros

#define OFFSET(x)   offsetof(ChorusContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define MOD(a, b)   (((a) >= (b)) ? (a) - (b) : (a))
 

Functions

 AVFILTER_DEFINE_CLASS (chorus)
 
static void count_items (char *item_str, int *nb_items)
 
static void fill_items (char *item_str, int *nb_items, float *items)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 
static int request_frame (AVFilterLink *outlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption chorus_options []
 
static const AVFilterPad chorus_inputs []
 
static const AVFilterPad chorus_outputs []
 
AVFilter ff_af_chorus
 

Detailed Description

chorus audio filter

Definition in file af_chorus.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 63 of file af_chorus.c.

◆ A

Definition at line 64 of file af_chorus.c.

◆ MOD

#define MOD (   a,
  b 
)    (((a) >= (b)) ? (a) - (b) : (a))

Definition at line 238 of file af_chorus.c.

Referenced by filter_frame().

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( chorus  )

◆ count_items()

static void count_items ( char *  item_str,
int nb_items 
)
static

Definition at line 78 of file af_chorus.c.

Referenced by init().

◆ fill_items()

static void fill_items ( char *  item_str,
int nb_items,
float *  items 
)
static

Definition at line 90 of file af_chorus.c.

Referenced by init().

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 106 of file af_chorus.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 157 of file af_chorus.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 186 of file af_chorus.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 240 of file af_chorus.c.

Referenced by request_frame().

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 293 of file af_chorus.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 325 of file af_chorus.c.

Variable Documentation

◆ chorus_options

const AVOption chorus_options[]
static
Initial value:
= {
{ "in_gain", "set input gain", OFFSET(in_gain), AV_OPT_TYPE_FLOAT, {.dbl=.4}, 0, 1, A },
{ "out_gain", "set output gain", OFFSET(out_gain), AV_OPT_TYPE_FLOAT, {.dbl=.4}, 0, 1, A },
{ "delays", "set delays", OFFSET(delays_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
{ "decays", "set decays", OFFSET(decays_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
{ "speeds", "set speeds", OFFSET(speeds_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
{ "depths", "set depths", OFFSET(depths_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, A },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define A
Definition: af_chorus.c:64
#define OFFSET(x)
Definition: af_chorus.c:63

Definition at line 66 of file af_chorus.c.

◆ chorus_inputs

const AVFilterPad chorus_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: af_chorus.c:240

Definition at line 353 of file af_chorus.c.

◆ chorus_outputs

const AVFilterPad chorus_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
.config_props = config_output,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int request_frame(AVFilterLink *outlink)
Definition: af_chorus.c:293
static int config_output(AVFilterLink *outlink)
Definition: af_chorus.c:186

Definition at line 362 of file af_chorus.c.

◆ ff_af_chorus

AVFilter ff_af_chorus
Initial value:
= {
.name = "chorus",
.description = NULL_IF_CONFIG_SMALL("Add a chorus effect to the audio."),
.query_formats = query_formats,
.priv_size = sizeof(ChorusContext),
.priv_class = &chorus_class,
.init = init,
}
static int query_formats(AVFilterContext *ctx)
Definition: af_chorus.c:157
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_chorus.c:325
static const AVFilterPad chorus_inputs[]
Definition: af_chorus.c:353
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static av_cold int init(AVFilterContext *ctx)
Definition: af_chorus.c:106
static const AVFilterPad chorus_outputs[]
Definition: af_chorus.c:362

Definition at line 372 of file af_chorus.c.