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

Go to the source code of this file.

Data Structures

struct  EqParameter
 
struct  SuperEqualizerContext
 

Macros

#define NBANDS   17
 
#define M   15
 
#define AF   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define OFFSET(x)   offsetof(SuperEqualizerContext, x)
 

Functions

static float izero (SuperEqualizerContext *s, float x)
 
static float hn_lpf (int n, float f, float fs)
 
static float hn_imp (int n)
 
static float hn (int n, EqParameter *param, float fs)
 
static float alpha (float a)
 
static float win (SuperEqualizerContext *s, float n, int N)
 
static void process_param (float *bc, EqParameter *param, float fs)
 
static int equ_init (SuperEqualizerContext *s, int wb)
 
static void make_fir (SuperEqualizerContext *s, float *lbc, float *rbc, EqParameter *param, float fs)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int activate (AVFilterContext *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int config_output (AVFilterLink *outlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (superequalizer)
 

Variables

static const float bands []
 
static const AVFilterPad superequalizer_inputs []
 
static const AVFilterPad superequalizer_outputs []
 
static const AVOption superequalizer_options []
 
const AVFilter ff_af_superequalizer
 

Macro Definition Documentation

◆ NBANDS

#define NBANDS   17

Definition at line 30 of file af_superequalizer.c.

◆ M

#define M   15

Definition at line 31 of file af_superequalizer.c.

◆ AF

Definition at line 326 of file af_superequalizer.c.

◆ OFFSET

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

Definition at line 327 of file af_superequalizer.c.

Function Documentation

◆ izero()

static float izero ( SuperEqualizerContext s,
float  x 
)
static

Definition at line 61 of file af_superequalizer.c.

Referenced by equ_init(), and win().

◆ hn_lpf()

static float hn_lpf ( int  n,
float  f,
float  fs 
)
static

Definition at line 76 of file af_superequalizer.c.

Referenced by hn().

◆ hn_imp()

static float hn_imp ( int  n)
static

Definition at line 86 of file af_superequalizer.c.

Referenced by hn().

◆ hn()

static float hn ( int  n,
EqParameter param,
float  fs 
)
static

Definition at line 91 of file af_superequalizer.c.

Referenced by make_fir(), and vaapi_encode_h264_default_ref_pic_list().

◆ alpha()

static float alpha ( float  a)
static

Definition at line 110 of file af_superequalizer.c.

Referenced by equ_init(), and win().

◆ win()

static float win ( SuperEqualizerContext s,
float  n,
int  N 
)
static

◆ process_param()

static void process_param ( float bc,
EqParameter param,
float  fs 
)
static

Definition at line 124 of file af_superequalizer.c.

Referenced by make_fir().

◆ equ_init()

static int equ_init ( SuperEqualizerContext s,
int  wb 
)
static

Definition at line 135 of file af_superequalizer.c.

Referenced by init().

◆ make_fir()

static void make_fir ( SuperEqualizerContext s,
float lbc,
float rbc,
EqParameter param,
float  fs 
)
static

Definition at line 170 of file af_superequalizer.c.

Referenced by config_output().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 188 of file af_superequalizer.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 246 of file af_superequalizer.c.

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 268 of file af_superequalizer.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 275 of file af_superequalizer.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 287 of file af_superequalizer.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 297 of file af_superequalizer.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( superequalizer  )

Variable Documentation

◆ bands

const float bands[]
static
Initial value:
= {
65.406392, 92.498606, 130.81278, 184.99721, 261.62557, 369.99442, 523.25113, 739.9884, 1046.5023,
1479.9768, 2093.0045, 2959.9536, 4186.0091, 5919.9072, 8372.0181, 11839.814, 16744.036
}

Definition at line 56 of file af_superequalizer.c.

Referenced by decode_component(), ff_ivi_init_planes(), ff_ivi_init_tiles(), ff_mpc_dequantize_and_synth(), ff_psy_init(), ivi_free_buffers(), make_bands(), make_filters_from_proto(), mpc7_decode_frame(), mpc8_decode_frame(), process_param(), read_coeffs_coarse(), set_best_abits_code(), and set_special_band_scalefactors().

◆ superequalizer_inputs

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

Definition at line 310 of file af_superequalizer.c.

◆ superequalizer_outputs

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

Definition at line 318 of file af_superequalizer.c.

◆ superequalizer_options

const AVOption superequalizer_options[]
static
Initial value:
= {
{ "1b", "set 65Hz band gain", OFFSET(gains [0]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ "2b", "set 92Hz band gain", OFFSET(gains [1]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ "3b", "set 131Hz band gain", OFFSET(gains [2]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ "4b", "set 185Hz band gain", OFFSET(gains [3]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ "5b", "set 262Hz band gain", OFFSET(gains [4]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ "6b", "set 370Hz band gain", OFFSET(gains [5]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ "7b", "set 523Hz band gain", OFFSET(gains [6]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ "8b", "set 740Hz band gain", OFFSET(gains [7]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ "9b", "set 1047Hz band gain", OFFSET(gains [8]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ "10b", "set 1480Hz band gain", OFFSET(gains [9]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ "11b", "set 2093Hz band gain", OFFSET(gains[10]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ "12b", "set 2960Hz band gain", OFFSET(gains[11]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ "13b", "set 4186Hz band gain", OFFSET(gains[12]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ "14b", "set 5920Hz band gain", OFFSET(gains[13]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ "15b", "set 8372Hz band gain", OFFSET(gains[14]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ "16b", "set 11840Hz band gain", OFFSET(gains[15]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ "17b", "set 16744Hz band gain", OFFSET(gains[16]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ "18b", "set 20000Hz band gain", OFFSET(gains[17]), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 20, AF },
{ NULL }
}

Definition at line 329 of file af_superequalizer.c.

◆ ff_af_superequalizer

const AVFilter ff_af_superequalizer
Initial value:
= {
.name = "superequalizer",
.description = NULL_IF_CONFIG_SMALL("Apply 18 band equalization filter."),
.priv_size = sizeof(SuperEqualizerContext),
.priv_class = &superequalizer_class,
.init = init,
}

Definition at line 353 of file af_superequalizer.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_superequalizer.c:297
FILTER_SINGLE_SAMPLEFMT
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
Definition: internal.h:175
SuperEqualizerContext
Definition: af_superequalizer.c:37
AF
#define AF
Definition: af_superequalizer.c:326
init
static av_cold int init(AVFilterContext *ctx)
Definition: af_superequalizer.c:268
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_superequalizer.c:287
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
superequalizer_outputs
static const AVFilterPad superequalizer_outputs[]
Definition: af_superequalizer.c:318
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
NULL
#define NULL
Definition: coverity.c:32
OFFSET
#define OFFSET(x)
Definition: af_superequalizer.c:327
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:106
superequalizer_inputs
static const AVFilterPad superequalizer_inputs[]
Definition: af_superequalizer.c:310
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:238
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_superequalizer.c:275
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
activate
static int activate(AVFilterContext *ctx)
Definition: af_superequalizer.c:246