FFmpeg
Data Structures | Macros | Functions | Variables
af_aderivative.c File Reference
#include "audio.h"
#include "avfilter.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ADerivativeContext
 

Macros

#define DERIVATIVE(name, type)
 
#define INTEGRAL(name, type)
 

Functions

static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVFilterPad aderivative_inputs []
 
static const AVFilterPad aderivative_outputs []
 
const AVFilter ff_af_aderivative
 
const AVFilter ff_af_aintegral
 

Macro Definition Documentation

◆ DERIVATIVE

#define DERIVATIVE (   name,
  type 
)
Value:
static void aderivative_## name ##p(void **d, void **p, const void **s, \
int nb_samples, int channels) \
{ \
int n, c; \
for (c = 0; c < channels; c++) { \
const type *src = s[c]; \
type *dst = d[c]; \
type *prv = p[c]; \
for (n = 0; n < nb_samples; n++) { \
const type current = src[n]; \
\
dst[n] = current - prv[0]; \
prv[0] = current; \
} \
} \
}

Definition at line 30 of file af_aderivative.c.

◆ INTEGRAL

#define INTEGRAL (   name,
  type 
)
Value:
static void aintegral_## name ##p(void **d, void **p, const void **s, \
int nb_samples, int channels) \
{ \
int n, c; \
for (c = 0; c < channels; c++) { \
const type *src = s[c]; \
type *dst = d[c]; \
type *prv = p[c]; \
for (n = 0; n < nb_samples; n++) { \
const type current = src[n]; \
\
dst[n] = current + prv[0]; \
prv[0] = dst[n]; \
} \
} \
}

Definition at line 55 of file af_aderivative.c.

Function Documentation

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 78 of file af_aderivative.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 101 of file af_aderivative.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 129 of file af_aderivative.c.

Variable Documentation

◆ aderivative_inputs

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

Definition at line 136 of file af_aderivative.c.

◆ aderivative_outputs

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

Definition at line 145 of file af_aderivative.c.

◆ ff_af_aderivative

const AVFilter ff_af_aderivative
Initial value:

Definition at line 152 of file af_aderivative.c.

◆ ff_af_aintegral

const AVFilter ff_af_aintegral
Initial value:
= {
.name = "aintegral",
.description = NULL_IF_CONFIG_SMALL("Compute integral of input audio."),
.priv_size = sizeof(ADerivativeContext),
}

Definition at line 163 of file af_aderivative.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:69
name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
AV_SAMPLE_FMT_S32P
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition: samplefmt.h:68
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
aderivative_inputs
static const AVFilterPad aderivative_inputs[]
Definition: af_aderivative.c:136
s
#define s(width, name)
Definition: cbs_vp9.c:257
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_aderivative.c:101
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_aderivative.c:78
channels
channels
Definition: aptx.h:33
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:191
src
#define src
Definition: vp8dsp.c:255
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
for
for(j=16;j >0;--j)
Definition: h264pred_template.c:469
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_SAMPLE_FMT_S16P
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: samplefmt.h:67
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_aderivative.c:129
AV_SAMPLE_FMT_DBLP
@ AV_SAMPLE_FMT_DBLP
double, planar
Definition: samplefmt.h:70
aderivative_outputs
static const AVFilterPad aderivative_outputs[]
Definition: af_aderivative.c:145
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:192
d
d
Definition: ffmpeg_filter.c:153
ADerivativeContext
Definition: af_aderivative.c:23
FILTER_SAMPLEFMTS
#define FILTER_SAMPLEFMTS(...)
Definition: internal.h:179