FFmpeg
Data Structures | Macros | Functions | Variables
vf_threshold.c File Reference

threshold video filter More...

#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

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

Definition at line 36 of file vf_threshold.c.

Definition at line 37 of file vf_threshold.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( threshold  )
static int query_formats ( AVFilterContext ctx)
static

Definition at line 46 of file vf_threshold.c.

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

Definition at line 79 of file vf_threshold.c.

Referenced by process_frame().

static int process_frame ( FFFrameSync fs)
static

Definition at line 117 of file vf_threshold.c.

Referenced by config_output().

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 156 of file vf_threshold.c.

Referenced by ff_threshold_init().

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 179 of file vf_threshold.c.

Referenced by ff_threshold_init().

static int config_input ( AVFilterLink inlink)
static

Definition at line 207 of file vf_threshold.c.

void ff_threshold_init ( ThresholdContext s)

Definition at line 229 of file vf_threshold.c.

Referenced by check_threshold(), and config_input().

static int config_output ( AVFilterLink outlink)
static

Definition at line 243 of file vf_threshold.c.

static int activate ( AVFilterContext ctx)
static

Definition at line 312 of file vf_threshold.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 318 of file vf_threshold.c.

Variable Documentation

const AVOption threshold_options[]
static
Initial value:
= {
{ "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=15}, 0, 15, FLAGS},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static const struct @322 planes[]
#define OFFSET(x)
Definition: vf_threshold.c:36
#define FLAGS
Definition: vf_threshold.c:37

Definition at line 39 of file vf_threshold.c.

const AVFilterPad inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
},
{
.name = "threshold",
},
{
.name = "min",
},
{
.name = "max",
},
{ NULL }
}
static int config_input(AVFilterLink *inlink)
Definition: vf_threshold.c:207
#define NULL
Definition: coverity.c:32

Definition at line 325 of file vf_threshold.c.

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_output(AVFilterLink *outlink)
Definition: vf_threshold.c:243

Definition at line 346 of file vf_threshold.c.

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,
}
static int activate(AVFilterContext *ctx)
Definition: vf_threshold.c:312
static int query_formats(AVFilterContext *ctx)
Definition: vf_threshold.c:46
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
static const AVFilterPad inputs[]
Definition: vf_threshold.c:325
static const AVFilterPad outputs[]
Definition: vf_threshold.c:346
#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:133
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_threshold.c:318
#define flags(name, subs,...)
Definition: cbs_av1.c:561

Definition at line 355 of file vf_threshold.c.