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 "internal.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,
  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)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 
 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 275 of file af_adenorm.c.

◆ FLAGS

Definition at line 276 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 
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.

Referenced by process_command().

◆ filter_channels()

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

Definition at line 197 of file af_adenorm.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 215 of file af_adenorm.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 246 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 259 of file af_adenorm.c.

◆ adenorm_outputs

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

Definition at line 267 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, "type" },
{ "dc", NULL, 0, AV_OPT_TYPE_CONST, {.i64=DC_TYPE}, 0, 0, FLAGS, "type"},
{ "ac", NULL, 0, AV_OPT_TYPE_CONST, {.i64=AC_TYPE}, 0, 0, FLAGS, "type"},
{ "square",NULL, 0, AV_OPT_TYPE_CONST, {.i64=SQ_TYPE}, 0, 0, FLAGS, "type"},
{ "pulse", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PS_TYPE}, 0, 0, FLAGS, "type"},
{ NULL }
}

Definition at line 278 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 = process_command,
}

Definition at line 290 of file af_adenorm.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:69
PS_TYPE
@ PS_TYPE
Definition: af_adenorm.c:30
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_adenorm.c:246
adenorm_outputs
static const AVFilterPad adenorm_outputs[]
Definition: af_adenorm.c:267
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:215
OFFSET
#define OFFSET(x)
Definition: af_adenorm.c:275
FLAGS
#define FLAGS
Definition: af_adenorm.c:276
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:226
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
DC_TYPE
@ DC_TYPE
Definition: af_adenorm.c:27
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:191
NULL
#define NULL
Definition: coverity.c:32
adenorm_inputs
static const AVFilterPad adenorm_inputs[]
Definition: af_adenorm.c:259
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:117
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:146
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
AV_SAMPLE_FMT_DBLP
@ AV_SAMPLE_FMT_DBLP
double, planar
Definition: samplefmt.h:70
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:121
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:192
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:233
FILTER_SAMPLEFMTS
#define FILTER_SAMPLEFMTS(...)
Definition: internal.h:179