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

Go to the source code of this file.

Data Structures

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

Macros

#define R   0
 
#define G   1
 
#define B   2
 
#define A   3
 
#define OFFSET(x)   offsetof(VibranceContext, x)
 
#define VF   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_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 vibrance_slice8p (AVFilterContext *avctx, void *arg, int jobnr, int nb_jobs)
 
static int vibrance_slice16p (AVFilterContext *avctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_frame (AVFilterLink *link, AVFrame *in)
 
static av_cold int config_input (AVFilterLink *inlink)
 
 AVFILTER_DEFINE_CLASS (vibrance)
 

Variables

static enum AVPixelFormat pixel_fmts []
 
static const AVFilterPad vibrance_inputs []
 
static const AVOption vibrance_options []
 
const AVFilter ff_vf_vibrance
 

Macro Definition Documentation

◆ R

#define R   0

Definition at line 28 of file vf_vibrance.c.

◆ G

#define G   1

Definition at line 29 of file vf_vibrance.c.

◆ B

#define B   2

Definition at line 30 of file vf_vibrance.c.

◆ A

#define A   3

Definition at line 31 of file vf_vibrance.c.

◆ OFFSET

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

Definition at line 418 of file vf_vibrance.c.

◆ VF

Definition at line 419 of file vf_vibrance.c.

Function Documentation

◆ lerpf()

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

◆ vibrance_slice8()

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

Definition at line 58 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 133 of file vf_vibrance.c.

Referenced by config_input().

◆ vibrance_slice8p()

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

Definition at line 210 of file vf_vibrance.c.

Referenced by config_input().

◆ vibrance_slice16p()

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

Definition at line 274 of file vf_vibrance.c.

Referenced by config_input().

◆ filter_frame()

static int filter_frame ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 339 of file vf_vibrance.c.

◆ config_input()

static av_cold int config_input ( AVFilterLink inlink)
static

Definition at line 385 of file vf_vibrance.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( vibrance  )

Variable Documentation

◆ pixel_fmts

enum AVPixelFormat pixel_fmts[]
static

◆ vibrance_inputs

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

Definition at line 409 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 421 of file vf_vibrance.c.

◆ ff_vf_vibrance

const 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,
.process_command = ff_filter_process_command,
}

Definition at line 435 of file vf_vibrance.c.

AV_PIX_FMT_GBRAP16
#define AV_PIX_FMT_GBRAP16
Definition: pixfmt.h:491
filter_frame
static int filter_frame(AVFilterLink *link, AVFrame *in)
Definition: vf_vibrance.c:339
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:172
pixel_fmts
static enum AVPixelFormat pixel_fmts[]
Definition: vf_vibrance.c:370
VF
#define VF
Definition: vf_vibrance.c:419
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:69
AV_PIX_FMT_BGRA
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:95
AV_PIX_FMT_GBRP14
#define AV_PIX_FMT_GBRP14
Definition: pixfmt.h:486
AV_PIX_FMT_GBRAP
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:205
AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:484
ff_video_default_filterpad
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition: video.c:36
AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_GBRAP10
Definition: pixfmt.h:488
AV_PIX_FMT_GBRAP12
#define AV_PIX_FMT_GBRAP12
Definition: pixfmt.h:489
vibrance_inputs
static const AVFilterPad vibrance_inputs[]
Definition: vf_vibrance.c:409
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:192
AV_PIX_FMT_RGBA
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:93
AV_PIX_FMT_GBRP16
#define AV_PIX_FMT_GBRP16
Definition: pixfmt.h:487
AV_PIX_FMT_RGBA64
#define AV_PIX_FMT_RGBA64
Definition: pixfmt.h:458
AV_PIX_FMT_BGR48
#define AV_PIX_FMT_BGR48
Definition: pixfmt.h:459
NULL
#define NULL
Definition: coverity.c:32
AV_PIX_FMT_BGR0
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition: pixfmt.h:258
AV_PIX_FMT_GBRP9
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:483
AV_PIX_FMT_ABGR
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:94
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:68
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:106
AV_PIX_FMT_RGB48
#define AV_PIX_FMT_RGB48
Definition: pixfmt.h:454
ff_filter_process_command
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Definition: avfilter.c:851
AV_PIX_FMT_RGB0
@ AV_PIX_FMT_RGB0
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
Definition: pixfmt.h:256
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:147
AV_PIX_FMT_ARGB
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:92
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:228
AV_PIX_FMT_BGRA64
#define AV_PIX_FMT_BGRA64
Definition: pixfmt.h:463
OFFSET
#define OFFSET(x)
Definition: vf_vibrance.c:418
AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:485
AV_PIX_FMT_0BGR
@ AV_PIX_FMT_0BGR
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
Definition: pixfmt.h:257
config_input
static av_cold int config_input(AVFilterLink *inlink)
Definition: vf_vibrance.c:385
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_PIX_FMT_GBRP
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:158
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:117
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:244
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:193
AV_PIX_FMT_0RGB
@ AV_PIX_FMT_0RGB
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
Definition: pixfmt.h:255
VibranceContext
Definition: vf_vibrance.c:33