FFmpeg
Data Structures | Macros | Functions | Variables
vf_maskedthreshold.c File Reference
#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "framesync.h"

Go to the source code of this file.

Data Structures

struct  MaskedThresholdContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define OFFSET(x)   offsetof(MaskedThresholdContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 

Functions

static int query_formats (AVFilterContext *ctx)
 
static void threshold8 (const uint8_t *src, const uint8_t *ref, uint8_t *dst, int threshold, int w)
 
static void threshold16 (const uint8_t *ssrc, const uint8_t *rref, uint8_t *ddst, int threshold, int w)
 
static int config_input (AVFilterLink *inlink)
 
static int threshold_slice (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int process_frame (FFFrameSync *fs)
 
static int config_output (AVFilterLink *outlink)
 
static int activate (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (maskedthreshold)
 

Variables

static const AVOption maskedthreshold_options []
 
static const AVFilterPad maskedthreshold_inputs []
 
static const AVFilterPad maskedthreshold_outputs []
 
const AVFilter ff_vf_maskedthreshold
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 45 of file vf_maskedthreshold.c.

◆ FLAGS

Definition at line 46 of file vf_maskedthreshold.c.

Function Documentation

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 58 of file vf_maskedthreshold.c.

◆ threshold8()

static void threshold8 ( const uint8_t *  src,
const uint8_t *  ref,
uint8_t *  dst,
int  threshold,
int  w 
)
static

Definition at line 85 of file vf_maskedthreshold.c.

Referenced by config_input().

◆ threshold16()

static void threshold16 ( const uint8_t *  ssrc,
const uint8_t *  rref,
uint8_t *  ddst,
int  threshold,
int  w 
)
static

Definition at line 91 of file vf_maskedthreshold.c.

Referenced by config_input().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 101 of file vf_maskedthreshold.c.

◆ threshold_slice()

static int threshold_slice ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 130 of file vf_maskedthreshold.c.

Referenced by process_frame().

◆ process_frame()

static int process_frame ( FFFrameSync fs)
static

Definition at line 166 of file vf_maskedthreshold.c.

Referenced by config_output().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 202 of file vf_maskedthreshold.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 250 of file vf_maskedthreshold.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 256 of file vf_maskedthreshold.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( maskedthreshold  )

Variable Documentation

◆ maskedthreshold_options

const AVOption maskedthreshold_options[]
static
Initial value:
= {
{ "threshold", "set threshold", OFFSET(threshold), AV_OPT_TYPE_INT, {.i64=1}, 0, UINT16_MAX, FLAGS },
{ "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, FLAGS },
{ NULL }
}

Definition at line 52 of file vf_maskedthreshold.c.

◆ maskedthreshold_inputs

const AVFilterPad maskedthreshold_inputs[]
static
Initial value:
= {
{
.name = "source",
.config_props = config_input,
},
{
.name = "reference",
},
{ NULL }
}

Definition at line 263 of file vf_maskedthreshold.c.

◆ maskedthreshold_outputs

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

Definition at line 276 of file vf_maskedthreshold.c.

◆ ff_vf_maskedthreshold

const AVFilter ff_vf_maskedthreshold
Initial value:
= {
.name = "maskedthreshold",
.description = NULL_IF_CONFIG_SMALL("Pick pixels comparing absolute difference of two streams with threshold."),
.priv_class = &maskedthreshold_class,
.priv_size = sizeof(MaskedThresholdContext),
}

Definition at line 287 of file vf_maskedthreshold.c.

FLAGS
#define FLAGS
Definition: vf_maskedthreshold.c:46
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
maskedthreshold_inputs
static const AVFilterPad maskedthreshold_inputs[]
Definition: vf_maskedthreshold.c:263
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
MaskedThresholdContext
Definition: vf_maskedthreshold.c:30
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
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_acrusher.c:336
ff_filter_process_command
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.
Definition: avfilter.c:842
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_maskedthreshold.c:202
maskedthreshold_outputs
static const AVFilterPad maskedthreshold_outputs[]
Definition: vf_maskedthreshold.c:276
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_maskedthreshold.c:101
planes
static const struct @322 planes[]
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:117
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
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:134
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
OFFSET
#define OFFSET(x)
Definition: vf_maskedthreshold.c:45
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_maskedthreshold.c:58
activate
static int activate(AVFilterContext *ctx)
Definition: vf_maskedthreshold.c:250
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_maskedthreshold.c:256