FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
af_adenorm.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "filters.h"

Go to the source code of this file.

Data Structures

struct  ADenormContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

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

Enumerations

enum  FilterType {
  DC_TYPE, AC_TYPE, SQ_TYPE, PS_TYPE,
  NB_TYPES, BUTTERWORTH, CHEBYSHEV1, CHEBYSHEV2,
  NB_TYPES, biquad, equalizer, bass,
  treble, bandpass, bandreject, allpass,
  highpass, lowpass, lowshelf, highshelf,
  tiltshelf, WEAK, STRONG, NB_FILTER,
  LOWPASS, FLAT, AFLAT, CHROMA,
  COLOR, ACOLOR, XFLAT, YFLAT,
  NB_FILTERS
}
 

Functions

static void dc_denorm_fltp (AVFilterContext *ctx, void *dstp, const void *srcp, int nb_samples)
 
static void dc_denorm_dblp (AVFilterContext *ctx, void *dstp, const void *srcp, int nb_samples)
 
static void ac_denorm_fltp (AVFilterContext *ctx, void *dstp, const void *srcp, int nb_samples)
 
static void ac_denorm_dblp (AVFilterContext *ctx, void *dstp, const void *srcp, int nb_samples)
 
static void sq_denorm_fltp (AVFilterContext *ctx, void *dstp, const void *srcp, int nb_samples)
 
static void sq_denorm_dblp (AVFilterContext *ctx, void *dstp, const void *srcp, int nb_samples)
 
static void ps_denorm_fltp (AVFilterContext *ctx, void *dstp, const void *srcp, int nb_samples)
 
static void ps_denorm_dblp (AVFilterContext *ctx, void *dstp, const void *srcp, int nb_samples)
 
static int config_output (AVFilterLink *outlink)
 
static int filter_channels (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
 AVFILTER_DEFINE_CLASS (adenorm)
 

Variables

static const AVFilterPad adenorm_inputs []
 
static const AVFilterPad adenorm_outputs []
 
static const AVOption adenorm_options []
 
const AVFilter ff_af_adenorm
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 250 of file af_adenorm.c.

◆ FLAGS

Definition at line 251 of file af_adenorm.c.

Enumeration Type Documentation

◆ FilterType

enum FilterType
Enumerator
DC_TYPE 
AC_TYPE 
SQ_TYPE 
PS_TYPE 
NB_TYPES 
BUTTERWORTH 
CHEBYSHEV1 
CHEBYSHEV2 
NB_TYPES 
biquad 
equalizer 
bass 
treble 
bandpass 
bandreject 
allpass 
highpass 
lowpass 
lowshelf 
highshelf 
tiltshelf 
WEAK 
STRONG 
NB_FILTER 
LOWPASS 
FLAT 
AFLAT 
CHROMA 
COLOR 
ACOLOR 
XFLAT 
YFLAT 
NB_FILTERS 

Definition at line 26 of file af_adenorm.c.

Function Documentation

◆ dc_denorm_fltp()

static void dc_denorm_fltp ( AVFilterContext ctx,
void *  dstp,
const void *  srcp,
int  nb_samples 
)
static

Definition at line 46 of file af_adenorm.c.

Referenced by config_output().

◆ dc_denorm_dblp()

static void dc_denorm_dblp ( AVFilterContext ctx,
void *  dstp,
const void *  srcp,
int  nb_samples 
)
static

Definition at line 59 of file af_adenorm.c.

Referenced by config_output().

◆ ac_denorm_fltp()

static void ac_denorm_fltp ( AVFilterContext ctx,
void *  dstp,
const void *  srcp,
int  nb_samples 
)
static

Definition at line 72 of file af_adenorm.c.

Referenced by config_output().

◆ ac_denorm_dblp()

static void ac_denorm_dblp ( AVFilterContext ctx,
void *  dstp,
const void *  srcp,
int  nb_samples 
)
static

Definition at line 86 of file af_adenorm.c.

Referenced by config_output().

◆ sq_denorm_fltp()

static void sq_denorm_fltp ( AVFilterContext ctx,
void *  dstp,
const void *  srcp,
int  nb_samples 
)
static

Definition at line 100 of file af_adenorm.c.

Referenced by config_output().

◆ sq_denorm_dblp()

static void sq_denorm_dblp ( AVFilterContext ctx,
void *  dstp,
const void *  srcp,
int  nb_samples 
)
static

Definition at line 114 of file af_adenorm.c.

Referenced by config_output().

◆ ps_denorm_fltp()

static void ps_denorm_fltp ( AVFilterContext ctx,
void *  dstp,
const void *  srcp,
int  nb_samples 
)
static

Definition at line 128 of file af_adenorm.c.

Referenced by config_output().

◆ ps_denorm_dblp()

static void ps_denorm_dblp ( AVFilterContext ctx,
void *  dstp,
const void *  srcp,
int  nb_samples 
)
static

Definition at line 142 of file af_adenorm.c.

Referenced by config_output().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 156 of file af_adenorm.c.

◆ filter_channels()

static int filter_channels ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 185 of file af_adenorm.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 203 of file af_adenorm.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( adenorm  )

Variable Documentation

◆ adenorm_inputs

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

Definition at line 234 of file af_adenorm.c.

◆ adenorm_outputs

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

Definition at line 242 of file af_adenorm.c.

◆ adenorm_options

const AVOption adenorm_options[]
static
Initial value:
= {
{ "level", "set level", OFFSET(level_db), AV_OPT_TYPE_DOUBLE, {.dbl=-351}, -451, -90, FLAGS },
{ "type", "set type", OFFSET(type), AV_OPT_TYPE_INT, {.i64=DC_TYPE}, 0, NB_TYPES-1, FLAGS, .unit = "type" },
{ "dc", NULL, 0, AV_OPT_TYPE_CONST, {.i64=DC_TYPE}, 0, 0, FLAGS, .unit = "type"},
{ "ac", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AC_TYPE}, 0, 0, FLAGS, .unit = "type"},
{ "square",NULL, 0, AV_OPT_TYPE_CONST, {.i64=SQ_TYPE}, 0, 0, FLAGS, .unit = "type"},
{ "pulse", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PS_TYPE}, 0, 0, FLAGS, .unit = "type"},
{ NULL }
}

Definition at line 253 of file af_adenorm.c.

◆ ff_af_adenorm

const AVFilter ff_af_adenorm
Initial value:
= {
.name = "adenorm",
.description = NULL_IF_CONFIG_SMALL("Remedy denormals by adding extremely low-level noise."),
.priv_size = sizeof(ADenormContext),
.priv_class = &adenorm_class,
.process_command = ff_filter_process_command,
}

Definition at line 265 of file af_adenorm.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
PS_TYPE
@ PS_TYPE
Definition: af_adenorm.c:30
adenorm_outputs
static const AVFilterPad adenorm_outputs[]
Definition: af_adenorm.c:242
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
NB_TYPES
@ NB_TYPES
Definition: af_adenorm.c:31
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
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_adenorm.c:156
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_adenorm.c:203
OFFSET
#define OFFSET(x)
Definition: af_adenorm.c:250
FILTER_SAMPLEFMTS
#define FILTER_SAMPLEFMTS(...)
Definition: filters.h:250
FLAGS
#define FLAGS
Definition: af_adenorm.c:251
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
DC_TYPE
@ DC_TYPE
Definition: af_adenorm.c:27
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
NULL
#define NULL
Definition: coverity.c:32
adenorm_inputs
static const AVFilterPad adenorm_inputs[]
Definition: af_adenorm.c:234
ADenormContext
Definition: af_adenorm.c:34
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
ff_filter_process_command
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Definition: avfilter.c:901
AC_TYPE
@ AC_TYPE
Definition: af_adenorm.c:28
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#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:182
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AV_SAMPLE_FMT_DBLP
@ AV_SAMPLE_FMT_DBLP
double, planar
Definition: samplefmt.h:67
SQ_TYPE
@ SQ_TYPE
Definition: af_adenorm.c:29
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:152
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299