FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
vf_colorbalance.c File Reference
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  ThreadData
 Used for passing data between threads. More...
 
struct  Range
 
struct  ColorBalanceContext
 

Macros

#define R   0
 
#define G   1
 
#define B   2
 
#define A   3
 
#define OFFSET(x)   offsetof(ColorBalanceContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (colorbalance)
 
static int query_formats (AVFilterContext *ctx)
 
static int apply_lut8_p (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int apply_lut16_p (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int apply_lut8 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int apply_lut16 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int config_output (AVFilterLink *outlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 

Variables

static const AVOption colorbalance_options []
 
static const AVFilterPad colorbalance_inputs []
 
static const AVFilterPad colorbalance_outputs []
 
AVFilter ff_vf_colorbalance
 

Macro Definition Documentation

#define R   0

Definition at line 29 of file vf_colorbalance.c.

Referenced by apply_lut16(), apply_lut16_p(), apply_lut8(), apply_lut8_p(), and config_output().

#define G   1

Definition at line 30 of file vf_colorbalance.c.

Referenced by apply_lut16(), apply_lut16_p(), apply_lut8(), apply_lut8_p(), and config_output().

#define B   2

Definition at line 31 of file vf_colorbalance.c.

Referenced by apply_lut16(), apply_lut16_p(), apply_lut8(), apply_lut8_p(), and config_output().

#define A   3

Definition at line 32 of file vf_colorbalance.c.

Referenced by apply_lut16(), and apply_lut8().

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

Definition at line 58 of file vf_colorbalance.c.

Definition at line 59 of file vf_colorbalance.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( colorbalance  )
static int query_formats ( AVFilterContext ctx)
static

Definition at line 75 of file vf_colorbalance.c.

static int apply_lut8_p ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 99 of file vf_colorbalance.c.

Referenced by config_output().

static int apply_lut16_p ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 139 of file vf_colorbalance.c.

Referenced by config_output().

static int apply_lut8 ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 179 of file vf_colorbalance.c.

Referenced by config_output().

static int apply_lut16 ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 217 of file vf_colorbalance.c.

Referenced by config_output().

static int config_output ( AVFilterLink outlink)
static

Definition at line 255 of file vf_colorbalance.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 325 of file vf_colorbalance.c.

Variable Documentation

const AVOption colorbalance_options[]
static
Initial value:
= {
{ "rs", "set red shadows", OFFSET(cyan_red.shadows), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
{ "gs", "set green shadows", OFFSET(magenta_green.shadows), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
{ "bs", "set blue shadows", OFFSET(yellow_blue.shadows), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
{ "rm", "set red midtones", OFFSET(cyan_red.midtones), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
{ "gm", "set green midtones", OFFSET(magenta_green.midtones), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
{ "bm", "set blue midtones", OFFSET(yellow_blue.midtones), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
{ "rh", "set red highlights", OFFSET(cyan_red.highlights), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
{ "gh", "set green highlights", OFFSET(magenta_green.highlights), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
{ "bh", "set blue highlights", OFFSET(yellow_blue.highlights), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -1, 1, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
#define FLAGS

Definition at line 60 of file vf_colorbalance.c.

const AVFilterPad colorbalance_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *in)

Definition at line 353 of file vf_colorbalance.c.

const AVFilterPad colorbalance_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 362 of file vf_colorbalance.c.

AVFilter ff_vf_colorbalance
Initial value:
= {
.name = "colorbalance",
.description = NULL_IF_CONFIG_SMALL("Adjust the color balance."),
.priv_size = sizeof(ColorBalanceContext),
.priv_class = &colorbalance_class,
}
static const AVFilterPad colorbalance_inputs[]
static const AVFilterPad colorbalance_outputs[]
#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
static int query_formats(AVFilterContext *ctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
#define flags(name, subs,...)
Definition: cbs_av1.c:596

Definition at line 371 of file vf_colorbalance.c.