FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
af_anlmdn.c File Reference
#include <float.h>
#include "libavutil/avassert.h"
#include "libavutil/audio_fifo.h"
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "audio.h"
#include "formats.h"
#include "af_anlmdndsp.h"

Go to the source code of this file.

Data Structures

struct  AudioNLMeansContext
 

Macros

#define WEIGHT_LUT_NBITS   20
 
#define WEIGHT_LUT_SIZE   (1<<WEIGHT_LUT_NBITS)
 
#define SQR(x)   ((x) * (x))
 
#define OFFSET(x)   offsetof(AudioNLMeansContext, x)
 
#define AF   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Enumerations

enum  OutModes {
  IN_MODE, OUT_MODE, NOISE_MODE, NB_MODES,
  IN_MODE, OUT_MODE, NOISE_MODE, NB_MODES,
  IN_MODE, OUT_MODE, ESS_MODE, NB_MODES
}
 

Functions

 AVFILTER_DEFINE_CLASS (anlmdn)
 
static int query_formats (AVFilterContext *ctx)
 
static float compute_distance_ssd_c (const float *f1, const float *f2, ptrdiff_t K)
 
static void compute_cache_c (float *cache, const float *f, ptrdiff_t S, ptrdiff_t K, ptrdiff_t i, ptrdiff_t jj)
 
void ff_anlmdn_init (AudioNLMDNDSPContext *dsp)
 
static int config_output (AVFilterLink *outlink)
 
static int filter_channel (AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int request_frame (AVFilterLink *outlink)
 
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 anlmdn_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter ff_af_anlmdn
 

Macro Definition Documentation

#define WEIGHT_LUT_NBITS   20

Definition at line 33 of file af_anlmdn.c.

#define WEIGHT_LUT_SIZE   (1<<WEIGHT_LUT_NBITS)

Definition at line 34 of file af_anlmdn.c.

Referenced by config_output(), and filter_channel().

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

Definition at line 36 of file af_anlmdn.c.

Referenced by compute_cache_c(), and compute_distance_ssd_c().

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

Definition at line 74 of file af_anlmdn.c.

Definition at line 75 of file af_anlmdn.c.

Enumeration Type Documentation

enum OutModes
Enumerator
IN_MODE 
OUT_MODE 
NOISE_MODE 
NB_MODES 
IN_MODE 
OUT_MODE 
NOISE_MODE 
NB_MODES 
IN_MODE 
OUT_MODE 
ESS_MODE 
NB_MODES 

Definition at line 67 of file af_anlmdn.c.

Function Documentation

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

Definition at line 91 of file af_anlmdn.c.

static float compute_distance_ssd_c ( const float *  f1,
const float *  f2,
ptrdiff_t  K 
)
static

Definition at line 120 of file af_anlmdn.c.

Referenced by ff_anlmdn_init().

static void compute_cache_c ( float *  cache,
const float *  f,
ptrdiff_t  S,
ptrdiff_t  K,
ptrdiff_t  i,
ptrdiff_t  jj 
)
static

Definition at line 130 of file af_anlmdn.c.

Referenced by ff_anlmdn_init().

void ff_anlmdn_init ( AudioNLMDNDSPContext dsp)

Definition at line 140 of file af_anlmdn.c.

Referenced by config_output().

static int config_output ( AVFilterLink outlink)
static

Definition at line 149 of file af_anlmdn.c.

static int filter_channel ( AVFilterContext ctx,
void arg,
int  ch,
int  nb_jobs 
)
static

Definition at line 195 of file af_anlmdn.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 255 of file af_anlmdn.c.

Referenced by request_frame().

static int request_frame ( AVFilterLink outlink)
static

Definition at line 308 of file af_anlmdn.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 333 of file af_anlmdn.c.

static int process_command ( AVFilterContext ctx,
const char *  cmd,
const char *  args,
char *  res,
int  res_len,
int  flags 
)
static

Definition at line 342 of file af_anlmdn.c.

Variable Documentation

const AVOption anlmdn_options[]
static
Initial value:
= {
{ "s", "set denoising strength", OFFSET(a), AV_OPT_TYPE_FLOAT, {.dbl=0.00001},0.00001, 10, AF },
{ "p", "set patch duration", OFFSET(pd), AV_OPT_TYPE_DURATION, {.i64=2000}, 1000, 100000, AF },
{ "r", "set research duration", OFFSET(rd), AV_OPT_TYPE_DURATION, {.i64=6000}, 2000, 300000, AF },
{ "o", "set output mode", OFFSET(om), AV_OPT_TYPE_INT, {.i64=OUT_MODE}, 0, NB_MODES-1, AF, "mode" },
{ "i", "input", 0, AV_OPT_TYPE_CONST, {.i64=IN_MODE}, 0, 0, AF, "mode" },
{ "o", "output", 0, AV_OPT_TYPE_CONST, {.i64=OUT_MODE}, 0, 0, AF, "mode" },
{ "n", "noise", 0, AV_OPT_TYPE_CONST, {.i64=NOISE_MODE},0, 0, AF, "mode" },
{ "m", "set smooth factor", OFFSET(m), AV_OPT_TYPE_FLOAT, {.dbl=11.}, 1, 15, AF },
{ NULL }
}
#define NULL
Definition: coverity.c:32
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:36
#define AF
Definition: af_anlmdn.c:75
#define OFFSET(x)
Definition: af_anlmdn.c:74

Definition at line 77 of file af_anlmdn.c.

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

Definition at line 365 of file af_anlmdn.c.

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
.request_frame = request_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_output(AVFilterLink *outlink)
Definition: af_anlmdn.c:149
static int request_frame(AVFilterLink *outlink)
Definition: af_anlmdn.c:308

Definition at line 374 of file af_anlmdn.c.

AVFilter ff_af_anlmdn
Initial value:
= {
.name = "anlmdn",
.description = NULL_IF_CONFIG_SMALL("Reduce broadband noise from stream using Non-Local Means."),
.query_formats = query_formats,
.priv_size = sizeof(AudioNLMeansContext),
.priv_class = &anlmdn_class,
}
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_anlmdn.c:342
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
static const AVFilterPad outputs[]
Definition: af_anlmdn.c:374
static int query_formats(AVFilterContext *ctx)
Definition: af_anlmdn.c:91
static const AVFilterPad inputs[]
Definition: af_anlmdn.c:365
#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:133
#define flags(name, subs,...)
Definition: cbs_av1.c:561
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_anlmdn.c:333

Definition at line 384 of file af_anlmdn.c.