FFmpeg
Data Structures | Macros | Functions | Variables
vf_vibrance.c File Reference
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  VibranceContext
 

Macros

#define OFFSET(x)   offsetof(VibranceContext, x)
 
#define VF   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Functions

static float lerpf (float v0, float v1, float f)
 
static int vibrance_slice8 (AVFilterContext *avctx, void *arg, int jobnr, int nb_jobs)
 
static int vibrance_slice16 (AVFilterContext *avctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_frame (AVFilterLink *link, AVFrame *frame)
 
static av_cold int query_formats (AVFilterContext *avctx)
 
static av_cold int config_input (AVFilterLink *inlink)
 
 AVFILTER_DEFINE_CLASS (vibrance)
 

Variables

static const AVFilterPad vibrance_inputs []
 
static const AVFilterPad vibrance_outputs []
 
static const AVOption vibrance_options []
 
AVFilter ff_vf_vibrance
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 226 of file vf_vibrance.c.

◆ VF

Definition at line 227 of file vf_vibrance.c.

Function Documentation

◆ lerpf()

static float lerpf ( float  v0,
float  v1,
float  f 
)
inlinestatic

Definition at line 42 of file vf_vibrance.c.

Referenced by vibrance_slice16(), and vibrance_slice8().

◆ vibrance_slice8()

static int vibrance_slice8 ( AVFilterContext avctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 47 of file vf_vibrance.c.

Referenced by config_input().

◆ vibrance_slice16()

static int vibrance_slice16 ( AVFilterContext avctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 104 of file vf_vibrance.c.

Referenced by config_input().

◆ filter_frame()

static int filter_frame ( AVFilterLink link,
AVFrame frame 
)
static

Definition at line 163 of file vf_vibrance.c.

◆ query_formats()

static av_cold int query_formats ( AVFilterContext avctx)
static

Definition at line 176 of file vf_vibrance.c.

◆ config_input()

static av_cold int config_input ( AVFilterLink inlink)
static

Definition at line 195 of file vf_vibrance.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( vibrance  )

Variable Documentation

◆ vibrance_inputs

const AVFilterPad vibrance_inputs[]
static
Initial value:
= {
{
.name = "default",
.needs_writable = 1,
.filter_frame = filter_frame,
.config_props = config_input,
},
{ NULL }
}

Definition at line 207 of file vf_vibrance.c.

◆ vibrance_outputs

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

Definition at line 218 of file vf_vibrance.c.

◆ vibrance_options

const AVOption vibrance_options[]
static
Initial value:
= {
{ "intensity", "set the intensity value", OFFSET(intensity), AV_OPT_TYPE_FLOAT, {.dbl=0}, -2, 2, VF },
{ "rbal", "set the red balance value", OFFSET(balance[2]), AV_OPT_TYPE_FLOAT, {.dbl=1}, -10, 10, VF },
{ "gbal", "set the green balance value", OFFSET(balance[0]), AV_OPT_TYPE_FLOAT, {.dbl=1}, -10, 10, VF },
{ "bbal", "set the blue balance value", OFFSET(balance[1]), AV_OPT_TYPE_FLOAT, {.dbl=1}, -10, 10, VF },
{ "rlum", "set the red luma coefficient", OFFSET(lcoeffs[2]), AV_OPT_TYPE_FLOAT, {.dbl=0.072186}, 0, 1, VF },
{ "glum", "set the green luma coefficient", OFFSET(lcoeffs[0]), AV_OPT_TYPE_FLOAT, {.dbl=0.715158}, 0, 1, VF },
{ "blum", "set the blue luma coefficient", OFFSET(lcoeffs[1]), AV_OPT_TYPE_FLOAT, {.dbl=0.212656}, 0, 1, VF },
{ "alternate", "use alternate colors", OFFSET(alternate), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, VF },
{ NULL }
}

Definition at line 229 of file vf_vibrance.c.

◆ ff_vf_vibrance

AVFilter ff_vf_vibrance
Initial value:
= {
.name = "vibrance",
.description = NULL_IF_CONFIG_SMALL("Boost or alter saturation."),
.priv_size = sizeof(VibranceContext),
.priv_class = &vibrance_class,
}

Definition at line 243 of file vf_vibrance.c.

VF
#define VF
Definition: vf_vibrance.c:227
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
vibrance_inputs
static const AVFilterPad vibrance_inputs[]
Definition: vf_vibrance.c:207
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
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
query_formats
static av_cold int query_formats(AVFilterContext *avctx)
Definition: vf_vibrance.c:176
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:125
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:226
OFFSET
#define OFFSET(x)
Definition: vf_vibrance.c:226
filter_frame
static int filter_frame(AVFilterLink *link, AVFrame *frame)
Definition: vf_vibrance.c:163
config_input
static av_cold int config_input(AVFilterLink *inlink)
Definition: vf_vibrance.c:195
vibrance_outputs
static const AVFilterPad vibrance_outputs[]
Definition: vf_vibrance.c:218
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:116
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:240
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:565
VibranceContext
Definition: vf_vibrance.c:28