FFmpeg  4.0
Data Structures | Macros | Functions | Variables
vf_hysteresis.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  HysteresisContext
 

Macros

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

Functions

static int query_formats (AVFilterContext *ctx)
 
static int process_frame (FFFrameSync *fs)
 
static int passed (HysteresisContext *s, int x, int y, int w)
 
static void push (HysteresisContext *s, int x, int y, int w)
 
static void pop (HysteresisContext *s, int *x, int *y)
 
static int is_empty (HysteresisContext *s)
 
static void hysteresis8 (HysteresisContext *s, const uint8_t *bsrc, const uint8_t *asrc, uint8_t *dst, ptrdiff_t blinesize, ptrdiff_t alinesize, ptrdiff_t dlinesize, int w, int h)
 
static void hysteresis16 (HysteresisContext *s, const uint8_t *bbsrc, const uint8_t *aasrc, uint8_t *ddst, ptrdiff_t blinesize, ptrdiff_t alinesize, ptrdiff_t dlinesize, int w, int h)
 
static int config_input (AVFilterLink *inlink)
 
static int config_output (AVFilterLink *outlink)
 
static int activate (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
 FRAMESYNC_DEFINE_CLASS (hysteresis, HysteresisContext, fs)
 

Variables

static const AVOption hysteresis_options []
 
static const AVFilterPad hysteresis_inputs []
 
static const AVFilterPad hysteresis_outputs []
 
AVFilter ff_vf_hysteresis
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 31 of file vf_hysteresis.c.

◆ FLAGS

Definition at line 32 of file vf_hysteresis.c.

Function Documentation

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 61 of file vf_hysteresis.c.

◆ process_frame()

static int process_frame ( FFFrameSync fs)
static

Definition at line 87 of file vf_hysteresis.c.

Referenced by config_output().

◆ passed()

static int passed ( HysteresisContext s,
int  x,
int  y,
int  w 
)
static

Definition at line 140 of file vf_hysteresis.c.

Referenced by hysteresis16(), and hysteresis8().

◆ push()

static void push ( HysteresisContext s,
int  x,
int  y,
int  w 
)
static

Definition at line 145 of file vf_hysteresis.c.

Referenced by hysteresis16(), and hysteresis8().

◆ pop()

static void pop ( HysteresisContext s,
int x,
int y 
)
static

Definition at line 151 of file vf_hysteresis.c.

Referenced by hysteresis16(), and hysteresis8().

◆ is_empty()

static int is_empty ( HysteresisContext s)
static

Definition at line 159 of file vf_hysteresis.c.

Referenced by hysteresis16(), and hysteresis8().

◆ hysteresis8()

static void hysteresis8 ( HysteresisContext s,
const uint8_t bsrc,
const uint8_t asrc,
uint8_t dst,
ptrdiff_t  blinesize,
ptrdiff_t  alinesize,
ptrdiff_t  dlinesize,
int  w,
int  h 
)
static

Definition at line 164 of file vf_hysteresis.c.

Referenced by config_input().

◆ hysteresis16()

static void hysteresis16 ( HysteresisContext s,
const uint8_t bbsrc,
const uint8_t aasrc,
uint8_t ddst,
ptrdiff_t  blinesize,
ptrdiff_t  alinesize,
ptrdiff_t  dlinesize,
int  w,
int  h 
)
static

Definition at line 206 of file vf_hysteresis.c.

Referenced by config_input().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 255 of file vf_hysteresis.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 289 of file vf_hysteresis.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 336 of file vf_hysteresis.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 342 of file vf_hysteresis.c.

◆ FRAMESYNC_DEFINE_CLASS()

FRAMESYNC_DEFINE_CLASS ( hysteresis  ,
HysteresisContext  ,
fs   
)

Referenced by uninit().

Variable Documentation

◆ hysteresis_options

const AVOption hysteresis_options[]
static
Initial value:
= {
{ "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, FLAGS },
{ "threshold", "set threshold", OFFSET(threshold), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: vf_hysteresis.c:31
#define FLAGS
Definition: vf_hysteresis.c:32
static const struct @272 planes[]

Definition at line 55 of file vf_hysteresis.c.

◆ hysteresis_inputs

const AVFilterPad hysteresis_inputs[]
static
Initial value:
= {
{
.name = "base",
.config_props = config_input,
},
{
.name = "alt",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_input(AVFilterLink *inlink)

Definition at line 353 of file vf_hysteresis.c.

◆ hysteresis_outputs

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

Definition at line 366 of file vf_hysteresis.c.

◆ ff_vf_hysteresis

AVFilter ff_vf_hysteresis
Initial value:
= {
.name = "hysteresis",
.description = NULL_IF_CONFIG_SMALL("Grow first stream into second stream by connecting components."),
.preinit = hysteresis_framesync_preinit,
.priv_size = sizeof(HysteresisContext),
.priv_class = &hysteresis_class,
}
static int flags
Definition: log.c:55
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static int query_formats(AVFilterContext *ctx)
Definition: vf_hysteresis.c:61
static int activate(AVFilterContext *ctx)
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
#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)
static const AVFilterPad hysteresis_outputs[]
static const AVFilterPad hysteresis_inputs[]

Definition at line 375 of file vf_hysteresis.c.