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

Go to the source code of this file.

Data Structures

struct  ASoftClipContext
 

Macros

#define OFFSET(x)   offsetof(ASoftClipContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define SQR(x)   ((x) * (x))
 

Enumerations

enum  ASoftClipTypes {
  ASC_TANH, ASC_ATAN, ASC_CUBIC, ASC_EXP,
  ASC_ALG, ASC_QUINTIC, ASC_SIN, NB_TYPES
}
 

Functions

 AVFILTER_DEFINE_CLASS (asoftclip)
 
static int query_formats (AVFilterContext *ctx)
 
static void filter_flt (ASoftClipContext *s, void **dptr, const void **sptr, int nb_samples, int channels)
 
static void filter_dbl (ASoftClipContext *s, void **dptr, const void **sptr, int nb_samples, int channels)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 

Variables

static const AVOption asoftclip_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter ff_af_asoftclip
 

Macro Definition Documentation

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

Definition at line 48 of file af_asoftclip.c.

Definition at line 49 of file af_asoftclip.c.

#define SQR (   x)    ((x) * (x))

Definition at line 96 of file af_asoftclip.c.

Enumeration Type Documentation

Enumerator
ASC_TANH 
ASC_ATAN 
ASC_CUBIC 
ASC_EXP 
ASC_ALG 
ASC_QUINTIC 
ASC_SIN 
NB_TYPES 

Definition at line 27 of file af_asoftclip.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( asoftclip  )
static int query_formats ( AVFilterContext ctx)
static

Definition at line 66 of file af_asoftclip.c.

static void filter_flt ( ASoftClipContext s,
void **  dptr,
const void **  sptr,
int  nb_samples,
int  channels 
)
static

Definition at line 98 of file af_asoftclip.c.

Referenced by config_input().

static void filter_dbl ( ASoftClipContext s,
void **  dptr,
const void **  sptr,
int  nb_samples,
int  channels 
)
static

Definition at line 154 of file af_asoftclip.c.

Referenced by config_input().

static int config_input ( AVFilterLink inlink)
static

Definition at line 210 of file af_asoftclip.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 225 of file af_asoftclip.c.

Variable Documentation

const AVOption asoftclip_options[]
static
Initial value:
= {
{ "type", "set softclip type", OFFSET(type), AV_OPT_TYPE_INT, {.i64=0}, 0, NB_TYPES-1, A, "types" },
{ "tanh", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_TANH}, 0, 0, A, "types" },
{ "atan", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_ATAN}, 0, 0, A, "types" },
{ "cubic", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_CUBIC}, 0, 0, A, "types" },
{ "exp", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_EXP}, 0, 0, A, "types" },
{ "alg", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_ALG}, 0, 0, A, "types" },
{ "quintic", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_QUINTIC},0, 0, A, "types" },
{ "sin", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_SIN}, 0, 0, A, "types" },
{ "param", "set softclip parameter", OFFSET(param), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.01, 3, A },
{ NULL }
}
#define NULL
Definition: coverity.c:32
GLint GLenum type
Definition: opengl_enc.c:104
#define OFFSET(x)
Definition: af_asoftclip.c:48
#define A
Definition: af_asoftclip.c:49

Definition at line 51 of file af_asoftclip.c.

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

Definition at line 261 of file af_asoftclip.c.

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32

Definition at line 271 of file af_asoftclip.c.

AVFilter ff_af_asoftclip
Initial value:
= {
.name = "asoftclip",
.description = NULL_IF_CONFIG_SMALL("Audio Soft Clipper."),
.query_formats = query_formats,
.priv_size = sizeof(ASoftClipContext),
.priv_class = &asoftclip_class,
}
static const AVFilterPad outputs[]
Definition: af_asoftclip.c:271
static int query_formats(AVFilterContext *ctx)
Definition: af_asoftclip.c:66
#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:125
#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_asoftclip.c:261
#define flags(name, subs,...)
Definition: cbs_av1.c:561

Definition at line 279 of file af_asoftclip.c.