FFmpeg
Data Structures | Macros | Functions | Variables
af_aexciter.c File Reference
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "filters.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 []
 
const AVFilter ff_af_aexciter
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 52 of file af_aexciter.c.

◆ A

Definition at line 53 of file af_aexciter.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( aexciter  )

◆ M()

static double M ( double  x)
inlinestatic

Definition at line 69 of file af_aexciter.c.

Referenced by distortion_process().

◆ D()

static double D ( double  x)
inlinestatic

Definition at line 74 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 81 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 134 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 145 of file af_aexciter.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 173 of file af_aexciter.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 222 of file af_aexciter.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 229 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 246 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 55 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 259 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 268 of file af_aexciter.c.

AExciterContext
Definition: af_aexciter.c:37
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_aexciter.c:173
A
#define A
Definition: af_aexciter.c:53
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_aexciter.c:222
ceil
static __device__ float ceil(float a)
Definition: cuda_runtime.h:176
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
Definition: opt.h:267
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
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:246
avfilter_af_aexciter_inputs
static const AVFilterPad avfilter_af_aexciter_inputs[]
Definition: af_aexciter.c:259
NULL
#define NULL
Definition: coverity.c:32
ff_audio_default_filterpad
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
Definition: audio.c:34
OFFSET
#define OFFSET(x)
Definition: af_aexciter.c:52
FILTER_SINGLE_SAMPLEFMT
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
Definition: filters.h:255
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:94
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_aexciter.c:229
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327
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:190
AV_SAMPLE_FMT_DBL
@ AV_SAMPLE_FMT_DBL
double
Definition: samplefmt.h:61