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

Go to the source code of this file.

Data Structures

struct  AudioNLMSContext
 

Macros

#define OFFSET(x)   offsetof(AudioNLMSContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define AT   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 

Enumerations

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

Functions

 AVFILTER_DEFINE_CLASS (anlms)
 
static int query_formats (AVFilterContext *ctx)
 
static float fir_sample (AudioNLMSContext *s, float sample, float *delay, float *coeffs, float *tmp, int *offset)
 
static float process_sample (AudioNLMSContext *s, float input, float desired, float *delay, float *coeffs, float *tmp, int *offsetp)
 
static int process_channels (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int activate (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption anlms_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter ff_af_anlms
 

Macro Definition Documentation

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

Definition at line 61 of file af_anlms.c.

Definition at line 62 of file af_anlms.c.

Definition at line 63 of file af_anlms.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 
DESIRED_MODE 
OUT_MODE 
NOISE_MODE 
NB_OMODES 
IN_MODE 
OUT_MODE 
ESS_MODE 
NB_MODES 

Definition at line 33 of file af_anlms.c.

Function Documentation

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

Definition at line 80 of file af_anlms.c.

static float fir_sample ( AudioNLMSContext s,
float  sample,
float *  delay,
float *  coeffs,
float *  tmp,
int offset 
)
static

Definition at line 110 of file af_anlms.c.

Referenced by process_sample().

static float process_sample ( AudioNLMSContext s,
float  input,
float  desired,
float *  delay,
float *  coeffs,
float *  tmp,
int offsetp 
)
static

Definition at line 128 of file af_anlms.c.

Referenced by process_channels().

static int process_channels ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 165 of file af_anlms.c.

Referenced by activate().

static int activate ( AVFilterContext ctx)
static

Definition at line 188 of file af_anlms.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 253 of file af_anlms.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 274 of file af_anlms.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 285 of file af_anlms.c.

Variable Documentation

const AVOption anlms_options[]
static
Initial value:
= {
{ "order", "set the filter order", OFFSET(order), AV_OPT_TYPE_INT, {.i64=256}, 1, INT16_MAX, A },
{ "mu", "set the filter mu", OFFSET(mu), AV_OPT_TYPE_FLOAT, {.dbl=0.75}, 0, 2, AT },
{ "eps", "set the filter eps", OFFSET(eps), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 1, AT },
{ "leakage", "set the filter leakage", OFFSET(leakage), AV_OPT_TYPE_FLOAT, {.dbl=0}, 0, 1, AT },
{ "out_mode", "set output mode", OFFSET(output_mode), AV_OPT_TYPE_INT, {.i64=OUT_MODE}, 0, NB_OMODES-1, AT, "mode" },
{ "i", "input", 0, AV_OPT_TYPE_CONST, {.i64=IN_MODE}, 0, 0, AT, "mode" },
{ "d", "desired", 0, AV_OPT_TYPE_CONST, {.i64=DESIRED_MODE}, 0, 0, AT, "mode" },
{ "o", "output", 0, AV_OPT_TYPE_CONST, {.i64=OUT_MODE}, 0, 0, AT, "mode" },
{ "n", "noise", 0, AV_OPT_TYPE_CONST, {.i64=NOISE_MODE}, 0, 0, AT, "mode" },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define AT
Definition: af_anlms.c:63
#define A
Definition: af_anlms.c:62
#define OFFSET(x)
Definition: af_anlms.c:61

Definition at line 65 of file af_anlms.c.

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

Definition at line 296 of file af_anlms.c.

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

Definition at line 308 of file af_anlms.c.

AVFilter ff_af_anlms
Initial value:
= {
.name = "anlms",
.description = NULL_IF_CONFIG_SMALL("Apply Normalized Least-Mean-Squares algorithm to first audio stream."),
.priv_size = sizeof(AudioNLMSContext),
.priv_class = &anlms_class,
.init = init,
}
static int query_formats(AVFilterContext *ctx)
Definition: af_anlms.c:80
static const AVFilterPad inputs[]
Definition: af_anlms.c:296
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_anlms.c:285
static int activate(AVFilterContext *ctx)
Definition: af_anlms.c:188
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
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:869
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
static av_cold int init(AVFilterContext *ctx)
Definition: af_anlms.c:274
static const AVFilterPad outputs[]
Definition: af_anlms.c:308
#define flags(name, subs,...)
Definition: cbs_av1.c:564
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_afftdn.c:1374

Definition at line 317 of file af_anlms.c.