FFmpeg
Loading...
Searching...
No Matches
af_atilt.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/ffmath.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "audio.h"
#include "filters.h"

Go to the source code of this file.

Data Structures

struct  Coeffs
 
struct  ATiltContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define MAX_ORDER   30
 
#define FILTER(name, type)
 
#define OFFSET(x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 

Functions

static double prewarp (double w, double T, double wp)
 
static double mz (int i, double w0, double r, double alpha)
 
static double mp (int i, double w0, double r)
 
static double mzh (int i, double T, double w0, double r, double alpha)
 
static double mph (int i, double T, double w0, double r)
 
static void set_tf1s (Coeffs *coeffs, double b1, double b0, double a0, double w1, double sr, double alpha)
 
static void set_filter (AVFilterContext *ctx, int order, double sr, double f0, double bw, double alpha)
 
static int get_coeffs (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 
static av_cold void uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (atilt)
 

Variables

static const AVOption atilt_options []
 
static const AVFilterPad inputs []
 
const FFFilter ff_af_atilt
 

Macro Definition Documentation

◆ MAX_ORDER

#define MAX_ORDER   30

Definition at line 26 of file af_atilt.c.

◆ FILTER

#define FILTER ( name,
type )

Definition at line 120 of file af_atilt.c.

◆ OFFSET

#define OFFSET ( x)
Value:
offsetof(ATiltContext, x)

Definition at line 226 of file af_atilt.c.

◆ FLAGS

Function Documentation

◆ prewarp()

static double prewarp ( double w,
double T,
double wp )
static

Definition at line 50 of file af_atilt.c.

Referenced by mph(), and mzh().

◆ mz()

static double mz ( int i,
double w0,
double r,
double alpha )
static

Definition at line 55 of file af_atilt.c.

Referenced by DECL_FUNC(), and mzh().

◆ mp()

◆ mzh()

static double mzh ( int i,
double T,
double w0,
double r,
double alpha )
static

Definition at line 65 of file af_atilt.c.

Referenced by set_filter().

◆ mph()

static double mph ( int i,
double T,
double w0,
double r )
static

Definition at line 70 of file af_atilt.c.

Referenced by set_filter().

◆ set_tf1s()

static void set_tf1s ( Coeffs * coeffs,
double b1,
double b0,
double a0,
double w1,
double sr,
double alpha )
static

Definition at line 75 of file af_atilt.c.

Referenced by set_filter().

◆ set_filter()

static void set_filter ( AVFilterContext * ctx,
int order,
double sr,
double f0,
double bw,
double alpha )
static

Definition at line 87 of file af_atilt.c.

Referenced by get_coeffs().

◆ get_coeffs()

static int get_coeffs ( AVFilterContext * ctx)
static

Definition at line 106 of file af_atilt.c.

Referenced by config_input(), and process_command().

◆ config_input()

static int config_input ( AVFilterLink * inlink)
static

Definition at line 162 of file af_atilt.c.

◆ filter_frame()

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

Definition at line 179 of file af_atilt.c.

◆ 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 207 of file af_atilt.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext * ctx)
static

Definition at line 219 of file af_atilt.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( atilt )

Variable Documentation

◆ atilt_options

const AVOption atilt_options[]
static
Initial value:
= {
{ "freq", "set central frequency",OFFSET(freq), AV_OPT_TYPE_DOUBLE, {.dbl=10000}, 20, 192000, FLAGS },
{ "slope", "set filter slope", OFFSET(slope), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
{ "width", "set filter width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=1000}, 100, 10000, FLAGS },
{ "order", "set filter order", OFFSET(order), AV_OPT_TYPE_INT, {.i64=5}, 2,MAX_ORDER, FLAGS },
{ "level", "set input level", OFFSET(level), AV_OPT_TYPE_DOUBLE, {.dbl=1.}, 0., 4., FLAGS },
{ NULL }
}
#define FLAGS
Definition cmdutils.c:598
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ 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
uint8_t level
Definition svq3.c:208
#define width
Definition dsp.h:89
#define MAX_ORDER
Definition ttadata.h:28

Definition at line 229 of file af_atilt.c.

◆ inputs

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

Definition at line 240 of file af_atilt.c.

◆ ff_af_atilt

const FFFilter ff_af_atilt
Initial value:
= {
.p.name = "atilt",
.p.description = NULL_IF_CONFIG_SMALL("Apply spectral tilt to audio."),
.p.priv_class = &atilt_class,
.priv_size = sizeof(ATiltContext),
.process_command = process_command,
}
static const AVFilterPad inputs[]
Definition af_aap.c:299
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
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
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition avfilter.h:196
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition avfilter.h:166
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition samplefmt.h:66
@ AV_SAMPLE_FMT_DBLP
double, planar
Definition samplefmt.h:67
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 249 of file af_atilt.c.