FFmpeg  4.3
Data Structures | Macros | Functions | Variables
af_adeclick.c File Reference
#include "libavutil/audio_fifo.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "audio.h"
#include "filters.h"
#include "formats.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  DeclickChannel
 
struct  AudioDeclickContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define OFFSET(x)   offsetof(AudioDeclickContext, x)
 
#define AF   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (adeclick)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static void autocorrelation (const double *input, int order, int size, double *output, double scale)
 
static double autoregression (const double *samples, int ar_order, int nb_samples, double *k, double *r, double *a)
 
static int isfinite_array (double *samples, int nb_samples)
 
static int find_index (int *index, int value, int size)
 
static int factorization (double *matrix, int n)
 
static int do_interpolation (DeclickChannel *c, double *matrix, double *vector, int n, double *out)
 
static int interpolation (DeclickChannel *c, const double *src, int ar_order, double *acoefficients, int *index, int nb_errors, double *auxiliary, double *interpolated)
 
static int detect_clips (AudioDeclickContext *s, DeclickChannel *c, double unused0, double *unused1, double *unused2, uint8_t *clip, int *index, const double *src, double *dst)
 
static int detect_clicks (AudioDeclickContext *s, DeclickChannel *c, double sigmae, double *detection, double *acoefficients, uint8_t *click, int *index, const double *src, double *dst)
 
static int filter_channel (AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
 
static int filter_frame (AVFilterLink *inlink)
 
static int activate (AVFilterContext *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (adeclip)
 

Variables

static const AVOption adeclick_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter ff_af_adeclick
 
static const AVOption adeclip_options []
 
AVFilter ff_af_adeclip
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 91 of file af_adeclick.c.

◆ AF

Definition at line 92 of file af_adeclick.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS() [1/2]

AVFILTER_DEFINE_CLASS ( adeclick  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 108 of file af_adeclick.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 137 of file af_adeclick.c.

◆ autocorrelation()

static void autocorrelation ( const double *  input,
int  order,
int  size,
double *  output,
double  scale 
)
static

Definition at line 208 of file af_adeclick.c.

Referenced by autoregression(), and interpolation().

◆ autoregression()

static double autoregression ( const double *  samples,
int  ar_order,
int  nb_samples,
double *  k,
double *  r,
double *  a 
)
static

Definition at line 223 of file af_adeclick.c.

Referenced by filter_channel().

◆ isfinite_array()

static int isfinite_array ( double *  samples,
int  nb_samples 
)
static

Definition at line 258 of file af_adeclick.c.

Referenced by filter_channel().

◆ find_index()

static int find_index ( int index,
int  value,
int  size 
)
static

Definition at line 269 of file af_adeclick.c.

Referenced by interpolation().

◆ factorization()

static int factorization ( double *  matrix,
int  n 
)
static

Definition at line 292 of file af_adeclick.c.

Referenced by do_interpolation().

◆ do_interpolation()

static int do_interpolation ( DeclickChannel c,
double *  matrix,
double *  vector,
int  n,
double *  out 
)
static

Definition at line 323 of file af_adeclick.c.

Referenced by interpolation().

◆ interpolation()

static int interpolation ( DeclickChannel c,
const double *  src,
int  ar_order,
double *  acoefficients,
int index,
int  nb_errors,
double *  auxiliary,
double *  interpolated 
)
static

Definition at line 357 of file af_adeclick.c.

Referenced by filter_channel().

◆ detect_clips()

static int detect_clips ( AudioDeclickContext s,
DeclickChannel c,
double  unused0,
double *  unused1,
double *  unused2,
uint8_t clip,
int index,
const double *  src,
double *  dst 
)
static

Definition at line 401 of file af_adeclick.c.

Referenced by init().

◆ detect_clicks()

static int detect_clicks ( AudioDeclickContext s,
DeclickChannel c,
double  sigmae,
double *  detection,
double *  acoefficients,
uint8_t click,
int index,
const double *  src,
double *  dst 
)
static

Definition at line 451 of file af_adeclick.c.

Referenced by init().

◆ filter_channel()

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

Definition at line 497 of file af_adeclick.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink)
static

Definition at line 562 of file af_adeclick.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 622 of file af_adeclick.c.

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 682 of file af_adeclick.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 696 of file af_adeclick.c.

◆ AVFILTER_DEFINE_CLASS() [2/2]

AVFILTER_DEFINE_CLASS ( adeclip  )

Variable Documentation

◆ adeclick_options

const AVOption adeclick_options[]
static
Initial value:
= {
{ "w", "set window size", OFFSET(w), AV_OPT_TYPE_DOUBLE, {.dbl=55}, 10, 100, AF },
{ "o", "set window overlap", OFFSET(overlap), AV_OPT_TYPE_DOUBLE, {.dbl=75}, 50, 95, AF },
{ "a", "set autoregression order", OFFSET(ar), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 0, 25, AF },
{ "t", "set threshold", OFFSET(threshold), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 1, 100, AF },
{ "b", "set burst fusion", OFFSET(burst), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 0, 10, AF },
{ "m", "set overlap method", OFFSET(method), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, AF, "m" },
{ "a", "overlap-add", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, AF, "m" },
{ "s", "overlap-save", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, AF, "m" },
{ NULL }
}

Definition at line 94 of file af_adeclick.c.

◆ inputs

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

Definition at line 740 of file af_adeclick.c.

◆ outputs

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

Definition at line 749 of file af_adeclick.c.

◆ ff_af_adeclick

AVFilter ff_af_adeclick
Initial value:
= {
.name = "adeclick",
.description = NULL_IF_CONFIG_SMALL("Remove impulsive noise from input audio."),
.query_formats = query_formats,
.priv_size = sizeof(AudioDeclickContext),
.priv_class = &adeclick_class,
.init = init,
}

Definition at line 757 of file af_adeclick.c.

◆ adeclip_options

const AVOption adeclip_options[]
static
Initial value:
= {
{ "w", "set window size", OFFSET(w), AV_OPT_TYPE_DOUBLE, {.dbl=55}, 10, 100, AF },
{ "o", "set window overlap", OFFSET(overlap), AV_OPT_TYPE_DOUBLE, {.dbl=75}, 50, 95, AF },
{ "a", "set autoregression order", OFFSET(ar), AV_OPT_TYPE_DOUBLE, {.dbl=8}, 0, 25, AF },
{ "t", "set threshold", OFFSET(threshold), AV_OPT_TYPE_DOUBLE, {.dbl=10}, 1, 100, AF },
{ "n", "set histogram size", OFFSET(nb_hbins), AV_OPT_TYPE_INT, {.i64=1000}, 100, 9999, AF },
{ "m", "set overlap method", OFFSET(method), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, AF, "m" },
{ "a", "overlap-add", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, AF, "m" },
{ "s", "overlap-save", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, AF, "m" },
{ NULL }
}

Definition at line 771 of file af_adeclick.c.

◆ ff_af_adeclip

AVFilter ff_af_adeclip
Initial value:
= {
.name = "adeclip",
.description = NULL_IF_CONFIG_SMALL("Remove clipping from input audio."),
.query_formats = query_formats,
.priv_size = sizeof(AudioDeclickContext),
.priv_class = &adeclip_class,
.init = init,
}

Definition at line 785 of file af_adeclick.c.

query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_adeclick.c:108
outputs
static const AVFilterPad outputs[]
Definition: af_adeclick.c:749
init
static av_cold int init(AVFilterContext *ctx)
Definition: af_adeclick.c:682
activate
static int activate(AVFilterContext *ctx)
Definition: af_adeclick.c:622
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:225
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_adeclick.c:696
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_adeclick.c:137
AudioDeclickContext
Definition: af_adeclick.c:48
NULL
#define NULL
Definition: coverity.c:32
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:186
OFFSET
#define OFFSET(x)
Definition: af_adeclick.c:91
AF
#define AF
Definition: af_adeclick.c:92
w
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo ug o o w
Definition: fate.txt:150
inputs
static const AVFilterPad inputs[]
Definition: af_adeclick.c:740
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
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:116
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:133
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:564
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:232