FFmpeg
Data Structures | Macros | Functions | Variables
vf_colorcorrect.c File Reference
#include <float.h>
#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  ColorCorrectContext
 

Macros

#define PROCESS()
 
#define OFFSET(x)   offsetof(ColorCorrectContext, x)
 
#define VF   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 

Functions

static int colorcorrect_slice8 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int colorcorrect_slice16 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 
static av_cold int query_formats (AVFilterContext *ctx)
 
static av_cold int config_input (AVFilterLink *inlink)
 
 AVFILTER_DEFINE_CLASS (colorcorrect)
 

Variables

static const AVFilterPad colorcorrect_inputs []
 
static const AVFilterPad colorcorrect_outputs []
 
static const AVOption colorcorrect_options []
 
const AVFilter ff_vf_colorcorrect
 

Macro Definition Documentation

◆ PROCESS

#define PROCESS ( )
Value:
float y = yptr[x] * imax; \
float u = uptr[x] * imax - .5f; \
float v = vptr[x] * imax - .5f; \
float ny, nu, nv; \
\
ny = y; \
nu = saturation * (u + y * bd + bl); \
nv = saturation * (v + y * rd + rl);

Definition at line 43 of file vf_colorcorrect.c.

◆ OFFSET

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

Definition at line 193 of file vf_colorcorrect.c.

◆ VF

Definition at line 194 of file vf_colorcorrect.c.

Function Documentation

◆ colorcorrect_slice8()

static int colorcorrect_slice8 ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 53 of file vf_colorcorrect.c.

Referenced by config_input().

◆ colorcorrect_slice16()

static int colorcorrect_slice16 ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 93 of file vf_colorcorrect.c.

Referenced by config_input().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 133 of file vf_colorcorrect.c.

◆ query_formats()

static av_cold int query_formats ( AVFilterContext ctx)
static

Definition at line 144 of file vf_colorcorrect.c.

◆ config_input()

static av_cold int config_input ( AVFilterLink inlink)
static

Definition at line 162 of file vf_colorcorrect.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( colorcorrect  )

Variable Documentation

◆ colorcorrect_inputs

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

Definition at line 174 of file vf_colorcorrect.c.

◆ colorcorrect_outputs

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

Definition at line 185 of file vf_colorcorrect.c.

◆ colorcorrect_options

const AVOption colorcorrect_options[]
static
Initial value:
= {
{ "rl", "set the red shadow spot", OFFSET(rl), AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, VF },
{ "bl", "set the blue shadow spot", OFFSET(bl), AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, VF },
{ "rh", "set the red highlight spot", OFFSET(rh), AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, VF },
{ "bh", "set the blue highlight spot", OFFSET(bh), AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, VF },
{ "saturation", "set the amount of saturation", OFFSET(saturation), AV_OPT_TYPE_FLOAT, {.dbl=1}, -3, 3, VF },
{ NULL }
}

Definition at line 196 of file vf_colorcorrect.c.

◆ ff_vf_colorcorrect

const AVFilter ff_vf_colorcorrect
Initial value:
= {
.name = "colorcorrect",
.description = NULL_IF_CONFIG_SMALL("Adjust color white balance selectively for blacks and whites."),
.priv_size = sizeof(ColorCorrectContext),
.priv_class = &colorcorrect_class,
}

Definition at line 207 of file vf_colorcorrect.c.

VF
#define VF
Definition: vf_colorcorrect.c:194
query_formats
static av_cold int query_formats(AVFilterContext *ctx)
Definition: vf_colorcorrect.c:144
u
#define u(width, name, range_min, range_max)
Definition: cbs_h2645.c:264
colorcorrect_inputs
static const AVFilterPad colorcorrect_inputs[]
Definition: vf_colorcorrect.c:174
config_input
static av_cold int config_input(AVFilterLink *inlink)
Definition: vf_colorcorrect.c:162
ColorCorrectContext
Definition: vf_colorcorrect.c:30
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
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
NULL
#define NULL
Definition: coverity.c:32
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:117
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_acrusher.c:336
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:842
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:126
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:228
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_colorcorrect.c:133
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
colorcorrect_outputs
static const AVFilterPad colorcorrect_outputs[]
Definition: vf_colorcorrect.c:185
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
OFFSET
#define OFFSET(x)
Definition: vf_colorcorrect.c:193