#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.
|
static uint8_t | do_chromakey_pixel (ChromakeyContext *ctx, uint8_t u[9], uint8_t v[9]) |
|
static av_always_inline void | get_pixel_uv (AVFrame *frame, int hsub_log2, int vsub_log2, int x, int y, uint8_t *u, uint8_t *v) |
|
static int | do_chromakey_slice (AVFilterContext *avctx, void *arg, int jobnr, int nb_jobs) |
|
static int | filter_frame (AVFilterLink *link, AVFrame *frame) |
|
static av_cold int | initialize_chromakey (AVFilterContext *avctx) |
|
static av_cold int | query_formats (AVFilterContext *avctx) |
|
static av_cold int | config_input (AVFilterLink *inlink) |
|
| AVFILTER_DEFINE_CLASS (chromakey) |
|
◆ FIXNUM
#define FIXNUM |
( |
|
x | ) |
lrint((x) * (1 << 10)) |
◆ RGB_TO_U
#define RGB_TO_U |
( |
|
rgb | ) |
(((- FIXNUM(0.16874) * rgb[0] - FIXNUM(0.33126) * rgb[1] + FIXNUM(0.50000) * rgb[2] + (1 << 9) - 1) >> 10) + 128) |
◆ RGB_TO_V
#define RGB_TO_V |
( |
|
rgb | ) |
((( FIXNUM(0.50000) * rgb[0] - FIXNUM(0.41869) * rgb[1] - FIXNUM(0.08131) * rgb[2] + (1 << 9) - 1) >> 10) + 128) |
◆ OFFSET
◆ FLAGS
◆ do_chromakey_pixel()
◆ get_pixel_uv()
◆ do_chromakey_slice()
◆ filter_frame()
◆ initialize_chromakey()
◆ query_formats()
◆ config_input()
◆ AVFILTER_DEFINE_CLASS()
AVFILTER_DEFINE_CLASS |
( |
chromakey |
| ) |
|
◆ chromakey_inputs
Initial value:= {
{
.name = "default",
.needs_writable = 1,
},
}
static int filter_frame(AVFilterLink *link, AVFrame *frame)
static av_cold int config_input(AVFilterLink *inlink)
Definition at line 166 of file vf_chromakey.c.
◆ chromakey_outputs
Initial value:= {
{
.name = "default",
},
}
Definition at line 177 of file vf_chromakey.c.
◆ chromakey_options
Initial value:= {
{
"similarity",
"set the chromakey similarity value",
OFFSET(similarity),
AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.01, 1.0, FLAGS },
{
"blend",
"set the chromakey key blend value",
OFFSET(blend),
AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, 0.0, 1.0, FLAGS },
{
"yuv",
"color parameter is in yuv instead of rgb",
OFFSET(is_yuv),
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
}
Definition at line 188 of file vf_chromakey.c.
◆ ff_vf_chromakey
Initial value:= {
.name = "chromakey",
.description =
NULL_IF_CONFIG_SMALL(
"Turns a certain color into transparency. Operates on YUV colors."),
.priv_class = &chromakey_class,
}
static av_cold int init(AVCodecContext *avctx)
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
static const AVFilterPad chromakey_outputs[]
static av_cold int initialize_chromakey(AVFilterContext *avctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
static const AVFilterPad inputs[]
static const AVFilterPad outputs[]
static av_cold int query_formats(AVFilterContext *avctx)
static const AVFilterPad chromakey_inputs[]
Definition at line 198 of file vf_chromakey.c.