31#define DERIVATIVE(name, type) \
32static void aderivative_## name ##p(void **d, void **p, const void **s, \
33 int nb_samples, int channels) \
37 for (c = 0; c < channels; c++) { \
38 const type *src = s[c]; \
42 for (n = 0; n < nb_samples; n++) { \
43 const type current = src[n]; \
45 dst[n] = current - prv[0]; \
56#define INTEGRAL(name, type) \
57static void aintegral_## name ##p(void **d, void **p, const void **s, \
58 int nb_samples, int channels) \
62 for (c = 0; c < channels; c++) { \
63 const type *src = s[c]; \
67 for (n = 0; n < nb_samples; n++) { \
68 const type current = src[n]; \
70 dst[n] = current + prv[0]; \
84 switch (inlink->format) {
85 case AV_SAMPLE_FMT_FLTP: s->filter = aderivative_fltp; break;
86 case AV_SAMPLE_FMT_DBLP: s->filter = aderivative_dblp; break;
87 case AV_SAMPLE_FMT_S32P: s->filter = aderivative_s32p; break;
88 case AV_SAMPLE_FMT_S16P: s->filter = aderivative_s16p; break;
91 if (strcmp(
ctx->filter->name,
"aintegral"))
94 switch (inlink->format) {
95 case AV_SAMPLE_FMT_FLTP: s->filter = aintegral_fltp; break;
96 case AV_SAMPLE_FMT_DBLP: s->filter = aintegral_dblp; break;
109 if (
ctx->is_disabled) {
112 s->prev->ch_layout.nb_channels,
134 s->filter((
void **)
out->extended_data, (
void **)
s->prev->extended_data, (
const void **)in->
extended_data,
164 .p.name =
"aderivative",
166 .p.priv_class = &aderivative_class,
177 .p.name =
"aintegral",
179 .p.priv_class = &aderivative_class,
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static int config_input(AVFilterLink *inlink)
const FFFilter ff_af_aintegral
#define DERIVATIVE(name, type)
static const AVFilterPad aderivative_inputs[]
const FFFilter ff_af_aderivative
#define INTEGRAL(name, type)
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static av_cold void uninit(AVFilterContext *ctx)
static const AVOption aderivative_options[]
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Main libavfilter public API header.
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
@ AV_SAMPLE_FMT_FLTP
float, planar
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
@ AV_SAMPLE_FMT_DBLP
double, planar
int av_samples_set_silence(uint8_t *const *audio_data, int offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt)
Fill an audio buffer with silence.
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
#define FILTER_SAMPLEFMTS(...)
#define AVFILTER_DEFINE_CLASS_EXT(name, desc, options)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
void(* filter)(void **dst, void **prv, const void **src, int nb_samples, int channels)
int nb_channels
Number of channels in this layout.
Describe the class of an AVClass context structure.
A link between two filters.
AVFilterContext * dst
dest filter
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
int nb_samples
number of audio samples (per channel) described by this frame
AVChannelLayout ch_layout
Channel layout of the audio data.
uint8_t ** extended_data
pointers to the data planes/channels.
static AVFormatContext * ctx