FFmpeg
Data Structures | Macros | Functions | Variables
vf_corr.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "framesync.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  CorrContext
 

Macros

#define OFFSET(x)   offsetof(CorrContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define CORR(type, name)
 
#define PF_NOALPHA(suf)   AV_PIX_FMT_YUV420##suf, AV_PIX_FMT_YUV422##suf, AV_PIX_FMT_YUV444##suf
 
#define PF_ALPHA(suf)   AV_PIX_FMT_YUVA420##suf, AV_PIX_FMT_YUVA422##suf, AV_PIX_FMT_YUVA444##suf
 
#define PF(suf)   PF_NOALPHA(suf), PF_ALPHA(suf)
 
#define corr_options   options
 

Functions

static void set_meta (AVFilterContext *ctx, AVDictionary **metadata, const char *key, char comp, float d)
 
static int do_corr (FFFrameSync *fs)
 
static av_cold int init (AVFilterContext *ctx)
 
static int config_input_ref (AVFilterLink *inlink)
 
static int config_output (AVFilterLink *outlink)
 
static int activate (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
 FRAMESYNC_DEFINE_CLASS (corr, CorrContext, fs)
 

Variables

static enum AVPixelFormat pix_fmts []
 
static const AVFilterPad corr_inputs []
 
static const AVFilterPad corr_outputs []
 
static const AVOption options []
 
const AVFilter ff_vf_corr
 

Detailed Description

Calculate the correlation between two input videos.

Definition in file vf_corr.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 48 of file vf_corr.c.

◆ FLAGS

Definition at line 49 of file vf_corr.c.

◆ CORR

#define CORR (   type,
  name 
)

Definition at line 69 of file vf_corr.c.

◆ PF_NOALPHA

#define PF_NOALPHA (   suf)    AV_PIX_FMT_YUV420##suf, AV_PIX_FMT_YUV422##suf, AV_PIX_FMT_YUV444##suf

◆ PF_ALPHA

#define PF_ALPHA (   suf)    AV_PIX_FMT_YUVA420##suf, AV_PIX_FMT_YUVA422##suf, AV_PIX_FMT_YUVA444##suf

◆ PF

#define PF (   suf)    PF_NOALPHA(suf), PF_ALPHA(suf)

◆ corr_options

#define corr_options   options

Definition at line 319 of file vf_corr.c.

Function Documentation

◆ set_meta()

static void set_meta ( AVFilterContext ctx,
AVDictionary **  metadata,
const char *  key,
char  comp,
float  d 
)
static

Definition at line 51 of file vf_corr.c.

Referenced by do_corr().

◆ do_corr()

static int do_corr ( FFFrameSync fs)
static

Definition at line 135 of file vf_corr.c.

Referenced by init().

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 178 of file vf_corr.c.

◆ config_input_ref()

static int config_input_ref ( AVFilterLink inlink)
static

Definition at line 202 of file vf_corr.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 237 of file vf_corr.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 266 of file vf_corr.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 272 of file vf_corr.c.

◆ FRAMESYNC_DEFINE_CLASS()

FRAMESYNC_DEFINE_CLASS ( corr  ,
CorrContext  ,
fs   
)

Variable Documentation

◆ pix_fmts

enum AVPixelFormat pix_fmts[]
static

◆ corr_inputs

const AVFilterPad corr_inputs[]
static
Initial value:
= {
{
.name = "main",
},{
.name = "reference",
.config_props = config_input_ref,
},
}

Definition at line 296 of file vf_corr.c.

◆ corr_outputs

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

Definition at line 307 of file vf_corr.c.

◆ options

const AVOption options[]
static
Initial value:
= {
{ NULL }
}

Definition at line 315 of file vf_corr.c.

◆ ff_vf_corr

const AVFilter ff_vf_corr
Initial value:
= {
.name = "corr",
.description = NULL_IF_CONFIG_SMALL("Calculate the correlation between two video streams."),
.preinit = corr_framesync_preinit,
.init = init,
.uninit = uninit,
.activate = activate,
.priv_size = sizeof(CorrContext),
.priv_class = &corr_class,
}

Definition at line 322 of file vf_corr.c.

AV_PIX_FMT_GBRAP16
#define AV_PIX_FMT_GBRAP16
Definition: pixfmt.h:491
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:172
AV_PIX_FMT_YUV440P
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:99
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_corr.c:237
AV_PIX_FMT_GRAY9
#define AV_PIX_FMT_GRAY9
Definition: pixfmt.h:448
corr_inputs
static const AVFilterPad corr_inputs[]
Definition: vf_corr.c:296
AV_PIX_FMT_GBRP14
#define AV_PIX_FMT_GBRP14
Definition: pixfmt.h:486
AV_PIX_FMT_GBRAP
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:205
corr_outputs
static const AVFilterPad corr_outputs[]
Definition: vf_corr.c:307
AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:484
AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:452
AV_PIX_FMT_YUVJ411P
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:276
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_corr.c:178
AV_PIX_FMT_YUVJ422P
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:79
AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_GBRAP10
Definition: pixfmt.h:488
AV_PIX_FMT_GBRAP12
#define AV_PIX_FMT_GBRAP12
Definition: pixfmt.h:489
activate
static int activate(AVFilterContext *ctx)
Definition: vf_corr.c:266
AV_PIX_FMT_GRAY14
#define AV_PIX_FMT_GRAY14
Definition: pixfmt.h:451
CorrContext
Definition: vf_corr.c:32
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:192
AV_PIX_FMT_YUVJ444P
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:80
AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:449
AV_PIX_FMT_GBRP16
#define AV_PIX_FMT_GBRP16
Definition: pixfmt.h:487
NULL
#define NULL
Definition: coverity.c:32
AV_PIX_FMT_YUVJ420P
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:78
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:74
PF
#define PF(suf)
AV_PIX_FMT_GBRP9
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:483
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:106
P
#define P
PF_NOALPHA
#define PF_NOALPHA(suf)
config_input_ref
static int config_input_ref(AVFilterLink *inlink)
Definition: vf_corr.c:202
AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:485
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: vf_corr.c:187
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_corr.c:272
AV_PIX_FMT_YUVJ440P
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
Definition: pixfmt.h:100
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AVFILTER_FLAG_METADATA_ONLY
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
Definition: avfilter.h:133
AV_PIX_FMT_GBRP
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:158
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:193
AV_PIX_FMT_YUV411P
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:73
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#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:155
AV_PIX_FMT_YUV410P
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:72
AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:450