FFmpeg
Data Structures | Macros | Functions | Variables
af_aemphasis.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  BiquadCoeffs
 
struct  BiquadD2
 
struct  RIAACurve
 
struct  AudioEmphasisContext
 

Macros

#define OFFSET(x)   offsetof(AudioEmphasisContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (aemphasis)
 
static double biquad (BiquadD2 *bq, double in)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int query_formats (AVFilterContext *ctx)
 
static void set_highshelf_rbj (BiquadD2 *bq, double freq, double q, double peak, double sr)
 
static void set_lp_rbj (BiquadD2 *bq, double fc, double q, double sr, double gain)
 
static double freq_gain (BiquadCoeffs *c, double freq, double sr)
 
static int config_input (AVFilterLink *inlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption aemphasis_options []
 
static const AVFilterPad avfilter_af_aemphasis_inputs []
 
static const AVFilterPad avfilter_af_aemphasis_outputs []
 
AVFilter ff_af_aemphasis
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 48 of file af_aemphasis.c.

◆ FLAGS

Definition at line 49 of file af_aemphasis.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( aemphasis  )

◆ biquad()

static double biquad ( BiquadD2 bq,
double  in 
)
inlinestatic

Definition at line 72 of file af_aemphasis.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 84 of file af_aemphasis.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 120 of file af_aemphasis.c.

◆ set_highshelf_rbj()

static void set_highshelf_rbj ( BiquadD2 bq,
double  freq,
double  q,
double  peak,
double  sr 
)
inlinestatic

Definition at line 150 of file af_aemphasis.c.

Referenced by config_input().

◆ set_lp_rbj()

static void set_lp_rbj ( BiquadD2 bq,
double  fc,
double  q,
double  sr,
double  gain 
)
inlinestatic

Definition at line 174 of file af_aemphasis.c.

Referenced by config_input().

◆ freq_gain()

static double freq_gain ( BiquadCoeffs c,
double  freq,
double  sr 
)
static

Definition at line 188 of file af_aemphasis.c.

Referenced by config_input().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 201 of file af_aemphasis.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 336 of file af_aemphasis.c.

Variable Documentation

◆ aemphasis_options

const AVOption aemphasis_options[]
static
Initial value:
= {
{ "level_in", "set input gain", OFFSET(level_in), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 64, FLAGS },
{ "level_out", "set output gain", OFFSET(level_out), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 64, FLAGS },
{ "mode", "set filter mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS, "mode" },
{ "reproduction", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "mode" },
{ "production", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "mode" },
{ "type", "set filter type", OFFSET(type), AV_OPT_TYPE_INT, {.i64=4}, 0, 8, FLAGS, "type" },
{ "col", "Columbia", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "type" },
{ "emi", "EMI", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "type" },
{ "bsi", "BSI (78RPM)", 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "type" },
{ "riaa", "RIAA", 0, AV_OPT_TYPE_CONST, {.i64=3}, 0, 0, FLAGS, "type" },
{ "cd", "Compact Disc (CD)", 0, AV_OPT_TYPE_CONST, {.i64=4}, 0, 0, FLAGS, "type" },
{ "50fm", "50µs (FM)", 0, AV_OPT_TYPE_CONST, {.i64=5}, 0, 0, FLAGS, "type" },
{ "75fm", "75µs (FM)", 0, AV_OPT_TYPE_CONST, {.i64=6}, 0, 0, FLAGS, "type" },
{ "50kf", "50µs (FM-KF)", 0, AV_OPT_TYPE_CONST, {.i64=7}, 0, 0, FLAGS, "type" },
{ "75kf", "75µs (FM-KF)", 0, AV_OPT_TYPE_CONST, {.i64=8}, 0, 0, FLAGS, "type" },
{ NULL }
}

Definition at line 51 of file af_aemphasis.c.

◆ avfilter_af_aemphasis_inputs

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

Definition at line 342 of file af_aemphasis.c.

◆ avfilter_af_aemphasis_outputs

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

Definition at line 352 of file af_aemphasis.c.

◆ ff_af_aemphasis

AVFilter ff_af_aemphasis
Initial value:
= {
.name = "aemphasis",
.description = NULL_IF_CONFIG_SMALL("Audio emphasis."),
.priv_size = sizeof(AudioEmphasisContext),
.priv_class = &aemphasis_class,
}

Definition at line 360 of file af_aemphasis.c.

OFFSET
#define OFFSET(x)
Definition: af_aemphasis.c:48
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_aemphasis.c:84
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:225
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
avfilter_af_aemphasis_inputs
static const AVFilterPad avfilter_af_aemphasis_inputs[]
Definition: af_aemphasis.c:342
NULL
#define NULL
Definition: coverity.c:32
avfilter_af_aemphasis_outputs
static const AVFilterPad avfilter_af_aemphasis_outputs[]
Definition: af_aemphasis.c:352
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_aemphasis.c:120
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:188
AudioEmphasisContext
Definition: af_aemphasis.c:40
FLAGS
#define FLAGS
Definition: af_aemphasis.c:49
mode
mode
Definition: ebur128.h:83
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_aemphasis.c:201
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_aemphasis.c:336
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:232