FFmpeg
Loading...
Searching...
No Matches
af_aderivative.c File Reference
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "filters.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)
 
 AVFILTER_DEFINE_CLASS_EXT (aderivative, "aderivative/aintegral", aderivative_options)
 

Variables

static const AVFilterPad aderivative_inputs []
 
static const AVOption aderivative_options []
 
const FFFilter ff_af_aderivative
 
const FFFilter 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; \
} \
} \
}
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
channels
Definition aptx.h:31
#define s(width, name)
Definition cbs_vp9.c:198
static struct @111144215057303131116103221376075045141373005341 current
cl_device_type type
const char * name
Definition qsvenc.c:142
#define src
Definition vp8dsp.c:248
static double c[64]

Definition at line 31 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 56 of file af_aderivative.c.

Function Documentation

◆ config_input()

static int config_input ( AVFilterLink * inlink)
static

Definition at line 79 of file af_aderivative.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink * inlink,
AVFrame * in )
static

Definition at line 102 of file af_aderivative.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext * ctx)
static

Definition at line 141 of file af_aderivative.c.

◆ AVFILTER_DEFINE_CLASS_EXT()

AVFILTER_DEFINE_CLASS_EXT ( aderivative ,
"aderivative/aintegral" ,
aderivative_options  )

Variable Documentation

◆ aderivative_inputs

const AVFilterPad aderivative_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
},
}
static int config_input(AVFilterLink *inlink)
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
Definition dolby_e.c:1067
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201

Definition at line 148 of file af_aderivative.c.

◆ aderivative_options

const AVOption aderivative_options[]
static
Initial value:
= {
{ NULL }
}
#define NULL
Definition coverity.c:32

Definition at line 157 of file af_aderivative.c.

Referenced by AVFILTER_DEFINE_CLASS_EXT().

◆ ff_af_aderivative

const FFFilter ff_af_aderivative
Initial value:
= {
.p.name = "aderivative",
.p.description = NULL_IF_CONFIG_SMALL("Compute derivative of input audio."),
.p.priv_class = &aderivative_class,
.priv_size = sizeof(ADerivativeContext),
}
static const AVFilterPad aderivative_inputs[]
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
Definition audio.c:34
#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:204
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition samplefmt.h:66
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition samplefmt.h:64
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition samplefmt.h:65
@ AV_SAMPLE_FMT_DBLP
double, planar
Definition samplefmt.h:67
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FILTER_SAMPLEFMTS(...)
Definition filters.h:252
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88

Definition at line 163 of file af_aderivative.c.

◆ ff_af_aintegral

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

Definition at line 176 of file af_aderivative.c.