FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
af_superequalizer.c File Reference
#include "libavutil/opt.h"
#include "libavcodec/avfft.h"
#include "audio.h"
#include "avfilter.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 av_cold int init (AVFilterContext *ctx)
 
static int query_formats (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 []
 
AVFilter ff_af_superequalizer
 

Macro Definition Documentation

#define NBANDS   17

Definition at line 30 of file af_superequalizer.c.

Referenced by hn(), and process_param().

#define M   15

Definition at line 31 of file af_superequalizer.c.

Referenced by equ_init(), and izero().

Definition at line 332 of file af_superequalizer.c.

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

Definition at line 333 of file af_superequalizer.c.

Function Documentation

static float izero ( SuperEqualizerContext s,
float  x 
)
static

Definition at line 60 of file af_superequalizer.c.

Referenced by equ_init(), and win().

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

Definition at line 75 of file af_superequalizer.c.

Referenced by hn().

static float hn_imp ( int  n)
static

Definition at line 85 of file af_superequalizer.c.

Referenced by hn().

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

Definition at line 90 of file af_superequalizer.c.

Referenced by make_fir().

static float alpha ( float  a)
static

Definition at line 109 of file af_superequalizer.c.

Referenced by equ_init(), and win().

static float win ( SuperEqualizerContext s,
float  n,
int  N 
)
static
static void process_param ( float *  bc,
EqParameter param,
float  fs 
)
static

Definition at line 123 of file af_superequalizer.c.

Referenced by make_fir().

static int equ_init ( SuperEqualizerContext s,
int  wb 
)
static

Definition at line 134 of file af_superequalizer.c.

Referenced by init().

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

Definition at line 162 of file af_superequalizer.c.

Referenced by config_output().

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 184 of file af_superequalizer.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 243 of file af_superequalizer.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 250 of file af_superequalizer.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 275 of file af_superequalizer.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 291 of file af_superequalizer.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 301 of file af_superequalizer.c.

AVFILTER_DEFINE_CLASS ( superequalizer  )

Variable Documentation

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 55 of file af_superequalizer.c.

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

const AVFilterPad superequalizer_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static int config_input(AVFilterLink *inlink)

Definition at line 313 of file af_superequalizer.c.

const AVFilterPad superequalizer_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_output(AVFilterLink *outlink)

Definition at line 323 of file af_superequalizer.c.

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 }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
#define AF

Definition at line 335 of file af_superequalizer.c.

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,
}
static int query_formats(AVFilterContext *ctx)
static const AVFilterPad superequalizer_outputs[]
static const AVFilterPad superequalizer_inputs[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
static av_cold void uninit(AVFilterContext *ctx)
static av_cold int init(AVFilterContext *ctx)

Definition at line 359 of file af_superequalizer.c.