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

Go to the source code of this file.

Data Structures

struct  AudioRLSContext
 

Macros

#define OFFSET(x)   offsetof(AudioRLSContext, 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,
  ERROR_MODE, NB_OMODES, IN_MODE, DESIRED_MODE,
  OUT_MODE, NOISE_MODE, ERROR_MODE, NB_OMODES,
  IN_MODE, OUT_MODE, ESS_MODE, NB_MODES
}
 

Functions

 AVFILTER_DEFINE_CLASS (arls)
 
static float fir_sample (AudioRLSContext *s, float sample, float *delay, float *coeffs, float *tmp, int *offset)
 
static float process_sample (AudioRLSContext *s, float input, float desired, int ch)
 
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 arls_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
const AVFilter ff_af_arls
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 60 of file af_arls.c.

◆ A

Definition at line 61 of file af_arls.c.

◆ AT

Definition at line 62 of file af_arls.c.

Enumeration Type Documentation

◆ OutModes

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 
ERROR_MODE 
NB_OMODES 
IN_MODE 
DESIRED_MODE 
OUT_MODE 
NOISE_MODE 
ERROR_MODE 
NB_OMODES 
IN_MODE 
OUT_MODE 
ESS_MODE 
NB_MODES 

Definition at line 30 of file af_arls.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( arls  )

◆ fir_sample()

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

Definition at line 79 of file af_arls.c.

Referenced by process_sample().

◆ process_sample()

static float process_sample ( AudioRLSContext s,
float  input,
float  desired,
int  ch 
)
static

Definition at line 97 of file af_arls.c.

Referenced by process_channels().

◆ process_channels()

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

Definition at line 165 of file af_arls.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 187 of file af_arls.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 252 of file af_arls.c.

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 296 of file af_arls.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 307 of file af_arls.c.

Variable Documentation

◆ arls_options

const AVOption arls_options[]
static
Initial value:
= {
{ "order", "set the filter order", OFFSET(order), AV_OPT_TYPE_INT, {.i64=16}, 1, INT16_MAX, A },
{ "lambda", "set the filter lambda", OFFSET(lambda), AV_OPT_TYPE_FLOAT, {.dbl=1.f}, 0, 1, AT },
{ "delta", "set the filter delta", OFFSET(delta), AV_OPT_TYPE_FLOAT, {.dbl=2.f}, 0, INT16_MAX, A },
{ "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" },
{ "e", "error", 0, AV_OPT_TYPE_CONST, {.i64=ERROR_MODE}, 0, 0, AT, "mode" },
{ NULL }
}

Definition at line 64 of file af_arls.c.

◆ inputs

const AVFilterPad inputs[]
static
Initial value:
= {
{
.name = "input",
},
{
.name = "desired",
},
}

Definition at line 322 of file af_arls.c.

◆ outputs

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

Definition at line 333 of file af_arls.c.

◆ ff_af_arls

const AVFilter ff_af_arls
Initial value:
= {
.name = "arls",
.description = NULL_IF_CONFIG_SMALL("Apply Recursive Least Squares algorithm to first audio stream."),
.priv_size = sizeof(AudioRLSContext),
.priv_class = &arls_class,
.init = init,
.process_command = ff_filter_process_command,
}

Definition at line 341 of file af_arls.c.

IN_MODE
@ IN_MODE
Definition: af_arls.c:31
AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
outputs
static const AVFilterPad outputs[]
Definition: af_arls.c:333
FILTER_SINGLE_SAMPLEFMT
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
Definition: internal.h:185
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_arls.c:252
AT
#define AT
Definition: af_arls.c:62
inputs
static const AVFilterPad inputs[]
Definition: af_arls.c:322
init
static av_cold int init(AVFilterContext *ctx)
Definition: af_arls.c:296
DESIRED_MODE
@ DESIRED_MODE
Definition: af_arls.c:32
NB_OMODES
@ NB_OMODES
Definition: af_arls.c:36
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
NOISE_MODE
@ NOISE_MODE
Definition: af_arls.c:34
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:192
NULL
#define NULL
Definition: coverity.c:32
OFFSET
#define OFFSET(x)
Definition: af_arls.c:60
OUT_MODE
@ OUT_MODE
Definition: af_arls.c:33
ERROR_MODE
@ ERROR_MODE
Definition: af_arls.c:35
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:106
ff_filter_process_command
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:851
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:228
delta
float delta
Definition: vorbis_enc_data.h:430
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_arls.c:307
A
#define A
Definition: af_arls.c:61
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
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:117
activate
static int activate(AVFilterContext *ctx)
Definition: af_arls.c:187
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:193
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:155
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234
AudioRLSContext
Definition: af_arls.c:39