FFmpeg
Data Structures | Macros | Functions | Variables
vf_colorchannelmixer.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  ColorChannelMixerContext
 

Macros

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

Functions

 AVFILTER_DEFINE_CLASS (colorchannelmixer)
 
static int query_formats (AVFilterContext *ctx)
 
static av_always_inline int filter_slice_rgba_planar (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs, int have_alpha)
 
static av_always_inline int filter_slice_rgba16_planar (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs, int have_alpha, int depth)
 
static int filter_slice_gbrp (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_slice_gbrap (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_slice_gbrp9 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_slice_gbrp10 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_slice_gbrap10 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_slice_gbrp12 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_slice_gbrap12 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_slice_gbrp14 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_slice_gbrp16 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_slice_gbrap16 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static av_always_inline int filter_slice_rgba_packed (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs, int have_alpha, int step)
 
static av_always_inline int filter_slice_rgba16_packed (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs, int have_alpha, int step)
 
static int filter_slice_rgba64 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_slice_rgb48 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_slice_rgba (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_slice_rgb24 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_slice_rgb0 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int config_output (AVFilterLink *outlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption colorchannelmixer_options []
 
static const AVFilterPad colorchannelmixer_inputs []
 
static const AVFilterPad colorchannelmixer_outputs []
 
AVFilter ff_vf_colorchannelmixer
 

Macro Definition Documentation

◆ R

#define R   0

Definition at line 29 of file vf_colorchannelmixer.c.

◆ G

#define G   1

Definition at line 30 of file vf_colorchannelmixer.c.

◆ B

#define B   2

Definition at line 31 of file vf_colorchannelmixer.c.

◆ A

#define A   3

Definition at line 32 of file vf_colorchannelmixer.c.

◆ OFFSET

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

Definition at line 54 of file vf_colorchannelmixer.c.

◆ FLAGS

Definition at line 55 of file vf_colorchannelmixer.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( colorchannelmixer  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 78 of file vf_colorchannelmixer.c.

◆ filter_slice_rgba_planar()

static av_always_inline int filter_slice_rgba_planar ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs,
int  have_alpha 
)
static

Definition at line 103 of file vf_colorchannelmixer.c.

Referenced by filter_slice_gbrap(), and filter_slice_gbrp().

◆ filter_slice_rgba16_planar()

static av_always_inline int filter_slice_rgba16_planar ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs,
int  have_alpha,
int  depth 
)
static

◆ filter_slice_gbrp()

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

Definition at line 221 of file vf_colorchannelmixer.c.

Referenced by config_output().

◆ filter_slice_gbrap()

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

Definition at line 226 of file vf_colorchannelmixer.c.

Referenced by config_output().

◆ filter_slice_gbrp9()

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

Definition at line 231 of file vf_colorchannelmixer.c.

Referenced by config_output().

◆ filter_slice_gbrp10()

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

Definition at line 236 of file vf_colorchannelmixer.c.

Referenced by config_output().

◆ filter_slice_gbrap10()

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

Definition at line 241 of file vf_colorchannelmixer.c.

Referenced by config_output().

◆ filter_slice_gbrp12()

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

Definition at line 246 of file vf_colorchannelmixer.c.

Referenced by config_output().

◆ filter_slice_gbrap12()

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

Definition at line 251 of file vf_colorchannelmixer.c.

Referenced by config_output().

◆ filter_slice_gbrp14()

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

Definition at line 256 of file vf_colorchannelmixer.c.

Referenced by config_output().

◆ filter_slice_gbrp16()

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

Definition at line 261 of file vf_colorchannelmixer.c.

Referenced by config_output().

◆ filter_slice_gbrap16()

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

Definition at line 266 of file vf_colorchannelmixer.c.

Referenced by config_output().

◆ filter_slice_rgba_packed()

static av_always_inline int filter_slice_rgba_packed ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs,
int  have_alpha,
int  step 
)
static

◆ filter_slice_rgba16_packed()

static av_always_inline int filter_slice_rgba16_packed ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs,
int  have_alpha,
int  step 
)
static

Definition at line 326 of file vf_colorchannelmixer.c.

Referenced by filter_slice_rgb48(), and filter_slice_rgba64().

◆ filter_slice_rgba64()

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

Definition at line 380 of file vf_colorchannelmixer.c.

Referenced by config_output().

◆ filter_slice_rgb48()

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

Definition at line 385 of file vf_colorchannelmixer.c.

Referenced by config_output().

◆ filter_slice_rgba()

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

Definition at line 390 of file vf_colorchannelmixer.c.

Referenced by config_output().

◆ filter_slice_rgb24()

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

Definition at line 395 of file vf_colorchannelmixer.c.

Referenced by config_output().

◆ filter_slice_rgb0()

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

Definition at line 400 of file vf_colorchannelmixer.c.

Referenced by config_output().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 405 of file vf_colorchannelmixer.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 506 of file vf_colorchannelmixer.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 534 of file vf_colorchannelmixer.c.

Variable Documentation

◆ colorchannelmixer_options

const AVOption colorchannelmixer_options[]
static
Initial value:
= {
{ "rr", "set the red gain for the red channel", OFFSET(rr), AV_OPT_TYPE_DOUBLE, {.dbl=1}, -2, 2, FLAGS },
{ "rg", "set the green gain for the red channel", OFFSET(rg), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -2, 2, FLAGS },
{ "rb", "set the blue gain for the red channel", OFFSET(rb), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -2, 2, FLAGS },
{ "ra", "set the alpha gain for the red channel", OFFSET(ra), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -2, 2, FLAGS },
{ "gr", "set the red gain for the green channel", OFFSET(gr), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -2, 2, FLAGS },
{ "gg", "set the green gain for the green channel", OFFSET(gg), AV_OPT_TYPE_DOUBLE, {.dbl=1}, -2, 2, FLAGS },
{ "gb", "set the blue gain for the green channel", OFFSET(gb), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -2, 2, FLAGS },
{ "ga", "set the alpha gain for the green channel", OFFSET(ga), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -2, 2, FLAGS },
{ "br", "set the red gain for the blue channel", OFFSET(br), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -2, 2, FLAGS },
{ "bg", "set the green gain for the blue channel", OFFSET(bg), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -2, 2, FLAGS },
{ "bb", "set the blue gain for the blue channel", OFFSET(bb), AV_OPT_TYPE_DOUBLE, {.dbl=1}, -2, 2, FLAGS },
{ "ba", "set the alpha gain for the blue channel", OFFSET(ba), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -2, 2, FLAGS },
{ "ar", "set the red gain for the alpha channel", OFFSET(ar), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -2, 2, FLAGS },
{ "ag", "set the green gain for the alpha channel", OFFSET(ag), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -2, 2, FLAGS },
{ "ab", "set the blue gain for the alpha channel", OFFSET(ab), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -2, 2, FLAGS },
{ "aa", "set the alpha gain for the alpha channel", OFFSET(aa), AV_OPT_TYPE_DOUBLE, {.dbl=1}, -2, 2, FLAGS },
{ NULL }
}

Definition at line 56 of file vf_colorchannelmixer.c.

◆ colorchannelmixer_inputs

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

Definition at line 541 of file vf_colorchannelmixer.c.

◆ colorchannelmixer_outputs

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

Definition at line 550 of file vf_colorchannelmixer.c.

◆ ff_vf_colorchannelmixer

AVFilter ff_vf_colorchannelmixer
Initial value:
= {
.name = "colorchannelmixer",
.description = NULL_IF_CONFIG_SMALL("Adjust colors by mixing color channels."),
.priv_size = sizeof(ColorChannelMixerContext),
.priv_class = &colorchannelmixer_class,
}

Definition at line 559 of file vf_colorchannelmixer.c.

query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_colorchannelmixer.c:78
ra
#define ra
Definition: regdef.h:57
FLAGS
#define FLAGS
Definition: vf_colorchannelmixer.c:55
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:225
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
ColorChannelMixerContext
Definition: vf_colorchannelmixer.c:38
colorchannelmixer_outputs
static const AVFilterPad colorchannelmixer_outputs[]
Definition: vf_colorchannelmixer.c:550
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
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
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_colorchannelmixer.c:506
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_colorchannelmixer.c:534
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_colorchannelmixer.c:405
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
OFFSET
#define OFFSET(x)
Definition: vf_colorchannelmixer.c:54
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:565
colorchannelmixer_inputs
static const AVFilterPad colorchannelmixer_inputs[]
Definition: vf_colorchannelmixer.c:541