74#define OFFSET(x) offsetof(AudioAPContext, x)
75#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
76#define AT AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
89 {
"precision",
"set processing precision",
OFFSET(precision),
AV_OPT_TYPE_INT, {.i64=0}, 0, 2,
A, .unit =
"precision" },
90 {
"auto",
"set auto processing precision", 0,
AV_OPT_TYPE_CONST, {.i64=0}, 0, 0,
A, .unit =
"precision" },
91 {
"float",
"set single-floating point processing precision", 0,
AV_OPT_TYPE_CONST, {.i64=1}, 0, 0,
A, .unit =
"precision" },
92 {
"double",
"set double-floating point processing precision", 0,
AV_OPT_TYPE_CONST, {.i64=2}, 0, 0,
A, .unit =
"precision" },
128 for (
i = 0;
i <
ctx->nb_inputs && nb_samples > 0;
i++) {
139 if (
s->frame[0] &&
s->frame[1]) {
152 out->pts =
s->frame[0]->pts;
153 out->duration =
s->frame[0]->duration;
164 for (
i = 0;
i < 2;
i++) {
173 for (
i = 0;
i < 2;
i++) {
226 if (!
s->offset || !
s->delay || !
s->dcoeffs || !
s->coeffs || !
s->tmpmp || !
s->itmpmp ||
227 !
s->e || !
s->p || !
s->x || !
s->w || !
s->tmp || !
s->tmpm || !
s->itmpm)
230 switch (outlink->
format) {
232 for (
int ch = 0; ch <
channels; ch++) {
233 double *itmpm = (
double *)
s->itmpm->extended_data[ch];
234 double *tmpm = (
double *)
s->tmpm->extended_data[ch];
235 double **itmpmp = (
double **)&
s->itmpmp[
s->projection * ch];
236 double **tmpmp = (
double **)&
s->tmpmp[
s->projection * ch];
238 for (
int i = 0;
i <
s->projection;
i++) {
239 itmpmp[
i] = &itmpm[
i *
s->projection];
240 tmpmp[
i] = &tmpm[
i *
s->projection];
244 s->filter_channels = filter_channels_double;
247 for (
int ch = 0; ch <
channels; ch++) {
248 float *itmpm = (
float *)
s->itmpm->extended_data[ch];
249 float *tmpm = (
float *)
s->tmpm->extended_data[ch];
250 float **itmpmp = (
float **)&
s->itmpmp[
s->projection * ch];
251 float **tmpmp = (
float **)&
s->tmpmp[
s->projection * ch];
253 for (
int i = 0;
i <
s->projection;
i++) {
254 itmpmp[
i] = &itmpm[
i *
s->projection];
255 tmpmp[
i] = &tmpm[
i *
s->projection];
259 s->filter_channels = filter_channels_float;
320 .p.description =
NULL_IF_CONFIG_SMALL(
"Apply Affine Projection algorithm to first audio stream."),
321 .p.priv_class = &aap_class,
static enum AVSampleFormat sample_fmts[]
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static const AVFilterPad inputs[]
static const AVFilterPad outputs[]
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static int activate(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)
static int config_output(AVFilterLink *outlink)
static const AVOption aap_options[]
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts)
Test and acknowledge the change of status on the link.
int ff_inlink_check_available_samples(AVFilterLink *link, unsigned min)
Test if enough samples are available on the link.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_outlink_frame_wanted(AVFilterLink *link)
Test if a frame is wanted on an output link.
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
int ff_inlink_consume_samples(AVFilterLink *link, unsigned min, unsigned max, AVFrame **rframe)
Take samples from the link's FIFO and update the link's stats.
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
int ff_inlink_queued_samples(AVFilterLink *link)
void ff_inlink_request_frame(AVFilterLink *link)
Mark that a frame is wanted on the link.
Main libavfilter public API header.
#define i(width, name, range_min, range_max)
Public libavutil channel layout APIs header.
common internal and external API header
int(* init)(AVBSFContext *ctx)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
#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.
AVSampleFormat
Audio sample formats.
@ AV_SAMPLE_FMT_FLTP
float, planar
@ AV_SAMPLE_FMT_DBLP
double, planar
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int activate(AVBitStreamFilterContext *ctx)
static int config_output(AVBitStreamFilterLink *outlink)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
#define FF_FILTER_FORWARD_STATUS_BACK_ALL(outlink, filter)
Forward the status on an output link to all input links.
#define AVFILTER_DEFINE_CLASS(fname)
#define FILTER_QUERY_FUNC2(func)
av_cold AVFloatDSPContext * avpriv_float_dsp_alloc(int bit_exact)
Allocate a float DSP context.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
int nb_channels
Number of channels in this layout.
Describe the class of an AVClass context structure.
A link between two filters.
AVFilterContext * src
source filter
AVChannelLayout ch_layout
channel layout of current buffer (see libavutil/channel_layout.h)
int format
agreed upon media format
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
int(* filter_channels)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static AVFormatContext * ctx