FFmpeg
Data Structures | Macros | Functions | Variables
af_crystalizer.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  CrystalizerContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define OFFSET(x)   offsetof(CrystalizerContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
#define filters(fmt, inverse, clip, i, c)
 

Functions

 AVFILTER_DEFINE_CLASS (crystalizer)
 
static av_always_inline int filter_flt (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs, int inverse, int clip)
 
static av_always_inline int filter_dbl (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs, int inverse, int clip)
 
static av_always_inline int filter_fltp (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs, int inverse, int clip)
 
static av_always_inline int filter_dblp (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs, int inverse, int clip)
 
 filters (filters(flt, filters(inverse, filters(noclip, filters(1, filters(0)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 

Variables

static const AVOption crystalizer_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
const AVFilter ff_af_crystalizer
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 35 of file af_crystalizer.c.

◆ A

Definition at line 36 of file af_crystalizer.c.

◆ filters

#define filters (   fmt,
  inverse,
  clip,
  i,
  c 
)
Value:
static int filter_## inverse ##_## fmt ##_## clip(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) \
{ \
return filter_## fmt(ctx, arg, jobnr, nb_jobs, i, c); \
}

Definition at line 221 of file af_crystalizer.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( crystalizer  )

◆ filter_flt()

static av_always_inline int filter_flt ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs,
int  inverse,
int  clip 
)
static

Definition at line 55 of file af_crystalizer.c.

◆ filter_dbl()

static av_always_inline int filter_dbl ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs,
int  inverse,
int  clip 
)
static

Definition at line 98 of file af_crystalizer.c.

◆ filter_fltp()

static av_always_inline int filter_fltp ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs,
int  inverse,
int  clip 
)
static

Definition at line 141 of file af_crystalizer.c.

◆ filter_dblp()

static av_always_inline int filter_dblp ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs,
int  inverse,
int  clip 
)
static

Definition at line 181 of file af_crystalizer.c.

◆ filters()

filters ( filters(  flt,
filters(  inverse,
filters(  noclip,
filters(  1,
filters(  0 
)

Definition at line 227 of file af_crystalizer.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 284 of file af_crystalizer.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 326 of file af_crystalizer.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 333 of file af_crystalizer.c.

Variable Documentation

◆ crystalizer_options

const AVOption crystalizer_options[]
static
Initial value:
= {
{ "i", "set intensity", OFFSET(mult), AV_OPT_TYPE_FLOAT, {.dbl=2.0},-10, 10, A },
{ "c", "enable clipping", OFFSET(clip), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, A },
{ NULL }
}

Definition at line 38 of file af_crystalizer.c.

◆ inputs

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

Definition at line 345 of file af_crystalizer.c.

◆ outputs

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

Definition at line 354 of file af_crystalizer.c.

◆ ff_af_crystalizer

const AVFilter ff_af_crystalizer
Initial value:
= {
.name = "crystalizer",
.description = NULL_IF_CONFIG_SMALL("Simple audio noise sharpening filter."),
.priv_size = sizeof(CrystalizerContext),
.priv_class = &crystalizer_class,
.process_command = process_command,
}

Definition at line 361 of file af_crystalizer.c.

outputs
static const AVFilterPad outputs[]
Definition: af_crystalizer.c:354
AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:69
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_crystalizer.c:326
OFFSET
#define OFFSET(x)
Definition: af_crystalizer.c:35
mult
static int16_t mult(Float11 *f1, Float11 *f2)
Definition: g726.c:56
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
ctx
AVFormatContext * ctx
Definition: movenc.c:48
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:191
arg
const char * arg
Definition: jacosubdec.c:67
NULL
#define NULL
Definition: coverity.c:32
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_crystalizer.c:333
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_acontrast.c:121
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_crystalizer.c:284
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
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:227
inputs
static const AVFilterPad inputs[]
Definition: af_crystalizer.c:345
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:271
CrystalizerContext
Definition: af_crystalizer.c:27
A
#define A
Definition: af_crystalizer.c:36
inverse
static int inverse(AudioFWTDNContext *s, double **in, int *in_length, double *out, int out_length, int ch, uint64_t sn)
Definition: af_afwtdn.c:762
AV_SAMPLE_FMT_DBLP
@ AV_SAMPLE_FMT_DBLP
double, planar
Definition: samplefmt.h:70
AVFilterContext
An instance of a filter.
Definition: avfilter.h:386
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
_
#define _
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:241
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:192
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:138
AV_SAMPLE_FMT_DBL
@ AV_SAMPLE_FMT_DBL
double
Definition: samplefmt.h:64
AV_SAMPLE_FMT_FLT
@ AV_SAMPLE_FMT_FLT
float
Definition: samplefmt.h:63
clip
static double clip(void *opaque, double val)
Clip value val in the minval - maxval range.
Definition: vf_lut.c:159
FILTER_SAMPLEFMTS
#define FILTER_SAMPLEFMTS(...)
Definition: internal.h:179