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 query_formats (AVFilterContext *ctx)
 
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 []
 
AVFilter ff_af_aderivative
 
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 65 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 90 of file af_aderivative.c.

Function Documentation

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 30 of file af_aderivative.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 113 of file af_aderivative.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 136 of file af_aderivative.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 164 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,
},
{ NULL }
}

Definition at line 171 of file af_aderivative.c.

◆ aderivative_outputs

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

Definition at line 181 of file af_aderivative.c.

◆ ff_af_aderivative

AVFilter ff_af_aderivative
Initial value:
= {
.name = "aderivative",
.description = NULL_IF_CONFIG_SMALL("Compute derivative of input audio."),
.query_formats = query_formats,
.priv_size = sizeof(ADerivativeContext),
}

Definition at line 189 of file af_aderivative.c.

◆ ff_af_aintegral

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

Definition at line 199 of file af_aderivative.c.

n
int n
Definition: avisynth_c.h:760
name
const char * name
Definition: avisynth_c.h:867
channels
channels
Definition: aptx.c:30
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
src
#define src
Definition: vp8dsp.c:254
aderivative_inputs
static const AVFilterPad aderivative_inputs[]
Definition: af_aderivative.c:171
s
#define s(width, name)
Definition: cbs_vp9.c:257
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_aderivative.c:136
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_aderivative.c:113
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
NULL
#define NULL
Definition: coverity.c:32
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
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:188
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_aderivative.c:30
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_aderivative.c:164
aderivative_outputs
static const AVFilterPad aderivative_outputs[]
Definition: af_aderivative.c:181
ADerivativeContext
Definition: af_aderivative.c:23