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

Go to the source code of this file.

Data Structures

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

Macros

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

Functions

 AVFILTER_DEFINE_CLASS (threshold)
 
static int query_formats (AVFilterContext *ctx)
 
static int filter_slice (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int process_frame (FFFrameSync *fs)
 
static void threshold8 (const uint8_t *in, const uint8_t *threshold, const uint8_t *min, const uint8_t *max, uint8_t *out, ptrdiff_t ilinesize, ptrdiff_t tlinesize, ptrdiff_t flinesize, ptrdiff_t slinesize, ptrdiff_t olinesize, int w, int h)
 
static void threshold16 (const uint8_t *iin, const uint8_t *tthreshold, const uint8_t *ffirst, const uint8_t *ssecond, uint8_t *oout, ptrdiff_t ilinesize, ptrdiff_t tlinesize, ptrdiff_t flinesize, ptrdiff_t slinesize, ptrdiff_t olinesize, int w, int h)
 
static int config_input (AVFilterLink *inlink)
 
void ff_threshold_init (ThresholdContext *s)
 
static int config_output (AVFilterLink *outlink)
 
static int activate (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption threshold_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter ff_vf_threshold
 

Detailed Description

threshold video filter

Definition in file vf_threshold.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 36 of file vf_threshold.c.

◆ FLAGS

Definition at line 37 of file vf_threshold.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( threshold  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 46 of file vf_threshold.c.

◆ filter_slice()

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

Definition at line 81 of file vf_threshold.c.

Referenced by process_frame().

◆ process_frame()

static int process_frame ( FFFrameSync fs)
static

Definition at line 119 of file vf_threshold.c.

Referenced by config_output().

◆ threshold8()

static void threshold8 ( const uint8_t in,
const uint8_t threshold,
const uint8_t min,
const uint8_t max,
uint8_t out,
ptrdiff_t  ilinesize,
ptrdiff_t  tlinesize,
ptrdiff_t  flinesize,
ptrdiff_t  slinesize,
ptrdiff_t  olinesize,
int  w,
int  h 
)
static

Definition at line 158 of file vf_threshold.c.

Referenced by ff_threshold_init().

◆ threshold16()

static void threshold16 ( const uint8_t iin,
const uint8_t tthreshold,
const uint8_t ffirst,
const uint8_t ssecond,
uint8_t oout,
ptrdiff_t  ilinesize,
ptrdiff_t  tlinesize,
ptrdiff_t  flinesize,
ptrdiff_t  slinesize,
ptrdiff_t  olinesize,
int  w,
int  h 
)
static

Definition at line 181 of file vf_threshold.c.

Referenced by ff_threshold_init().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 209 of file vf_threshold.c.

◆ ff_threshold_init()

void ff_threshold_init ( ThresholdContext s)

Definition at line 231 of file vf_threshold.c.

Referenced by check_threshold(), and config_input().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 245 of file vf_threshold.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 314 of file vf_threshold.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 320 of file vf_threshold.c.

Variable Documentation

◆ threshold_options

const AVOption threshold_options[]
static
Initial value:
= {
{ "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=15}, 0, 15, FLAGS},
{ NULL }
}

Definition at line 39 of file vf_threshold.c.

◆ inputs

const AVFilterPad inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
},
{
.name = "threshold",
},
{
.name = "min",
},
{
.name = "max",
},
{ NULL }
}

Definition at line 327 of file vf_threshold.c.

◆ outputs

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

Definition at line 348 of file vf_threshold.c.

◆ ff_vf_threshold

AVFilter ff_vf_threshold
Initial value:
= {
.name = "threshold",
.description = NULL_IF_CONFIG_SMALL("Threshold first video stream using other video streams."),
.priv_size = sizeof(ThresholdContext),
.priv_class = &threshold_class,
}

Definition at line 357 of file vf_threshold.c.

OFFSET
#define OFFSET(x)
Definition: vf_threshold.c:36
FLAGS
#define FLAGS
Definition: vf_threshold.c:37
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_threshold.c:320
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_threshold.c:46
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
ThresholdContext
Definition: threshold.h:27
outputs
static const AVFilterPad outputs[]
Definition: vf_threshold.c:348
activate
static int activate(AVFilterContext *ctx)
Definition: vf_threshold.c:314
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_threshold.c:209
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
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
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_threshold.c:245
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
inputs
static const AVFilterPad inputs[]
Definition: vf_threshold.c:327