af_aphaser.c File Reference

phaser audio filter More...

#include "libavutil/avassert.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "internal.h"
Include dependency graph for af_aphaser.c:

Go to the source code of this file.

Data Structures

struct  AudioPhaserContext
 

Macros

#define OFFSET(x)   offsetof(AudioPhaserContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define MOD(a, b)   (((a) >= (b)) ? (a) - (b) : (a))
 
#define PHASER_PLANAR(name, type)
 
#define PHASER(name, type)
 

Typedefs

typedef struct AudioPhaserContext AudioPhaserContext
 

Enumerations

enum  WaveType { WAVE_SIN, WAVE_TRI, WAVE_NB }
 

Functions

 AVFILTER_DEFINE_CLASS (aphaser)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static void generate_wave_table (enum WaveType wave_type, enum AVSampleFormat sample_fmt, void *table, int table_size, double min, double max, double phase)
 
static int config_output (AVFilterLink *outlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *inbuf)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption aphaser_options []
 
static const AVFilterPad aphaser_inputs []
 
static const AVFilterPad aphaser_outputs []
 
AVFilter avfilter_af_aphaser
 

Detailed Description

phaser audio filter

Definition in file af_aphaser.c.

Macro Definition Documentation

Definition at line 61 of file af_aphaser.c.

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

Definition at line 180 of file af_aphaser.c.

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

Definition at line 60 of file af_aphaser.c.

#define PHASER (   name,
  type 
)

Definition at line 218 of file af_aphaser.c.

#define PHASER_PLANAR (   name,
  type 
)

Definition at line 182 of file af_aphaser.c.

Typedef Documentation

Enumeration Type Documentation

enum WaveType
Enumerator
WAVE_SIN 
WAVE_TRI 
WAVE_NB 

Definition at line 32 of file af_aphaser.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( aphaser  )
static int config_output ( AVFilterLink outlink)
static

Definition at line 264 of file af_aphaser.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame inbuf 
)
static

Definition at line 298 of file af_aphaser.c.

static void generate_wave_table ( enum WaveType  wave_type,
enum AVSampleFormat  sample_fmt,
void table,
int  table_size,
double  min,
double  max,
double  phase 
)
static

Definition at line 121 of file af_aphaser.c.

Referenced by config_output().

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 79 of file af_aphaser.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 91 of file af_aphaser.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 322 of file af_aphaser.c.

Variable Documentation

const AVFilterPad aphaser_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
{ NULL }
}
static int filter_frame(AVFilterLink *inlink, AVFrame *inbuf)
Definition: af_aphaser.c:298
NULL
Definition: eval.c:55

Definition at line 330 of file af_aphaser.c.

const AVOption aphaser_options[]
static
Initial value:
= {
{ "in_gain", "set input gain", OFFSET(in_gain), AV_OPT_TYPE_DOUBLE, {.dbl=.4}, 0, 1, FLAGS },
{ "out_gain", "set output gain", OFFSET(out_gain), AV_OPT_TYPE_DOUBLE, {.dbl=.74}, 0, 1e9, FLAGS },
{ "delay", "set delay in milliseconds", OFFSET(delay), AV_OPT_TYPE_DOUBLE, {.dbl=3.}, 0, 5, FLAGS },
{ "decay", "set decay", OFFSET(decay), AV_OPT_TYPE_DOUBLE, {.dbl=.4}, 0, .99, FLAGS },
{ "speed", "set modulation speed", OFFSET(speed), AV_OPT_TYPE_DOUBLE, {.dbl=.5}, .1, 2, FLAGS },
{ "type", "set modulation type", OFFSET(type), AV_OPT_TYPE_INT, {.i64=WAVE_TRI}, 0, WAVE_NB-1, FLAGS, "type" },
{ "triangular", NULL, 0, AV_OPT_TYPE_CONST, {.i64=WAVE_TRI}, 0, 0, FLAGS, "type" },
{ "t", NULL, 0, AV_OPT_TYPE_CONST, {.i64=WAVE_TRI}, 0, 0, FLAGS, "type" },
{ "sinusoidal", NULL, 0, AV_OPT_TYPE_CONST, {.i64=WAVE_SIN}, 0, 0, FLAGS, "type" },
{ "s", NULL, 0, AV_OPT_TYPE_CONST, {.i64=WAVE_SIN}, 0, 0, FLAGS, "type" },
{ NULL },
}
#define FLAGS
Definition: af_aphaser.c:61
NULL
Definition: eval.c:55
#define OFFSET(x)
Definition: af_aphaser.c:60
#define type

Definition at line 63 of file af_aphaser.c.

const AVFilterPad aphaser_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}
static int config_output(AVFilterLink *outlink)
Definition: af_aphaser.c:264
NULL
Definition: eval.c:55

Definition at line 339 of file af_aphaser.c.

AVFilter avfilter_af_aphaser
Initial value:
= {
.name = "aphaser",
.description = NULL_IF_CONFIG_SMALL("Add a phasing effect to the audio."),
.query_formats = query_formats,
.priv_size = sizeof(AudioPhaserContext),
.init = init,
.priv_class = &aphaser_class,
}
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:117
struct AudioPhaserContext AudioPhaserContext
static const AVFilterPad aphaser_outputs[]
Definition: af_aphaser.c:339
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_aphaser.c:322
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_cold int init(AVFilterContext *ctx)
Definition: af_aphaser.c:79
static int query_formats(AVFilterContext *ctx)
Definition: af_aphaser.c:91
static const AVFilterPad aphaser_inputs[]
Definition: af_aphaser.c:330
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

Definition at line 348 of file af_aphaser.c.