FFmpeg
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 338 of file vf_hysteresis.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 344 of file vf_hysteresis.c.

◆ FRAMESYNC_DEFINE_CLASS()

FRAMESYNC_DEFINE_CLASS ( hysteresis  ,
HysteresisContext  ,
fs   
)

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 }
}

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 }
}

Definition at line 355 of file vf_hysteresis.c.

◆ hysteresis_outputs

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

Definition at line 368 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,
}

Definition at line 377 of file vf_hysteresis.c.

config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_hysteresis.c:289
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_hysteresis.c:61
HysteresisContext
Definition: vf_hysteresis.c:34
hysteresis_inputs
static const AVFilterPad hysteresis_inputs[]
Definition: vf_hysteresis.c:355
activate
static int activate(AVFilterContext *ctx)
Definition: vf_hysteresis.c:338
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
NULL
#define NULL
Definition: coverity.c:32
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
planes
static const struct @314 planes[]
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:188
FLAGS
#define FLAGS
Definition: vf_hysteresis.c:32
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
OFFSET
#define OFFSET(x)
Definition: vf_hysteresis.c:31
hysteresis_outputs
static const AVFilterPad hysteresis_outputs[]
Definition: vf_hysteresis.c:368
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_hysteresis.c:344
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_hysteresis.c:255
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:133
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:565