FFmpeg
Data Structures | Macros | Functions | Variables
af_aexciter.c File Reference
#include "libavutil/opt.h"
#include "avfilter.h"
#include "internal.h"
#include "audio.h"

Go to the source code of this file.

Data Structures

struct  ChannelParams
 sample data coding information More...
 
struct  AExciterContext
 

Macros

#define OFFSET(x)   offsetof(AExciterContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (aexciter)
 
static double M (double x)
 
static double D (double x)
 
static void set_params (ChannelParams *p, double blend, double drive, double srate, double freq, double ceil)
 
static double bprocess (double in, const double *const c, double *w1, double *w2)
 
static double distortion_process (AExciterContext *s, ChannelParams *p, double in)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 

Variables

static const AVOption aexciter_options []
 
static const AVFilterPad avfilter_af_aexciter_inputs []
 
static const AVFilterPad avfilter_af_aexciter_outputs []
 
const AVFilter ff_af_aexciter
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 51 of file af_aexciter.c.

◆ A

Definition at line 52 of file af_aexciter.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( aexciter  )

◆ M()

static double M ( double  x)
inlinestatic

Definition at line 68 of file af_aexciter.c.

Referenced by distortion_process().

◆ D()

static double D ( double  x)
inlinestatic

Definition at line 73 of file af_aexciter.c.

Referenced by distortion_process(), and set_params().

◆ set_params()

static void set_params ( ChannelParams p,
double  blend,
double  drive,
double  srate,
double  freq,
double  ceil 
)
static

Definition at line 80 of file af_aexciter.c.

Referenced by config_input().

◆ bprocess()

static double bprocess ( double  in,
const double *const  c,
double *  w1,
double *  w2 
)
static

Definition at line 133 of file af_aexciter.c.

Referenced by distortion_process().

◆ distortion_process()

static double distortion_process ( AExciterContext s,
ChannelParams p,
double  in 
)
static

Definition at line 144 of file af_aexciter.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 172 of file af_aexciter.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 221 of file af_aexciter.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 228 of file af_aexciter.c.

Referenced by process_command().

◆ process_command()

static int process_command ( AVFilterContext ctx,
const char *  cmd,
const char *  args,
char *  res,
int  res_len,
int  flags 
)
static

Definition at line 245 of file af_aexciter.c.

Variable Documentation

◆ aexciter_options

const AVOption aexciter_options[]
static
Initial value:
= {
{ "level_in", "set level in", OFFSET(level_in), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 64, A },
{ "level_out", "set level out", OFFSET(level_out), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 64, A },
{ "amount", "set amount", OFFSET(amount), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 64, A },
{ "drive", "set harmonics", OFFSET(drive), AV_OPT_TYPE_DOUBLE, {.dbl=8.5}, 0.1, 10, A },
{ "blend", "set blend harmonics", OFFSET(blend), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -10, 10, A },
{ "freq", "set scope", OFFSET(freq), AV_OPT_TYPE_DOUBLE, {.dbl=7500}, 2000, 12000, A },
{ "ceil", "set ceiling", OFFSET(ceil), AV_OPT_TYPE_DOUBLE, {.dbl=9999}, 9999, 20000, A },
{ "listen", "enable listen mode", OFFSET(listen), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, A },
{ NULL }
}

Definition at line 54 of file af_aexciter.c.

◆ avfilter_af_aexciter_inputs

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

Definition at line 258 of file af_aexciter.c.

◆ avfilter_af_aexciter_outputs

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

Definition at line 267 of file af_aexciter.c.

◆ ff_af_aexciter

const AVFilter ff_af_aexciter
Initial value:
= {
.name = "aexciter",
.description = NULL_IF_CONFIG_SMALL("Enhance high frequency part of audio."),
.priv_size = sizeof(AExciterContext),
.priv_class = &aexciter_class,
.process_command = process_command,
}

Definition at line 274 of file af_aexciter.c.

AExciterContext
Definition: af_aexciter.c:36
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_aexciter.c:172
A
#define A
Definition: af_aexciter.c:52
FILTER_SINGLE_SAMPLEFMT
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
Definition: internal.h:184
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_aexciter.c:221
ceil
static __device__ float ceil(float a)
Definition: cuda_runtime.h:176
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:226
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:191
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_aexciter.c:245
avfilter_af_aexciter_inputs
static const AVFilterPad avfilter_af_aexciter_inputs[]
Definition: af_aexciter.c:258
NULL
#define NULL
Definition: coverity.c:32
OFFSET
#define OFFSET(x)
Definition: af_aexciter.c:51
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
avfilter_af_aexciter_outputs
static const AVFilterPad avfilter_af_aexciter_outputs[]
Definition: af_aexciter.c:267
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_aexciter.c:228
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:241
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:192
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:138
AV_SAMPLE_FMT_DBL
@ AV_SAMPLE_FMT_DBL
double
Definition: samplefmt.h:64