Data Structures | Macros | Functions | Variables
vf_maskedclamp.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"
#include "maskedclamp.h"

Go to the source code of this file.

Data Structures

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


#define OFFSET(x)   offsetof(MaskedClampContext, x)
#define MASKEDCLAMP(type, name)


static int query_formats (AVFilterContext *ctx)
static int maskedclamp_slice (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int process_frame (FFFrameSync *fs)
static int config_input (AVFilterLink *inlink)
static int config_output (AVFilterLink *outlink)
static int activate (AVFilterContext *ctx)
static av_cold void uninit (AVFilterContext *ctx)


static const AVOption maskedclamp_options []
static const AVFilterPad maskedclamp_inputs []
static const AVFilterPad maskedclamp_outputs []
AVFilter ff_vf_maskedclamp

Macro Definition Documentation

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

Definition at line 31 of file vf_maskedclamp.c.

Definition at line 32 of file vf_maskedclamp.c.

#define MASKEDCLAMP (   type,
static void maskedclamp##name(const uint8_t *bbsrc, uint8_t *ddst, \
const uint8_t *ddarksrc, const uint8_t *bbrightsrc, \
int w, int undershoot, int overshoot) \
{ \
const type *bsrc = (const type *)bbsrc; \
const type *darksrc = (const type *)ddarksrc; \
const type *brightsrc = (const type *)bbrightsrc; \
type *dst = (type *)ddst; \
for (int x = 0; x < w; x++) { \
dst[x] = FFMAX(bsrc[x], darksrc[x] - undershoot); \
dst[x] = FFMIN(dst[x], brightsrc[x] + overshoot); \
} \
GLint GLenum type
Definition: opengl_enc.c:104
#define FFMAX(a, b)
Definition: common.h:94
#define FFMIN(a, b)
Definition: common.h:96
uint8_t w
Definition: llviddspenc.c:38
for(j=16;j >0;--j)
const char * name
Definition: opengl_enc.c:102

Definition at line 170 of file vf_maskedclamp.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( maskedclamp  )
static int query_formats ( AVFilterContext ctx)

Definition at line 63 of file vf_maskedclamp.c.

static int maskedclamp_slice ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 

Definition at line 90 of file vf_maskedclamp.c.

Referenced by process_frame().

static int process_frame ( FFFrameSync fs)

Definition at line 132 of file vf_maskedclamp.c.

Referenced by config_output().

static int config_input ( AVFilterLink inlink)

Definition at line 189 of file vf_maskedclamp.c.

static int config_output ( AVFilterLink outlink)

Definition at line 223 of file vf_maskedclamp.c.

static int activate ( AVFilterContext ctx)

Definition at line 280 of file vf_maskedclamp.c.

static av_cold void uninit ( AVFilterContext ctx)

Definition at line 286 of file vf_maskedclamp.c.

Variable Documentation

const AVOption maskedclamp_options[]
Initial value:
= {
{ "undershoot", "set undershoot", OFFSET(undershoot), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS },
{ "overshoot", "set overshoot", OFFSET(overshoot), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS },
{ "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, FLAGS },
{ NULL }
#define NULL
Definition: coverity.c:32
#define FLAGS
#define OFFSET(x)
static const struct @326 planes[]

Definition at line 54 of file vf_maskedclamp.c.

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

Definition at line 293 of file vf_maskedclamp.c.

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

Definition at line 310 of file vf_maskedclamp.c.

AVFilter ff_vf_maskedclamp
Initial value:
= {
.name = "maskedclamp",
.description = NULL_IF_CONFIG_SMALL("Clamp first stream with second stream and third stream."),
.priv_size = sizeof(MaskedClampContext),
.priv_class = &maskedclamp_class,
static const AVFilterPad maskedclamp_outputs[]
static const AVFilterPad maskedclamp_inputs[]
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
static av_cold void uninit(AVFilterContext *ctx)
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
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
static int query_formats(AVFilterContext *ctx)
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:133
#define flags(name, subs,...)
Definition: cbs_av1.c:564
static int activate(AVFilterContext *ctx)

Definition at line 319 of file vf_maskedclamp.c.