93 return (
int)d & ~((1 << chroma_sub) - 1);
119 "Error when evaluating the expression '%s' for %s\n",
130 char *res,
int res_len,
int flags)
135 if (!strcmp(cmd,
"x"))
137 else if (!strcmp(cmd,
"y"))
173 static const enum AVPixelFormat overlay_pix_fmts_yuv420[] = {
177 static const enum AVPixelFormat main_pix_fmts_yuv420p10[] = {
181 static const enum AVPixelFormat overlay_pix_fmts_yuv420p10[] = {
188 static const enum AVPixelFormat overlay_pix_fmts_yuv422[] = {
192 static const enum AVPixelFormat main_pix_fmts_yuv422p10[] = {
195 static const enum AVPixelFormat overlay_pix_fmts_yuv422p10[] = {
202 static const enum AVPixelFormat overlay_pix_fmts_yuv444[] = {
206 static const enum AVPixelFormat main_pix_fmts_yuv444p10[] = {
209 static const enum AVPixelFormat overlay_pix_fmts_yuv444p10[] = {
245 main_formats = main_pix_fmts_yuv420;
246 overlay_formats = overlay_pix_fmts_yuv420;
249 main_formats = main_pix_fmts_yuv420p10;
250 overlay_formats = overlay_pix_fmts_yuv420p10;
253 main_formats = main_pix_fmts_yuv422;
254 overlay_formats = overlay_pix_fmts_yuv422;
257 main_formats = main_pix_fmts_yuv422p10;
258 overlay_formats = overlay_pix_fmts_yuv422p10;
261 main_formats = main_pix_fmts_yuv444;
262 overlay_formats = overlay_pix_fmts_yuv444;
265 main_formats = main_pix_fmts_yuv444p10;
266 overlay_formats = overlay_pix_fmts_yuv444p10;
269 main_formats = main_pix_fmts_rgb;
270 overlay_formats = overlay_pix_fmts_rgb;
273 main_formats = main_pix_fmts_gbrp;
274 overlay_formats = overlay_pix_fmts_gbrp;
313 if ((ret =
set_expr(&
s->x_pexpr,
s->x_expr,
"x",
ctx)) < 0 ||
317 s->overlay_is_packed_rgb =
329 "main w:%d h:%d fmt:%s overlay w:%d h:%d fmt:%s\n",
355#define FAST_DIV255(x) ((((x) + 128) * 257) >> 16)
362#define UNPREMULTIPLY_ALPHA(x, y) ((((x) << 16) - ((x) << 9) + (x)) / ((((x) + (y)) << 8) - ((x) + (y)) - (y) * (x)))
364#define PTR_ADD(TYPE, ptr, byte_addend) ((TYPE*)((uint8_t*)ptr + (byte_addend)))
365#define CPTR_ADD(TYPE, ptr, byte_addend) ((const TYPE*)((const uint8_t*)ptr + (byte_addend)))
373 int main_has_alpha,
int x,
int y,
374 int overlay_straight,
int main_straight,
375 int jobnr,
int nb_jobs)
378 int i,
imax, j, jmax;
379 const int src_w =
src->width;
380 const int src_h =
src->height;
381 const int dst_w =
dst->width;
382 const int dst_h =
dst->height;
384 const int dr =
s->main_rgba_map[
R];
385 const int dg =
s->main_rgba_map[
G];
386 const int db =
s->main_rgba_map[
B];
387 const int da =
s->main_rgba_map[
A];
388 const int dstep =
s->main_pix_step[0];
389 const int sr =
s->overlay_rgba_map[
R];
390 const int sg =
s->overlay_rgba_map[
G];
391 const int sb =
s->overlay_rgba_map[
B];
392 const int sa =
s->overlay_rgba_map[
A];
393 const int sstep =
s->overlay_pix_step[0];
395 uint8_t *
S, *sp, *d, *dp;
409 d = dp + (x+j) * dstep;
411 for (jmax =
FFMIN(-x + dst_w, src_w); j < jmax; j++) {
416 if (main_straight &&
alpha != 0 &&
alpha != 255) {
417 uint8_t alpha_d = d[da];
439 if (main_has_alpha) {
454 dp +=
dst->linesize[0];
455 sp +=
src->linesize[0];
459#define DEFINE_BLEND_PLANE(depth, T, nbits) \
460static av_always_inline void blend_plane_##depth##_##nbits##bits(AVFilterContext *ctx, \
461 AVFrame *dst, const AVFrame *src, \
462 int src_w, int src_h, \
463 int dst_w, int dst_h, \
464 int i, int hsub, int vsub, \
470 int overlay_straight, \
475 OverlayContext *octx = ctx->priv; \
476 int src_wp = AV_CEIL_RSHIFT(src_w, hsub); \
477 int src_hp = AV_CEIL_RSHIFT(src_h, vsub); \
478 int dst_wp = AV_CEIL_RSHIFT(dst_w, hsub); \
479 int dst_hp = AV_CEIL_RSHIFT(dst_h, vsub); \
482 const T max = (1 << nbits) - 1; \
483 const T mid = (1 << (nbits - 1)); \
485 const int jmin = FFMAX(-yp, 0), jmax = FFMIN3(-yp + dst_hp, FFMIN(src_hp, dst_hp), yp + src_hp); \
486 const int kmin = FFMAX(-xp, 0), kmax = FFMIN(-xp + dst_wp, src_wp); \
487 const int slice_start = jmin + ff_slice_pos(jmax, jobnr, nb_jobs); \
488 const int slice_end = jmin + ff_slice_pos(jmax, jobnr + 1, nb_jobs); \
490 const uint8_t *sp = src->data[i] + (slice_start) * src->linesize[i]; \
491 uint8_t *dp = dst->data[dst_plane] \
492 + (yp + slice_start) * dst->linesize[dst_plane] \
494 const uint8_t *ap = src->data[3] + (slice_start << vsub) * src->linesize[3]; \
495 const uint8_t *dap = main_straight ? dst->data[3] + ((yp + slice_start) << vsub) * dst->linesize[3] : NULL; \
497 for (int j = slice_start; j < slice_end; ++j) { \
499 const T *s = (const T *)sp + k; \
500 const T *a = (const T *)ap + (k << hsub); \
501 const T *da = main_straight ? (T *)dap + ((xp + k) << hsub) : NULL; \
502 T *d = (T *)(dp + (xp + k) * dst_step); \
504 if (nbits == 8 && ((vsub && j+1 < src_hp) || !vsub) && octx->blend_row[i]) { \
505 int c = octx->blend_row[i]((uint8_t*)d, (uint8_t*)da, (uint8_t*)s, \
506 (uint8_t*)a, kmax - k, src->linesize[3]); \
509 d = PTR_ADD(T, d, dst_step * c); \
511 da += (1 << hsub) * c; \
512 a += (1 << hsub) * c; \
515 for (; k < kmax; k++) { \
516 int alpha_v, alpha_h, alpha; \
519 if (hsub && vsub && j+1 < src_hp && k+1 < src_wp) { \
520 const T *next_line = CPTR_ADD(T, a, src->linesize[3]); \
521 alpha = (a[0] + next_line[0] + \
522 a[1] + next_line[1]) >> 2; \
523 } else if (hsub || vsub) { \
524 alpha_h = hsub && k+1 < src_wp ? \
525 (a[0] + a[1]) >> 1 : a[0]; \
526 alpha_v = vsub && j+1 < src_hp ? \
527 (a[0] + *CPTR_ADD(T, a, src->linesize[3])) >> 1 : a[0]; \
528 alpha = (alpha_v + alpha_h) >> 1; \
533 if (main_straight && alpha != 0 && alpha != max) { \
536 if (hsub && vsub && j+1 < src_hp && k+1 < src_wp) { \
537 const T *next_line = CPTR_ADD(T, da, dst->linesize[3]); \
538 alpha_d = (da[0] + next_line[0] + \
539 da[1] + next_line[1]) >> 2; \
540 } else if (hsub || vsub) { \
541 alpha_h = hsub && k+1 < src_wp ? \
542 (da[0] + da[1]) >> 1 : da[0]; \
543 alpha_v = vsub && j+1 < src_hp ? \
544 (da[0] + *CPTR_ADD(T, da, dst->linesize[3])) >> 1 : da[0]; \
545 alpha_d = (alpha_v + alpha_h) >> 1; \
548 alpha = UNPREMULTIPLY_ALPHA(alpha, alpha_d); \
550 if (overlay_straight) { \
552 *d = (*d * (max - alpha) + *s * alpha) / max; \
554 *d = FAST_DIV255(*d * (255 - alpha) + *s * alpha); \
558 *d = av_clip((*d * (max - alpha) + *s * alpha) / max + *s - mid, -mid, mid) + mid; \
560 *d = av_clip_uintp2((*d * (max - alpha) + *s * alpha) / max + *s - (16<<(nbits-8)),\
564 *d = av_clip(FAST_DIV255((*d - mid) * (max - alpha)) + *s - mid, -mid, mid) + mid; \
566 *d = av_clip_uint8(FAST_DIV255(*d * (255 - alpha)) + *s - 16); \
570 d = PTR_ADD(T, d, dst_step); \
575 dp += dst->linesize[dst_plane]; \
576 sp += src->linesize[i]; \
577 ap += (1 << vsub) * src->linesize[3]; \
579 dap += (1 << vsub) * dst->linesize[3]; \
585#define DEFINE_ALPHA_COMPOSITE(depth, T, nbits) \
586static inline void alpha_composite_##depth##_##nbits##bits(const AVFrame *src, const AVFrame *dst, \
587 int src_w, int src_h, \
588 int dst_w, int dst_h, \
589 int x, int y, int main_straight, \
590 int jobnr, int nb_jobs) \
593 const T max = (1 << nbits) - 1; \
595 const int imin = FFMAX(-y, 0), imax = FFMIN3(-y + dst_h, FFMIN(src_h, dst_h), y + src_h); \
596 const int jmin = FFMAX(-x, 0), jmax = FFMIN(-x + dst_w, src_w); \
597 const int slice_start = imin + ff_slice_pos(imax, jobnr, nb_jobs); \
598 const int slice_end = imin + (ff_slice_pos(imax, jobnr + 1, nb_jobs)); \
600 const uint8_t *sa = src->data[3] + (slice_start) * src->linesize[3]; \
601 uint8_t *da = dst->data[3] + (y + slice_start) * dst->linesize[3]; \
603 for (int i = slice_start; i < slice_end; ++i) { \
604 const T *s = (const T *)sa + jmin; \
605 T *d = (T *)da + x + jmin; \
607 for (int j = jmin; j < jmax; ++j) { \
609 if (main_straight && alpha != 0 && alpha != max) { \
610 uint8_t alpha_d = *d; \
611 alpha = UNPREMULTIPLY_ALPHA(alpha, alpha_d); \
615 else if (alpha > 0) { \
618 *d += (max - *d) * *s / max; \
620 *d += FAST_DIV255((max - *d) * *s); \
625 da += dst->linesize[3]; \
626 sa += src->linesize[3]; \
632#define DEFINE_BLEND_SLICE_YUV(depth, nbits) \
633static av_always_inline void blend_slice_yuv_##depth##_##nbits##bits(AVFilterContext *ctx, \
634 AVFrame *dst, const AVFrame *src, \
635 int hsub, int vsub, \
638 int overlay_straight, \
639 int jobnr, int nb_jobs) \
641 OverlayContext *s = ctx->priv; \
642 const int src_w = src->width; \
643 const int src_h = src->height; \
644 const int dst_w = dst->width; \
645 const int dst_h = dst->height; \
647 blend_plane_##depth##_##nbits##bits(ctx, dst, src, src_w, src_h, dst_w, dst_h, 0, 0, 0, \
648 x, y, main_straight, s->main_desc->comp[0].plane, s->main_desc->comp[0].offset, \
649 s->main_desc->comp[0].step, overlay_straight, 1, jobnr, nb_jobs); \
650 blend_plane_##depth##_##nbits##bits(ctx, dst, src, src_w, src_h, dst_w, dst_h, 1, hsub, vsub, \
651 x, y, main_straight, s->main_desc->comp[1].plane, s->main_desc->comp[1].offset, \
652 s->main_desc->comp[1].step, overlay_straight, 1, jobnr, nb_jobs); \
653 blend_plane_##depth##_##nbits##bits(ctx, dst, src, src_w, src_h, dst_w, dst_h, 2, hsub, vsub, \
654 x, y, main_straight, s->main_desc->comp[2].plane, s->main_desc->comp[2].offset, \
655 s->main_desc->comp[2].step, overlay_straight, 1, jobnr, nb_jobs); \
657 if (s->main_has_alpha) \
658 alpha_composite_##depth##_##nbits##bits(src, dst, src_w, src_h, dst_w, dst_h, x, y, main_straight, \
669 int overlay_straight,
674 const int src_w =
src->width;
675 const int src_h =
src->height;
676 const int dst_w =
dst->width;
677 const int dst_h =
dst->height;
679 blend_plane_8_8bits(
ctx,
dst,
src, src_w, src_h, dst_w, dst_h, 0, 0, 0, x, y, main_straight,
680 s->main_desc->comp[1].plane,
s->main_desc->comp[1].offset,
s->main_desc->comp[1].step, overlay_straight, 0,
682 blend_plane_8_8bits(
ctx,
dst,
src, src_w, src_h, dst_w, dst_h, 1,
hsub, vsub, x, y, main_straight,
683 s->main_desc->comp[2].plane,
s->main_desc->comp[2].offset,
s->main_desc->comp[2].step, overlay_straight, 0,
685 blend_plane_8_8bits(
ctx,
dst,
src, src_w, src_h, dst_w, dst_h, 2,
hsub, vsub, x, y, main_straight,
686 s->main_desc->comp[0].plane,
s->main_desc->comp[0].offset,
s->main_desc->comp[0].step, overlay_straight, 0,
689 if (
s->main_has_alpha)
690 alpha_composite_8_8bits(
src,
dst, src_w, src_h, dst_w, dst_h, x, y, main_straight, jobnr, nb_jobs);
693#define DEFINE_BLEND_SLICE_PLANAR_FMT_(format_, blend_slice_fn_suffix_, hsub_, vsub_, main_straight_, overlay_straight_) \
694static int blend_slice_##format_(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) \
696 OverlayContext *s = ctx->priv; \
697 ThreadData *td = arg; \
698 blend_slice_##blend_slice_fn_suffix_(ctx, td->dst, td->src, \
699 hsub_, vsub_, main_straight_, \
700 s->x, s->y, overlay_straight_, \
705#define DEFINE_BLEND_SLICE_PLANAR_FMT(format_, blend_slice_fn_suffix_, hsub_, vsub_) \
706DEFINE_BLEND_SLICE_PLANAR_FMT_(format_ ## _ss, blend_slice_fn_suffix_, hsub_, vsub_, 1, 1) \
707DEFINE_BLEND_SLICE_PLANAR_FMT_(format_ ## _sp, blend_slice_fn_suffix_, hsub_, vsub_, 1, 0) \
708DEFINE_BLEND_SLICE_PLANAR_FMT_(format_ ## _ps, blend_slice_fn_suffix_, hsub_, vsub_, 0, 1) \
709DEFINE_BLEND_SLICE_PLANAR_FMT_(format_ ## _pp, blend_slice_fn_suffix_, hsub_, vsub_, 0, 0)
720#define DEFINE_BLEND_SLICE_PACKED_FMT(format_, blend_slice_fn_suffix_, main_has_alpha_, main_straight_, overlay_straight_) \
721static int blend_slice_##format_(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) \
723 OverlayContext *s = ctx->priv; \
724 ThreadData *td = arg; \
725 blend_slice_packed_##blend_slice_fn_suffix_(ctx, td->dst, td->src, \
752 s->main_desc = pix_desc;
754 s->main_is_packed_rgb =
768 #define ASSIGN_BLEND_SLICE(format_) \
770 s->blend_slice = main_straight ? (overlay_straight ? format_##_ss : format_##_sp) \
771 : (overlay_straight ? format_##_ps : format_##_pp); \
794 if (
s->main_has_alpha)
797 s->blend_slice = overlay_straight ? blend_slice_rgb : blend_slice_rgb_pm;
803 switch (
main->format) {
838#if ARCH_X86 && HAVE_X86ASM
878 if (
s->x < mainpic->
width &&
s->x + second->
width >= 0 &&
906#define OFFSET(x) offsetof(OverlayContext, x)
907#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
908#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
913 {
"eof_action",
"Action to take when encountering EOF from secondary input ",
922 {
"shortest",
"force termination when the shortest input terminates",
OFFSET(
fs.opt_shortest),
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1,
FLAGS },
968 .p.priv_class = &overlay_class,
971 .preinit = overlay_framesync_preinit,
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
static const char *const format[]
static int set_expr(AVExpr **pexpr, const char *expr, void *log_ctx)
const FFFilter ff_vf_overlay
#define av_unreachable(msg)
Asserts that are used as compiler optimization hints depending upon ASSERT_LEVEL and NBDEBUG.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Main libavfilter public API header.
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
#define fs(width, name, subs,...)
common internal and external API header
int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
int(* init)(AVBSFContext *ctx)
void av_expr_free(AVExpr *e)
Free a parsed expression previously created with av_expr_parse().
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
Evaluate a previously parsed expression.
int av_expr_parse(AVExpr **expr, const char *s, const char *const *const_names, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), int log_offset, void *log_ctx)
Parse an expression.
simple arithmetic expression evaluator
int ff_framesync_configure(FFFrameSync *fs)
Configure a frame sync structure.
int ff_framesync_activate(FFFrameSync *fs)
Examine the frames in the filter's input and try to produce output.
int ff_framesync_init_dualinput(FFFrameSync *fs, AVFilterContext *parent)
Initialize a frame sync structure for dualinput.
void ff_framesync_uninit(FFFrameSync *fs)
Free all memory currently allocated.
int ff_framesync_dualinput_get_writable(FFFrameSync *fs, AVFrame **f0, AVFrame **f1)
Same as ff_framesync_dualinput_get(), but make sure that f0 is writable.
#define FRAMESYNC_DEFINE_CLASS(name, context, field)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
@ 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...
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_VERBOSE
Detailed information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], const AVPixFmtDescriptor *pixdesc)
Compute the max pixel step for each plane of an image with a format described by pixdesc.
#define AV_NOPTS_VALUE
Undefined timestamp value.
static const int16_t alpha[]
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int activate(AVBitStreamFilterContext *ctx)
static int config_output(AVBitStreamFilterLink *outlink)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
static int ff_slice_pos(int total, int jobnr, int nb_jobs)
Compute the boundary index for a slice when work of size total is split into nb_jobs slices.
int ff_pixfmt_is_in(enum AVPixelFormat fmt, const enum AVPixelFormat *fmts)
Tell if a pixel format is contained in the provided AV_PIX_FMT_NONE-terminated list.
static FilterLink * ff_filter_link(AVFilterLink *link)
#define FILTER_QUERY_FUNC2(func)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int slice_end(AVCodecContext *avctx, AVFrame *pict, int *got_output)
Handle slice ends.
static const char *const var_names[]
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUVA420P10
@ AVALPHA_MODE_NB
Not part of ABI.
@ AVALPHA_MODE_STRAIGHT
Alpha channel is independent of color values.
@ AVALPHA_MODE_UNSPECIFIED
Unknown alpha handling, or no alpha channel.
@ AVALPHA_MODE_PREMULTIPLIED
Alpha channel is multiplied into color values.
#define AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUVA422P10
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_NV21
as above, but U and V bytes are swapped
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
#define AV_PIX_FMT_YUV444P10
void * priv
private data for use by the filter
A link between two filters.
int w
agreed upon image width
int h
agreed upon image height
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
enum AVAlphaMode alpha_mode
alpha mode (for videos with an alpha channel)
AVFilterContext * dst
dest filter
int format
agreed upon media format
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Link properties exposed to filter code, but not external callers.
Used for passing data between threads.
static int imax(const int a, const int b)
static AVFormatContext * ctx
timestamp utils, mostly useful for debugging/logging purposes
static int config_input_main(AVFilterLink *inlink)
static const AVOption overlay_options[]
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 overlay_straight, int main_straight, int jobnr, int nb_jobs)
Blend image in src to destination buffer dst at position (x, y).
#define ASSIGN_BLEND_SLICE(format_)
#define DEFINE_BLEND_SLICE_YUV(depth, nbits)
#define DEFINE_BLEND_SLICE_PACKED_FMT(format_, blend_slice_fn_suffix_, main_has_alpha_, main_straight_, overlay_straight_)
static int config_input_overlay(AVFilterLink *inlink)
#define DEFINE_ALPHA_COMPOSITE(depth, T, nbits)
#define UNPREMULTIPLY_ALPHA(x, y)
#define DEFINE_BLEND_SLICE_PLANAR_FMT(format_, blend_slice_fn_suffix_, hsub_, vsub_)
static int do_blend(FFFrameSync *fs)
static av_always_inline void blend_slice_planar_rgb(AVFilterContext *ctx, AVFrame *dst, const AVFrame *src, int hsub, int vsub, int main_straight, int x, int y, int overlay_straight, int jobnr, int nb_jobs)
#define DEFINE_BLEND_PLANE(depth, T, nbits)
static const AVFilterPad avfilter_vf_overlay_inputs[]
static int set_expr(AVExpr **pexpr, const char *expr, const char *option, void *log_ctx)
static enum AVPixelFormat alpha_pix_fmts[]
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
static int activate(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)
static const AVFilterPad avfilter_vf_overlay_outputs[]
static int config_output(AVFilterLink *outlink)
static int init_slice_fn(AVFilterContext *ctx)
static void eval_expr(AVFilterContext *ctx)
static int normalize_xy(double d, int chroma_sub)
void ff_overlay_init_x86(AVFilterContext *ctx)
@ OVERLAY_FORMAT_YUV420P10
@ OVERLAY_FORMAT_YUV422P10
@ OVERLAY_FORMAT_YUV444P10
static int slice_start(SliceContext *sc, VVCContext *s, VVCFrameContext *fc, const CodedBitstreamUnit *unit, const int is_first_slice)