95 return (
int)d & ~((1 << chroma_sub) - 1);
121 "Error when evaluating the expression '%s' for %s\n",
132 char *res,
int res_len,
int flags)
137 if (!strcmp(cmd,
"x"))
139 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[] = {
231 main_formats = main_pix_fmts_yuv420;
232 overlay_formats = overlay_pix_fmts_yuv420;
235 main_formats = main_pix_fmts_yuv420p10;
236 overlay_formats = overlay_pix_fmts_yuv420p10;
239 main_formats = main_pix_fmts_yuv422;
240 overlay_formats = overlay_pix_fmts_yuv422;
243 main_formats = main_pix_fmts_yuv422p10;
244 overlay_formats = overlay_pix_fmts_yuv422p10;
247 main_formats = main_pix_fmts_yuv444;
248 overlay_formats = overlay_pix_fmts_yuv444;
251 main_formats = main_pix_fmts_rgb;
252 overlay_formats = overlay_pix_fmts_rgb;
255 main_formats = main_pix_fmts_gbrp;
256 overlay_formats = overlay_pix_fmts_gbrp;
296 if ((ret =
set_expr(&
s->x_pexpr,
s->x_expr,
"x",
ctx)) < 0 ||
300 s->overlay_is_packed_rgb =
312 "main w:%d h:%d fmt:%s overlay w:%d h:%d fmt:%s\n",
338 #define FAST_DIV255(x) ((((x) + 128) * 257) >> 16)
344 #define UNPREMULTIPLY_ALPHA(x, y) ((((x) << 16) - ((x) << 9) + (x)) / ((((x) + (y)) << 8) - ((x) + (y)) - (y) * (x)))
352 int main_has_alpha,
int x,
int y,
353 int is_straight,
int jobnr,
int nb_jobs)
356 int i, imax, j, jmax;
357 const int src_w =
src->width;
358 const int src_h =
src->height;
359 const int dst_w = dst->
width;
360 const int dst_h = dst->
height;
362 const int dr =
s->main_rgba_map[
R];
363 const int dg =
s->main_rgba_map[
G];
364 const int db =
s->main_rgba_map[
B];
365 const int da =
s->main_rgba_map[
A];
366 const int dstep =
s->main_pix_step[0];
367 const int sr =
s->overlay_rgba_map[
R];
368 const int sg =
s->overlay_rgba_map[
G];
369 const int sb =
s->overlay_rgba_map[
B];
370 const int sa =
s->overlay_rgba_map[
A];
371 const int sstep =
s->overlay_pix_step[0];
376 imax =
FFMIN3(-y + dst_h,
FFMIN(src_h, dst_h), y + src_h);
381 sp =
src->data[0] + (slice_start) *
src->linesize[0];
382 dp = dst->
data[0] + (y + slice_start) * dst->
linesize[0];
387 d = dp + (x+j) * dstep;
389 for (jmax =
FFMIN(-x + dst_w, src_w); j < jmax; j++) {
394 if (main_has_alpha &&
alpha != 0 &&
alpha != 255) {
417 if (main_has_alpha) {
433 sp +=
src->linesize[0];
437 #define DEFINE_BLEND_PLANE(depth, nbits) \
438 static av_always_inline void blend_plane_##depth##_##nbits##bits(AVFilterContext *ctx, \
439 AVFrame *dst, const AVFrame *src, \
440 int src_w, int src_h, \
441 int dst_w, int dst_h, \
442 int i, int hsub, int vsub, \
444 int main_has_alpha, \
453 OverlayContext *octx = ctx->priv; \
454 int src_wp = AV_CEIL_RSHIFT(src_w, hsub); \
455 int src_hp = AV_CEIL_RSHIFT(src_h, vsub); \
456 int dst_wp = AV_CEIL_RSHIFT(dst_w, hsub); \
457 int dst_hp = AV_CEIL_RSHIFT(dst_h, vsub); \
460 uint##depth##_t *s, *sp, *d, *dp, *dap, *a, *da, *ap; \
461 int jmax, j, k, kmax; \
462 int slice_start, slice_end; \
463 const uint##depth##_t max = (1 << nbits) - 1; \
464 const uint##depth##_t mid = (1 << (nbits -1)) ; \
465 int bytes = depth / 8; \
469 jmax = FFMIN3(-yp + dst_hp, FFMIN(src_hp, dst_hp), yp + src_hp); \
471 slice_start = j + ff_slice_pos(jmax, jobnr, nb_jobs); \
472 slice_end = j + ff_slice_pos(jmax, jobnr + 1, nb_jobs); \
474 sp = (uint##depth##_t *)(src->data[i] + (slice_start) * src->linesize[i]); \
475 dp = (uint##depth##_t *)(dst->data[dst_plane] \
476 + (yp + slice_start) * dst->linesize[dst_plane] \
478 ap = (uint##depth##_t *)(src->data[3] + (slice_start << vsub) * src->linesize[3]); \
479 dap = (uint##depth##_t *)(dst->data[3] + ((yp + slice_start) << vsub) * dst->linesize[3]); \
481 for (j = slice_start; j < slice_end; j++) { \
483 d = dp + (xp+k) * dst_step; \
485 a = ap + (k<<hsub); \
486 da = dap + ((xp+k) << hsub); \
487 kmax = FFMIN(-xp + dst_wp, src_wp); \
489 if (nbits == 8 && ((vsub && j+1 < src_hp) || !vsub) && octx->blend_row[i]) { \
490 int c = octx->blend_row[i]((uint8_t*)d, (uint8_t*)da, (uint8_t*)s, \
491 (uint8_t*)a, kmax - k, src->linesize[3]); \
495 da += (1 << hsub) * c; \
496 a += (1 << hsub) * c; \
499 for (; k < kmax; k++) { \
500 int alpha_v, alpha_h, alpha; \
503 if (hsub && vsub && j+1 < src_hp && k+1 < src_wp) { \
504 alpha = (a[0] + a[src->linesize[3]] + \
505 a[1] + a[src->linesize[3]+1]) >> 2; \
506 } else if (hsub || vsub) { \
507 alpha_h = hsub && k+1 < src_wp ? \
508 (a[0] + a[1]) >> 1 : a[0]; \
509 alpha_v = vsub && j+1 < src_hp ? \
510 (a[0] + a[src->linesize[3]]) >> 1 : a[0]; \
511 alpha = (alpha_v + alpha_h) >> 1; \
516 if (main_has_alpha && alpha != 0 && alpha != max) { \
519 if (hsub && vsub && j+1 < src_hp && k+1 < src_wp) { \
520 alpha_d = (da[0] + da[dst->linesize[3]] + \
521 da[1] + da[dst->linesize[3]+1]) >> 2; \
522 } else if (hsub || vsub) { \
523 alpha_h = hsub && k+1 < src_wp ? \
524 (da[0] + da[1]) >> 1 : da[0]; \
525 alpha_v = vsub && j+1 < src_hp ? \
526 (da[0] + da[dst->linesize[3]]) >> 1 : da[0]; \
527 alpha_d = (alpha_v + alpha_h) >> 1; \
530 alpha = UNPREMULTIPLY_ALPHA(alpha, alpha_d); \
534 *d = (*d * (max - alpha) + *s * alpha) / max; \
536 *d = FAST_DIV255(*d * (255 - alpha) + *s * alpha); \
540 *d = av_clip((*d * (max - alpha) + *s * alpha) / max + *s - mid, -mid, mid) + mid; \
542 *d = FFMIN((*d * (max - alpha) + *s * alpha) / max + *s, max); \
545 *d = av_clip(FAST_DIV255((*d - mid) * (max - alpha)) + *s - mid, -mid, mid) + mid; \
547 *d = FFMIN(FAST_DIV255(*d * (max - alpha)) + *s, max); \
555 dp += dst->linesize[dst_plane] / bytes; \
556 sp += src->linesize[i] / bytes; \
557 ap += (1 << vsub) * src->linesize[3] / bytes; \
558 dap += (1 << vsub) * dst->linesize[3] / bytes; \
564 #define DEFINE_ALPHA_COMPOSITE(depth, nbits) \
565 static inline void alpha_composite_##depth##_##nbits##bits(const AVFrame *src, const AVFrame *dst, \
566 int src_w, int src_h, \
567 int dst_w, int dst_h, \
569 int jobnr, int nb_jobs) \
571 uint##depth##_t alpha; \
572 uint##depth##_t *s, *sa, *d, *da; \
573 int i, imax, j, jmax; \
574 int slice_start, slice_end; \
575 const uint##depth##_t max = (1 << nbits) - 1; \
576 int bytes = depth / 8; \
578 imax = FFMIN(-y + dst_h, src_h); \
579 slice_start = ff_slice_pos(imax, jobnr, nb_jobs); \
580 slice_end = (ff_slice_pos(imax, jobnr + 1, nb_jobs)); \
583 sa = (uint##depth##_t *)(src->data[3] + (i + slice_start) * src->linesize[3]); \
584 da = (uint##depth##_t *)(dst->data[3] + (y + i + slice_start) * dst->linesize[3]); \
586 for (i = i + slice_start; i < slice_end; i++) { \
591 for (jmax = FFMIN(-x + dst_w, src_w); j < jmax; j++) { \
593 if (alpha != 0 && alpha != max) { \
594 uint8_t alpha_d = *d; \
595 alpha = UNPREMULTIPLY_ALPHA(alpha, alpha_d); \
599 else if (alpha > 0) { \
602 *d += (max - *d) * *s / max; \
604 *d += FAST_DIV255((max - *d) * *s); \
609 da += dst->linesize[3] / bytes; \
610 sa += src->linesize[3] / bytes; \
616 #define DEFINE_BLEND_SLICE_YUV(depth, nbits) \
617 static av_always_inline void blend_slice_yuv_##depth##_##nbits##bits(AVFilterContext *ctx, \
618 AVFrame *dst, const AVFrame *src, \
619 int hsub, int vsub, \
620 int main_has_alpha, \
623 int jobnr, int nb_jobs) \
625 OverlayContext *s = ctx->priv; \
626 const int src_w = src->width; \
627 const int src_h = src->height; \
628 const int dst_w = dst->width; \
629 const int dst_h = dst->height; \
631 blend_plane_##depth##_##nbits##bits(ctx, dst, src, src_w, src_h, dst_w, dst_h, 0, 0, 0, \
632 x, y, main_has_alpha, s->main_desc->comp[0].plane, s->main_desc->comp[0].offset, \
633 s->main_desc->comp[0].step, is_straight, 1, jobnr, nb_jobs); \
634 blend_plane_##depth##_##nbits##bits(ctx, dst, src, src_w, src_h, dst_w, dst_h, 1, hsub, vsub, \
635 x, y, main_has_alpha, s->main_desc->comp[1].plane, s->main_desc->comp[1].offset, \
636 s->main_desc->comp[1].step, is_straight, 1, jobnr, nb_jobs); \
637 blend_plane_##depth##_##nbits##bits(ctx, dst, src, src_w, src_h, dst_w, dst_h, 2, hsub, vsub, \
638 x, y, main_has_alpha, s->main_desc->comp[2].plane, s->main_desc->comp[2].offset, \
639 s->main_desc->comp[2].step, is_straight, 1, jobnr, nb_jobs); \
641 if (main_has_alpha) \
642 alpha_composite_##depth##_##nbits##bits(src, dst, src_w, src_h, dst_w, dst_h, x, y, \
658 const int src_w =
src->width;
659 const int src_h =
src->height;
660 const int dst_w = dst->width;
661 const int dst_h = dst->height;
663 blend_plane_8_8bits(
ctx, dst,
src, src_w, src_h, dst_w, dst_h, 0, 0, 0, x, y, main_has_alpha,
664 s->main_desc->comp[1].plane,
s->main_desc->comp[1].offset,
s->main_desc->comp[1].step, is_straight, 0,
666 blend_plane_8_8bits(
ctx, dst,
src, src_w, src_h, dst_w, dst_h, 1,
hsub, vsub, x, y, main_has_alpha,
667 s->main_desc->comp[2].plane,
s->main_desc->comp[2].offset,
s->main_desc->comp[2].step, is_straight, 0,
669 blend_plane_8_8bits(
ctx, dst,
src, src_w, src_h, dst_w, dst_h, 2,
hsub, vsub, x, y, main_has_alpha,
670 s->main_desc->comp[0].plane,
s->main_desc->comp[0].offset,
s->main_desc->comp[0].step, is_straight, 0,
674 alpha_composite_8_8bits(
src, dst, src_w, src_h, dst_w, dst_h, x, y, jobnr, nb_jobs);
681 blend_slice_yuv_8_8bits(
ctx,
td->dst,
td->src, 1, 1, 0,
s->x,
s->y, 1, jobnr, nb_jobs);
689 blend_slice_yuv_8_8bits(
ctx,
td->dst,
td->src, 1, 1, 1,
s->x,
s->y, 1, jobnr, nb_jobs);
697 blend_slice_yuv_16_10bits(
ctx,
td->dst,
td->src, 1, 1, 0,
s->x,
s->y, 1, jobnr, nb_jobs);
705 blend_slice_yuv_16_10bits(
ctx,
td->dst,
td->src, 1, 1, 1,
s->x,
s->y, 1, jobnr, nb_jobs);
713 blend_slice_yuv_16_10bits(
ctx,
td->dst,
td->src, 1, 0, 0,
s->x,
s->y, 1, jobnr, nb_jobs);
721 blend_slice_yuv_16_10bits(
ctx,
td->dst,
td->src, 1, 0, 1,
s->x,
s->y, 1, jobnr, nb_jobs);
729 blend_slice_yuv_8_8bits(
ctx,
td->dst,
td->src, 1, 0, 0,
s->x,
s->y, 1, jobnr, nb_jobs);
737 blend_slice_yuv_8_8bits(
ctx,
td->dst,
td->src, 1, 0, 1,
s->x,
s->y, 1, jobnr, nb_jobs);
745 blend_slice_yuv_8_8bits(
ctx,
td->dst,
td->src, 0, 0, 0,
s->x,
s->y, 1, jobnr, nb_jobs);
753 blend_slice_yuv_8_8bits(
ctx,
td->dst,
td->src, 0, 0, 1,
s->x,
s->y, 1, jobnr, nb_jobs);
761 blend_slice_planar_rgb(
ctx,
td->dst,
td->src, 0, 0, 0,
s->x,
s->y, 1, jobnr, nb_jobs);
769 blend_slice_planar_rgb(
ctx,
td->dst,
td->src, 0, 0, 1,
s->x,
s->y, 1, jobnr, nb_jobs);
777 blend_slice_yuv_8_8bits(
ctx,
td->dst,
td->src, 1, 1, 0,
s->x,
s->y, 0, jobnr, nb_jobs);
785 blend_slice_yuv_8_8bits(
ctx,
td->dst,
td->src, 1, 1, 1,
s->x,
s->y, 0, jobnr, nb_jobs);
793 blend_slice_yuv_8_8bits(
ctx,
td->dst,
td->src, 1, 0, 0,
s->x,
s->y, 0, jobnr, nb_jobs);
801 blend_slice_yuv_8_8bits(
ctx,
td->dst,
td->src, 1, 0, 1,
s->x,
s->y, 0, jobnr, nb_jobs);
809 blend_slice_yuv_8_8bits(
ctx,
td->dst,
td->src, 0, 0, 0,
s->x,
s->y, 0, jobnr, nb_jobs);
817 blend_slice_yuv_8_8bits(
ctx,
td->dst,
td->src, 0, 0, 1,
s->x,
s->y, 0, jobnr, nb_jobs);
825 blend_slice_planar_rgb(
ctx,
td->dst,
td->src, 0, 0, 0,
s->x,
s->y, 0, jobnr, nb_jobs);
833 blend_slice_planar_rgb(
ctx,
td->dst,
td->src, 0, 0, 1,
s->x,
s->y, 0, jobnr, nb_jobs);
879 s->main_desc = pix_desc;
881 s->main_is_packed_rgb =
939 if (!
s->alpha_format)
988 s->alpha_format,
s->main_has_alpha);
1027 if (
s->x < mainpic->
width &&
s->x + second->
width >= 0 &&
1053 #define OFFSET(x) offsetof(OverlayContext, x)
1054 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
1059 {
"eof_action",
"Action to take when encountering EOF from secondary input ",
1068 {
"shortest",
"force termination when the shortest input terminates",
OFFSET(
fs.opt_shortest),
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1,
FLAGS },
1113 .preinit = overlay_framesync_preinit,
1117 .priv_class = &overlay_class,
static const AVFilterPad inputs[]
static const AVFilterPad outputs[]
static const char *const format[]
#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_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Main libavfilter public API header.
#define flags(name, subs,...)
#define fs(width, name, subs,...)
common internal and external API header
int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
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
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_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 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[]
common internal API header
#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)
Handle slice ends.
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_YUVA420P10
#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...
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.
AVFilterContext * dst
dest filter
int format
agreed upon media format
A filter pad used for either input or output.
const char * name
Pad name.
const char * name
Filter name.
AVFormatInternal * internal
An opaque field for libavformat internal usage.
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).
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int64_t pkt_pos
reordered pos from the last AVPacket that has been input into the decoder
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
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.
Used for passing data between threads.
timestamp utils, mostly useful for debugging/logging purposes
static const AVOption overlay_options[]
static int blend_slice_gbrap_pm(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int blend_slice_yuva422p10(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
#define DEFINE_BLEND_SLICE_YUV(depth, nbits)
static int blend_slice_yuv444_pm(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int config_input_overlay(AVFilterLink *inlink)
static int blend_slice_rgba_pm(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int blend_slice_yuv420(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int blend_slice_yuva444(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int blend_slice_yuva444_pm(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int query_formats(AVFilterContext *ctx)
#define UNPREMULTIPLY_ALPHA(x, y)
static int blend_slice_yuv420p10(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int blend_slice_gbrp_pm(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int do_blend(FFFrameSync *fs)
static int blend_slice_yuv422_pm(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int blend_slice_rgb_pm(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int blend_slice_rgb(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int blend_slice_yuv422(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
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).
static const AVFilterPad avfilter_vf_overlay_inputs[]
static int blend_slice_yuva422(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int set_expr(AVExpr **pexpr, const char *expr, const char *option, void *log_ctx)
static enum AVPixelFormat alpha_pix_fmts[]
static int config_input_main(AVFilterLink *inlink)
FRAMESYNC_DEFINE_CLASS(overlay, OverlayContext, fs)
static int blend_slice_yuva420p10(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int blend_slice_yuva420(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static const char *const var_names[]
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
static int activate(AVFilterContext *ctx)
#define DEFINE_BLEND_PLANE(depth, nbits)
static av_cold int init(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)
static int blend_slice_yuva420_pm(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int blend_slice_yuv420_pm(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static const AVFilterPad avfilter_vf_overlay_outputs[]
static int blend_slice_yuv444(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int config_output(AVFilterLink *outlink)
#define DEFINE_ALPHA_COMPOSITE(depth, nbits)
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 blend_slice_yuv422p10(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int blend_slice_rgba(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static void eval_expr(AVFilterContext *ctx)
static int blend_slice_gbrap(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int blend_slice_yuva422_pm(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int normalize_xy(double d, int chroma_sub)
static int blend_slice_gbrp(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
@ OVERLAY_FORMAT_YUV420P10
@ OVERLAY_FORMAT_YUV422P10
void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format, int alpha_format, int main_has_alpha)