Go to the source code of this file.
|
#define | MAIN 0 |
|
#define | OVERLAY 1 |
|
#define | R 0 |
|
#define | G 1 |
|
#define | B 2 |
|
#define | A 3 |
|
#define | Y 0 |
|
#define | U 1 |
|
#define | V 2 |
|
#define | FAST_DIV255(x) ((((x) + 128) * 257) >> 16) |
|
#define | UNPREMULTIPLY_ALPHA(x, y) ((((x) << 16) - ((x) << 9) + (x)) / ((((x) + (y)) << 8) - ((x) + (y)) - (y) * (x))) |
|
#define | DEFINE_BLEND_PLANE(depth, nbits) |
|
#define | DEFINE_ALPHA_COMPOSITE(depth, nbits) |
|
#define | DEFINE_BLEND_SLICE_YUV(depth, nbits) |
|
#define | DEFINE_BLEND_SLICE_PLANAR_FMT(format_, blend_slice_fn_suffix_, hsub_, vsub_, main_has_alpha_, direct_) |
|
#define | DEFINE_BLEND_SLICE_PACKED_FMT(format_, blend_slice_fn_suffix_, main_has_alpha_, direct_) |
|
#define | OFFSET(x) offsetof(OverlayContext, x) |
|
#define | FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM |
|
#define | TFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM |
|
|
enum | EvalMode {
EVAL_MODE_ONCE,
EVAL_MODE_FRAME,
EVAL_MODE_NB,
EVAL_MODE_INIT,
EVAL_MODE_FRAME,
EVAL_MODE_NB,
EVAL_MODE_INIT,
EVAL_MODE_FRAME,
EVAL_MODE_NB,
EVAL_MODE_INIT,
EVAL_MODE_FRAME,
EVAL_MODE_NB,
EVAL_MODE_INIT,
EVAL_MODE_FRAME,
EVAL_MODE_NB,
EVAL_MODE_INIT,
EVAL_MODE_FRAME,
EVAL_MODE_NB,
EVAL_MODE_INIT,
EVAL_MODE_FRAME,
EVAL_MODE_NB,
EVAL_MODE_INIT,
EVAL_MODE_FRAME,
EVAL_MODE_NB,
EVAL_MODE_INIT,
EVAL_MODE_FRAME,
EVAL_MODE_NB
} |
|
|
static av_cold void | uninit (AVFilterContext *ctx) |
|
static int | normalize_xy (double d, int chroma_sub) |
|
static void | eval_expr (AVFilterContext *ctx) |
|
static int | set_expr (AVExpr **pexpr, const char *expr, const char *option, void *log_ctx) |
|
static int | process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags) |
|
static int | query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out) |
|
static int | config_input_overlay (AVFilterLink *inlink) |
|
static int | config_output (AVFilterLink *outlink) |
|
static av_always_inline void | blend_slice_packed_rgb (AVFilterContext *ctx, AVFrame *dst, const AVFrame *src, int main_has_alpha, int x, int y, int is_straight, int jobnr, int nb_jobs) |
| Blend image in src to destination buffer dst at position (x, y). More...
|
|
static av_always_inline void | blend_slice_planar_rgb (AVFilterContext *ctx, AVFrame *dst, const AVFrame *src, int hsub, int vsub, int main_has_alpha, int x, int y, int is_straight, int jobnr, int nb_jobs) |
|
static int | config_input_main (AVFilterLink *inlink) |
|
static int | do_blend (FFFrameSync *fs) |
|
static av_cold int | init (AVFilterContext *ctx) |
|
static int | activate (AVFilterContext *ctx) |
|
| FRAMESYNC_DEFINE_CLASS (overlay, OverlayContext, fs) |
|
overlay one video on top of another
Definition in file vf_overlay.c.
◆ MAIN
◆ OVERLAY
◆ FAST_DIV255
#define FAST_DIV255 |
( |
|
x | ) |
((((x) + 128) * 257) >> 16) |
◆ UNPREMULTIPLY_ALPHA
#define UNPREMULTIPLY_ALPHA |
( |
|
x, |
|
|
|
y |
|
) |
| ((((x) << 16) - ((x) << 9) + (x)) / ((((x) + (y)) << 8) - ((x) + (y)) - (y) * (x))) |
◆ DEFINE_BLEND_PLANE
#define DEFINE_BLEND_PLANE |
( |
|
depth, |
|
|
|
nbits |
|
) |
| |
◆ DEFINE_ALPHA_COMPOSITE
#define DEFINE_ALPHA_COMPOSITE |
( |
|
depth, |
|
|
|
nbits |
|
) |
| |
◆ DEFINE_BLEND_SLICE_YUV
#define DEFINE_BLEND_SLICE_YUV |
( |
|
depth, |
|
|
|
nbits |
|
) |
| |
Value:
int main_has_alpha, \
int x, int y, \
int is_straight, \
int jobnr, int nb_jobs) \
{ \
OverlayContext *
s =
ctx->priv; \
const
int src_w =
src->width; \
const
int src_h =
src->height; \
const
int dst_w =
dst->width; \
const
int dst_h =
dst->height; \
\
blend_plane_##depth##
_##nbits##
bits(
ctx,
dst,
src, src_w, src_h, dst_w, dst_h, 0, 0, 0, \
x, y, main_has_alpha,
s->main_desc->comp[0].plane,
s->main_desc->comp[0].offset, \
s->main_desc->comp[0].step, is_straight, 1, jobnr, nb_jobs); \
blend_plane_##depth##
_##nbits##
bits(
ctx,
dst,
src, src_w, src_h, dst_w, dst_h, 1,
hsub, vsub, \
x, y, main_has_alpha,
s->main_desc->comp[1].plane,
s->main_desc->comp[1].offset, \
s->main_desc->comp[1].step, is_straight, 1, jobnr, nb_jobs); \
blend_plane_##depth##
_##nbits##
bits(
ctx,
dst,
src, src_w, src_h, dst_w, dst_h, 2,
hsub, vsub, \
x, y, main_has_alpha,
s->main_desc->comp[2].plane,
s->main_desc->comp[2].offset, \
s->main_desc->comp[2].step, is_straight, 1, jobnr, nb_jobs);
\
alpha_composite_##depth##
_##nbits##
bits(
src,
dst, src_w, src_h, dst_w, dst_h, x, y, \
jobnr, nb_jobs); \
}
Definition at line 634 of file vf_overlay.c.
◆ DEFINE_BLEND_SLICE_PLANAR_FMT
#define DEFINE_BLEND_SLICE_PLANAR_FMT |
( |
|
format_, |
|
|
|
blend_slice_fn_suffix_, |
|
|
|
hsub_, |
|
|
|
vsub_, |
|
|
|
main_has_alpha_, |
|
|
|
direct_ |
|
) |
| |
Value:
{ \
OverlayContext *
s =
ctx->priv; \
blend_slice_##blend_slice_fn_suffix_(
ctx, td->dst, td->src, \
hsub_, vsub_, main_has_alpha_, \
jobnr, nb_jobs); \
return 0; \
}
Definition at line 695 of file vf_overlay.c.
◆ DEFINE_BLEND_SLICE_PACKED_FMT
#define DEFINE_BLEND_SLICE_PACKED_FMT |
( |
|
format_, |
|
|
|
blend_slice_fn_suffix_, |
|
|
|
main_has_alpha_, |
|
|
|
direct_ |
|
) |
| |
Value:
{ \
OverlayContext *
s =
ctx->priv; \
blend_slice_packed_##blend_slice_fn_suffix_(
ctx, td->dst, td->src, \
main_has_alpha_, \
jobnr, nb_jobs); \
return 0; \
}
Definition at line 731 of file vf_overlay.c.
◆ OFFSET
◆ FLAGS
◆ TFLAGS
◆ EvalMode
Enumerator |
---|
EVAL_MODE_ONCE | |
EVAL_MODE_FRAME | |
EVAL_MODE_NB | |
EVAL_MODE_INIT | |
EVAL_MODE_FRAME | |
EVAL_MODE_NB | |
EVAL_MODE_INIT | |
EVAL_MODE_FRAME | |
EVAL_MODE_NB | |
EVAL_MODE_INIT | |
EVAL_MODE_FRAME | |
EVAL_MODE_NB | |
EVAL_MODE_INIT | |
EVAL_MODE_FRAME | |
EVAL_MODE_NB | |
EVAL_MODE_INIT | |
EVAL_MODE_FRAME | |
EVAL_MODE_NB | |
EVAL_MODE_INIT | |
EVAL_MODE_FRAME | |
EVAL_MODE_NB | |
EVAL_MODE_INIT | |
EVAL_MODE_FRAME | |
EVAL_MODE_NB | |
EVAL_MODE_INIT | |
EVAL_MODE_FRAME | |
EVAL_MODE_NB | |
Definition at line 77 of file vf_overlay.c.
◆ uninit()
◆ normalize_xy()
static int normalize_xy |
( |
double |
d, |
|
|
int |
chroma_sub |
|
) |
| |
|
inlinestatic |
◆ eval_expr()
◆ set_expr()
static int set_expr |
( |
AVExpr ** |
pexpr, |
|
|
const char * |
expr, |
|
|
const char * |
option, |
|
|
void * |
log_ctx |
|
) |
| |
|
static |
◆ process_command()
static int process_command |
( |
AVFilterContext * |
ctx, |
|
|
const char * |
cmd, |
|
|
const char * |
args, |
|
|
char * |
res, |
|
|
int |
res_len, |
|
|
int |
flags |
|
) |
| |
|
static |
◆ query_formats()
◆ config_input_overlay()
◆ config_output()
◆ blend_slice_packed_rgb()
Blend image in src to destination buffer dst at position (x, y).
< the amount of overlay to blend on to main
Definition at line 366 of file vf_overlay.c.
◆ blend_slice_planar_rgb()
static av_always_inline void blend_slice_planar_rgb |
( |
AVFilterContext * |
ctx, |
|
|
AVFrame * |
dst, |
|
|
const AVFrame * |
src, |
|
|
int |
hsub, |
|
|
int |
vsub, |
|
|
int |
main_has_alpha, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
is_straight, |
|
|
int |
jobnr, |
|
|
int |
nb_jobs |
|
) |
| |
|
static |
◆ config_input_main()
◆ do_blend()
◆ init()
◆ activate()
◆ FRAMESYNC_DEFINE_CLASS()
◆ var_names
const char* const var_names[] |
|
static |
Initial value:= {
"main_w", "W",
"main_h", "H",
"overlay_w", "w",
"overlay_h", "h",
"hsub",
"vsub",
"x",
"y",
"n",
"t",
}
Definition at line 48 of file vf_overlay.c.
Referenced by set_expr().
◆ alpha_pix_fmts
◆ overlay_options
Initial value:= {
{ "eof_action", "Action to take when encountering EOF from secondary input ",
}
Definition at line 951 of file vf_overlay.c.
◆ avfilter_vf_overlay_inputs
Initial value:= {
{
.name = "main",
},
{
.name = "overlay",
},
}
Definition at line 983 of file vf_overlay.c.
◆ avfilter_vf_overlay_outputs
Initial value:= {
{
.name = "default",
},
}
Definition at line 996 of file vf_overlay.c.
◆ ff_vf_overlay
Initial value:= {
.p.name = "overlay",
.p.priv_class = &overlay_class,
.preinit = overlay_framesync_preinit,
}
Definition at line 1004 of file vf_overlay.c.
static const AVFilterPad avfilter_vf_overlay_outputs[]
#define FILTER_INPUTS(array)
This structure describes decoded (raw) audio or video data.
#define AV_PIX_FMT_YUVA420P10
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
#define AV_PIX_FMT_YUVA422P10
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
@ OVERLAY_FORMAT_YUV422P10
static int config_input_main(AVFilterLink *inlink)
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
#define FILTER_OUTPUTS(array)
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
static int config_input_overlay(AVFilterLink *inlink)
#define fs(width, name, subs,...)
static av_cold void uninit(AVFilterContext *ctx)
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
static const AVFilterPad avfilter_vf_overlay_inputs[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
@ OVERLAY_FORMAT_YUV420P10
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static int config_output(AVFilterLink *outlink)
@ OVERLAY_FORMAT_YUV444P10
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
#define AV_PIX_FMT_YUVA444P10
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
#define FILTER_QUERY_FUNC2(func)
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
@ AV_OPT_TYPE_INT
Underlying C type is int.
static int activate(AVFilterContext *ctx)
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
static av_cold int init(AVFilterContext *ctx)