FFmpeg
Data Structures | Macros | Functions | Variables
af_axcorrelate.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/audio_fifo.h"
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "formats.h"
#include "filters.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  AudioXCorrelateContext
 

Macros

#define AF   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define OFFSET(x)   offsetof(AudioXCorrelateContext, x)
 

Functions

static int query_formats (AVFilterContext *ctx)
 
static float mean_sum (const float *in, int size)
 
static float square_sum (const float *x, const float *y, int size)
 
static float xcorrelate (const float *x, const float *y, float sumx, float sumy, int size)
 
static int xcorrelate_slow (AVFilterContext *ctx, AVFrame *out)
 
static int xcorrelate_fast (AVFilterContext *ctx, AVFrame *out)
 
static int activate (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (axcorrelate)
 

Variables

static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
static const AVOption axcorrelate_options []
 
AVFilter ff_af_axcorrelate
 

Macro Definition Documentation

◆ AF

Definition at line 355 of file af_axcorrelate.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(AudioXCorrelateContext, x)

Definition at line 356 of file af_axcorrelate.c.

Function Documentation

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 50 of file af_axcorrelate.c.

◆ mean_sum()

static float mean_sum ( const float *  in,
int  size 
)
static

Definition at line 80 of file af_axcorrelate.c.

Referenced by xcorrelate_slow().

◆ square_sum()

static float square_sum ( const float *  x,
const float *  y,
int  size 
)
static

Definition at line 90 of file af_axcorrelate.c.

Referenced by vp6_block_variance(), and xcorrelate_fast().

◆ xcorrelate()

static float xcorrelate ( const float *  x,
const float *  y,
float  sumx,
float  sumy,
int  size 
)
static

Definition at line 100 of file af_axcorrelate.c.

Referenced by xcorrelate_slow().

◆ xcorrelate_slow()

static int xcorrelate_slow ( AVFilterContext ctx,
AVFrame out 
)
static

Definition at line 120 of file af_axcorrelate.c.

Referenced by config_output().

◆ xcorrelate_fast()

static int xcorrelate_fast ( AVFilterContext ctx,
AVFrame out 
)
static

Definition at line 153 of file af_axcorrelate.c.

Referenced by config_output().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 197 of file af_axcorrelate.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 287 of file af_axcorrelate.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 319 of file af_axcorrelate.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( axcorrelate  )

Variable Documentation

◆ inputs

const AVFilterPad inputs[]
static
Initial value:
= {
{
.name = "axcorrelate0",
},
{
.name = "axcorrelate1",
},
{ NULL }
}

Definition at line 334 of file af_axcorrelate.c.

◆ outputs

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

Definition at line 346 of file af_axcorrelate.c.

◆ axcorrelate_options

const AVOption axcorrelate_options[]
static
Initial value:
= {
{ "size", "set segment size", OFFSET(size), AV_OPT_TYPE_INT, {.i64=256}, 2, 131072, AF },
{ "algo", "set alghorithm", OFFSET(algo), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, AF, "algo" },
{ "slow", "slow algorithm", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, AF, "algo" },
{ "fast", "fast algorithm", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, AF, "algo" },
{ NULL }
}

Definition at line 358 of file af_axcorrelate.c.

◆ ff_af_axcorrelate

AVFilter ff_af_axcorrelate
Initial value:
= {
.name = "axcorrelate",
.description = NULL_IF_CONFIG_SMALL("Cross-correlate two audio streams."),
.priv_size = sizeof(AudioXCorrelateContext),
.priv_class = &axcorrelate_class,
}

Definition at line 368 of file af_axcorrelate.c.

query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_axcorrelate.c:50
OFFSET
#define OFFSET(x)
Definition: af_axcorrelate.c:356
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_axcorrelate.c:287
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AudioXCorrelateContext
Definition: af_axcorrelate.c:33
NULL
#define NULL
Definition: coverity.c:32
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
AF
#define AF
Definition: af_axcorrelate.c:355
size
int size
Definition: twinvq_data.h:10344
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_axcorrelate.c:319
algo
Definition: dct.c:53
inputs
static const AVFilterPad inputs[]
Definition: af_axcorrelate.c:334
activate
static int activate(AVFilterContext *ctx)
Definition: af_axcorrelate.c:197
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234
outputs
static const AVFilterPad outputs[]
Definition: af_axcorrelate.c:346