FFmpeg
Loading...
Searching...
No Matches
af_aphaser.c File Reference

phaser audio filter More...

#include "libavutil/avassert.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "filters.h"
#include "generate_wave_table.h"

Go to the source code of this file.

Data Structures

struct  AudioPhaserContext
 

Macros

#define OFFSET(x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define MOD(a, b)
 
#define PHASER_PLANAR(name, type)
 
#define PHASER(name, type)
 

Functions

 AVFILTER_DEFINE_CLASS (aphaser)
 
static av_cold int init (AVFilterContext *ctx)
 
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 []
 
const FFFilter ff_af_aphaser
 

Detailed Description

phaser audio filter

Definition in file af_aphaser.c.

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 56 of file af_aphaser.c.

◆ FLAGS

Definition at line 57 of file af_aphaser.c.

◆ MOD

#define MOD ( a,
b )
Value:
(((a) >= (b)) ? (a) - (b) : (a))
int a
#define b
Definition input.c:43

Definition at line 87 of file af_aphaser.c.

◆ PHASER_PLANAR

#define PHASER_PLANAR ( name,
type )

Definition at line 89 of file af_aphaser.c.

◆ PHASER

#define PHASER ( name,
type )

Definition at line 125 of file af_aphaser.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( aphaser )

◆ init()

static av_cold int init ( AVFilterContext * ctx)
static

Definition at line 75 of file af_aphaser.c.

◆ config_output()

static int config_output ( AVFilterLink * outlink)
static

Definition at line 171 of file af_aphaser.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink * inlink,
AVFrame * inbuf )
static

Definition at line 209 of file af_aphaser.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext * ctx)
static

Definition at line 235 of file af_aphaser.c.

Variable Documentation

◆ aphaser_options

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, .unit = "type" },
{ "triangular", NULL, 0, AV_OPT_TYPE_CONST, {.i64=WAVE_TRI}, 0, 0, FLAGS, .unit = "type" },
{ "t", NULL, 0, AV_OPT_TYPE_CONST, {.i64=WAVE_TRI}, 0, 0, FLAGS, .unit = "type" },
{ "sinusoidal", NULL, 0, AV_OPT_TYPE_CONST, {.i64=WAVE_SIN}, 0, 0, FLAGS, .unit = "type" },
{ "s", NULL, 0, AV_OPT_TYPE_CONST, {.i64=WAVE_SIN}, 0, 0, FLAGS, .unit = "type" },
{ NULL }
}
#define FLAGS
Definition cmdutils.c:598
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
Definition opt.h:266
cl_device_type type

Definition at line 59 of file af_aphaser.c.

◆ aphaser_inputs

const AVFilterPad aphaser_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
}
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
Definition dolby_e.c:1067
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201

Definition at line 243 of file af_aphaser.c.

◆ aphaser_outputs

const AVFilterPad aphaser_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
}
static int config_output(AVBitStreamFilterLink *outlink)

Definition at line 251 of file af_aphaser.c.

◆ ff_af_aphaser

const FFFilter ff_af_aphaser
Initial value:
= {
.p.name = "aphaser",
.p.description = NULL_IF_CONFIG_SMALL("Add a phasing effect to the audio."),
.p.priv_class = &aphaser_class,
.priv_size = sizeof(AudioPhaserContext),
.init = init,
}
static const AVFilterPad aphaser_inputs[]
Definition af_aphaser.c:243
static const AVFilterPad aphaser_outputs[]
Definition af_aphaser.c:251
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition samplefmt.h:66
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition samplefmt.h:64
@ AV_SAMPLE_FMT_FLT
float
Definition samplefmt.h:60
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition samplefmt.h:65
@ AV_SAMPLE_FMT_S32
signed 32 bits
Definition samplefmt.h:59
@ AV_SAMPLE_FMT_DBLP
double, planar
Definition samplefmt.h:67
@ AV_SAMPLE_FMT_DBL
double
Definition samplefmt.h:61
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition samplefmt.h:58
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FILTER_SAMPLEFMTS(...)
Definition filters.h:252
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88

Definition at line 259 of file af_aphaser.c.