Go to the documentation of this file.
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[] = {
238 main_formats = main_pix_fmts_yuv420;
239 overlay_formats = overlay_pix_fmts_yuv420;
242 main_formats = main_pix_fmts_yuv420p10;
243 overlay_formats = overlay_pix_fmts_yuv420p10;
246 main_formats = main_pix_fmts_yuv422;
247 overlay_formats = overlay_pix_fmts_yuv422;
250 main_formats = main_pix_fmts_yuv422p10;
251 overlay_formats = overlay_pix_fmts_yuv422p10;
254 main_formats = main_pix_fmts_yuv444;
255 overlay_formats = overlay_pix_fmts_yuv444;
258 main_formats = main_pix_fmts_yuv444p10;
259 overlay_formats = overlay_pix_fmts_yuv444p10;
262 main_formats = main_pix_fmts_rgb;
263 overlay_formats = overlay_pix_fmts_rgb;
266 main_formats = main_pix_fmts_gbrp;
267 overlay_formats = overlay_pix_fmts_gbrp;
310 s->overlay_is_packed_rgb =
322 "main w:%d h:%d fmt:%s overlay w:%d h:%d fmt:%s\n",
348 #define FAST_DIV255(x) ((((x) + 128) * 257) >> 16)
354 #define UNPREMULTIPLY_ALPHA(x, y) ((((x) << 16) - ((x) << 9) + (x)) / ((((x) + (y)) << 8) - ((x) + (y)) - (y) * (x)))
356 #define PTR_ADD(TYPE, ptr, byte_addend) ((TYPE*)((uint8_t*)ptr + (byte_addend)))
357 #define CPTR_ADD(TYPE, ptr, byte_addend) ((const TYPE*)((const uint8_t*)ptr + (byte_addend)))
365 int main_has_alpha,
int x,
int y,
366 int is_straight,
int jobnr,
int nb_jobs)
369 int i, imax, j, jmax;
370 const int src_w =
src->width;
371 const int src_h =
src->height;
372 const int dst_w =
dst->width;
373 const int dst_h =
dst->height;
375 const int dr =
s->main_rgba_map[
R];
376 const int dg =
s->main_rgba_map[
G];
377 const int db =
s->main_rgba_map[
B];
378 const int da =
s->main_rgba_map[
A];
379 const int dstep =
s->main_pix_step[0];
380 const int sr =
s->overlay_rgba_map[
R];
381 const int sg =
s->overlay_rgba_map[
G];
382 const int sb =
s->overlay_rgba_map[
B];
383 const int sa =
s->overlay_rgba_map[
A];
384 const int sstep =
s->overlay_pix_step[0];
386 uint8_t *
S, *sp, *d, *dp;
389 imax =
FFMIN3(-y + dst_h,
FFMIN(src_h, dst_h), y + src_h);
400 d = dp + (x+j) * dstep;
402 for (jmax =
FFMIN(-x + dst_w, src_w); j < jmax; j++) {
407 if (main_has_alpha &&
alpha != 0 &&
alpha != 255) {
408 uint8_t alpha_d = d[da];
430 if (main_has_alpha) {
445 dp +=
dst->linesize[0];
446 sp +=
src->linesize[0];
450 #define DEFINE_BLEND_PLANE(depth, T, nbits) \
451 static av_always_inline void blend_plane_##depth##_##nbits##bits(AVFilterContext *ctx, \
452 AVFrame *dst, const AVFrame *src, \
453 int src_w, int src_h, \
454 int dst_w, int dst_h, \
455 int i, int hsub, int vsub, \
457 int main_has_alpha, \
466 OverlayContext *octx = ctx->priv; \
467 int src_wp = AV_CEIL_RSHIFT(src_w, hsub); \
468 int src_hp = AV_CEIL_RSHIFT(src_h, vsub); \
469 int dst_wp = AV_CEIL_RSHIFT(dst_w, hsub); \
470 int dst_hp = AV_CEIL_RSHIFT(dst_h, vsub); \
473 const T max = (1 << nbits) - 1; \
474 const T mid = (1 << (nbits - 1)); \
476 const int jmin = FFMAX(-yp, 0), jmax = FFMIN3(-yp + dst_hp, FFMIN(src_hp, dst_hp), yp + src_hp); \
477 const int kmin = FFMAX(-xp, 0), kmax = FFMIN(-xp + dst_wp, src_wp); \
478 const int slice_start = jmin + (jmax * jobnr) / nb_jobs; \
479 const int slice_end = jmin + (jmax * (jobnr + 1)) / nb_jobs; \
481 const uint8_t *sp = src->data[i] + (slice_start) * src->linesize[i]; \
482 uint8_t *dp = dst->data[dst_plane] \
483 + (yp + slice_start) * dst->linesize[dst_plane] \
485 const uint8_t *ap = src->data[3] + (slice_start << vsub) * src->linesize[3]; \
486 const uint8_t *dap = main_has_alpha ? dst->data[3] + ((yp + slice_start) << vsub) * dst->linesize[3] : NULL; \
488 for (int j = slice_start; j < slice_end; ++j) { \
490 const T *s = (const T *)sp + k; \
491 const T *a = (const T *)ap + (k << hsub); \
492 const T *da = main_has_alpha ? (T *)dap + ((xp + k) << hsub) : NULL; \
493 T *d = (T *)(dp + (xp + k) * dst_step); \
495 if (nbits == 8 && ((vsub && j+1 < src_hp) || !vsub) && octx->blend_row[i]) { \
496 int c = octx->blend_row[i]((uint8_t*)d, (uint8_t*)da, (uint8_t*)s, \
497 (uint8_t*)a, kmax - k, src->linesize[3]); \
500 d = PTR_ADD(T, d, dst_step * c); \
501 if (main_has_alpha) \
502 da += (1 << hsub) * c; \
503 a += (1 << hsub) * c; \
506 for (; k < kmax; k++) { \
507 int alpha_v, alpha_h, alpha; \
510 if (hsub && vsub && j+1 < src_hp && k+1 < src_wp) { \
511 const T *next_line = CPTR_ADD(T, a, src->linesize[3]); \
512 alpha = (a[0] + next_line[0] + \
513 a[1] + next_line[1]) >> 2; \
514 } else if (hsub || vsub) { \
515 alpha_h = hsub && k+1 < src_wp ? \
516 (a[0] + a[1]) >> 1 : a[0]; \
517 alpha_v = vsub && j+1 < src_hp ? \
518 (a[0] + *CPTR_ADD(T, a, src->linesize[3])) >> 1 : a[0]; \
519 alpha = (alpha_v + alpha_h) >> 1; \
524 if (main_has_alpha && alpha != 0 && alpha != max) { \
527 if (hsub && vsub && j+1 < src_hp && k+1 < src_wp) { \
528 const T *next_line = CPTR_ADD(T, da, dst->linesize[3]); \
529 alpha_d = (da[0] + next_line[0] + \
530 da[1] + next_line[1]) >> 2; \
531 } else if (hsub || vsub) { \
532 alpha_h = hsub && k+1 < src_wp ? \
533 (da[0] + da[1]) >> 1 : da[0]; \
534 alpha_v = vsub && j+1 < src_hp ? \
535 (da[0] + *CPTR_ADD(T, da, dst->linesize[3])) >> 1 : da[0]; \
536 alpha_d = (alpha_v + alpha_h) >> 1; \
539 alpha = UNPREMULTIPLY_ALPHA(alpha, alpha_d); \
543 *d = (*d * (max - alpha) + *s * alpha) / max; \
545 *d = FAST_DIV255(*d * (255 - alpha) + *s * alpha); \
549 *d = av_clip((*d * (max - alpha) + *s * alpha) / max + *s - mid, -mid, mid) + mid; \
551 *d = av_clip_uintp2((*d * (max - alpha) + *s * alpha) / max + *s - (16<<(nbits-8)),\
555 *d = av_clip(FAST_DIV255((*d - mid) * (max - alpha)) + *s - mid, -mid, mid) + mid; \
557 *d = av_clip_uint8(FAST_DIV255(*d * (255 - alpha)) + *s - 16); \
561 d = PTR_ADD(T, d, dst_step); \
562 if (main_has_alpha) \
566 dp += dst->linesize[dst_plane]; \
567 sp += src->linesize[i]; \
568 ap += (1 << vsub) * src->linesize[3]; \
569 if (main_has_alpha) \
570 dap += (1 << vsub) * dst->linesize[3]; \
576 #define DEFINE_ALPHA_COMPOSITE(depth, T, nbits) \
577 static inline void alpha_composite_##depth##_##nbits##bits(const AVFrame *src, const AVFrame *dst, \
578 int src_w, int src_h, \
579 int dst_w, int dst_h, \
581 int jobnr, int nb_jobs) \
584 const T max = (1 << nbits) - 1; \
586 const int imin = FFMAX(-y, 0), imax = FFMIN3(-y + dst_h, FFMIN(src_h, dst_h), y + src_h); \
587 const int jmin = FFMAX(-x, 0), jmax = FFMIN(-x + dst_w, src_w); \
588 const int slice_start = imin + ( imax * jobnr) / nb_jobs; \
589 const int slice_end = imin + ((imax * (jobnr + 1)) / nb_jobs); \
591 const uint8_t *sa = src->data[3] + (slice_start) * src->linesize[3]; \
592 uint8_t *da = dst->data[3] + (y + slice_start) * dst->linesize[3]; \
594 for (int i = slice_start; i < slice_end; ++i) { \
595 const T *s = (const T *)sa + jmin; \
596 T *d = (T *)da + x + jmin; \
598 for (int j = jmin; j < jmax; ++j) { \
600 if (alpha != 0 && alpha != max) { \
601 uint8_t alpha_d = *d; \
602 alpha = UNPREMULTIPLY_ALPHA(alpha, alpha_d); \
606 else if (alpha > 0) { \
609 *d += (max - *d) * *s / max; \
611 *d += FAST_DIV255((max - *d) * *s); \
616 da += dst->linesize[3]; \
617 sa += src->linesize[3]; \
623 #define DEFINE_BLEND_SLICE_YUV(depth, nbits) \
624 static av_always_inline void blend_slice_yuv_##depth##_##nbits##bits(AVFilterContext *ctx, \
625 AVFrame *dst, const AVFrame *src, \
626 int hsub, int vsub, \
627 int main_has_alpha, \
630 int jobnr, int nb_jobs) \
632 OverlayContext *s = ctx->priv; \
633 const int src_w = src->width; \
634 const int src_h = src->height; \
635 const int dst_w = dst->width; \
636 const int dst_h = dst->height; \
638 blend_plane_##depth##_##nbits##bits(ctx, dst, src, src_w, src_h, dst_w, dst_h, 0, 0, 0, \
639 x, y, main_has_alpha, s->main_desc->comp[0].plane, s->main_desc->comp[0].offset, \
640 s->main_desc->comp[0].step, is_straight, 1, jobnr, nb_jobs); \
641 blend_plane_##depth##_##nbits##bits(ctx, dst, src, src_w, src_h, dst_w, dst_h, 1, hsub, vsub, \
642 x, y, main_has_alpha, s->main_desc->comp[1].plane, s->main_desc->comp[1].offset, \
643 s->main_desc->comp[1].step, is_straight, 1, jobnr, nb_jobs); \
644 blend_plane_##depth##_##nbits##bits(ctx, dst, src, src_w, src_h, dst_w, dst_h, 2, hsub, vsub, \
645 x, y, main_has_alpha, s->main_desc->comp[2].plane, s->main_desc->comp[2].offset, \
646 s->main_desc->comp[2].step, is_straight, 1, jobnr, nb_jobs); \
648 if (main_has_alpha) \
649 alpha_composite_##depth##_##nbits##bits(src, dst, src_w, src_h, dst_w, dst_h, x, y, \
665 const int src_w =
src->width;
666 const int src_h =
src->height;
667 const int dst_w =
dst->width;
668 const int dst_h =
dst->height;
670 blend_plane_8_8bits(
ctx,
dst,
src, src_w, src_h, dst_w, dst_h, 0, 0, 0, x, y, main_has_alpha,
671 s->main_desc->comp[1].plane,
s->main_desc->comp[1].offset,
s->main_desc->comp[1].step, is_straight, 0,
673 blend_plane_8_8bits(
ctx,
dst,
src, src_w, src_h, dst_w, dst_h, 1,
hsub, vsub, x, y, main_has_alpha,
674 s->main_desc->comp[2].plane,
s->main_desc->comp[2].offset,
s->main_desc->comp[2].step, is_straight, 0,
676 blend_plane_8_8bits(
ctx,
dst,
src, src_w, src_h, dst_w, dst_h, 2,
hsub, vsub, x, y, main_has_alpha,
677 s->main_desc->comp[0].plane,
s->main_desc->comp[0].offset,
s->main_desc->comp[0].step, is_straight, 0,
681 alpha_composite_8_8bits(
src,
dst, src_w, src_h, dst_w, dst_h, x, y, jobnr, nb_jobs);
684 #define DEFINE_BLEND_SLICE_PLANAR_FMT(format_, blend_slice_fn_suffix_, hsub_, vsub_, main_has_alpha_, direct_) \
685 static int blend_slice_##format_(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) \
687 OverlayContext *s = ctx->priv; \
688 ThreadData *td = arg; \
689 blend_slice_##blend_slice_fn_suffix_(ctx, td->dst, td->src, \
690 hsub_, vsub_, main_has_alpha_, \
691 s->x, s->y, direct_, \
720 #define DEFINE_BLEND_SLICE_PACKED_FMT(format_, blend_slice_fn_suffix_, main_has_alpha_, direct_) \
721 static 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, \
727 s->x, s->y, direct_, \
748 s->main_desc = pix_desc;
750 s->main_is_packed_rgb =
755 s->blend_slice =
s->main_has_alpha ? blend_slice_yuva420 : blend_slice_yuv420;
758 s->blend_slice =
s->main_has_alpha ? blend_slice_yuva420p10 : blend_slice_yuv420p10;
761 s->blend_slice =
s->main_has_alpha ? blend_slice_yuva422 : blend_slice_yuv422;
764 s->blend_slice =
s->main_has_alpha ? blend_slice_yuva422p10 : blend_slice_yuv422p10;
767 s->blend_slice =
s->main_has_alpha ? blend_slice_yuva444 : blend_slice_yuv444;
770 s->blend_slice =
s->main_has_alpha ? blend_slice_yuva444p10 : blend_slice_yuv444p10;
773 s->blend_slice =
s->main_has_alpha ? blend_slice_rgba : blend_slice_rgb;
776 s->blend_slice =
s->main_has_alpha ? blend_slice_gbrap : blend_slice_gbrp;
781 s->blend_slice = blend_slice_yuva420;
784 s->blend_slice = blend_slice_yuva420p10;
787 s->blend_slice = blend_slice_yuva422;
790 s->blend_slice = blend_slice_yuva422p10;
793 s->blend_slice = blend_slice_yuva444;
796 s->blend_slice = blend_slice_yuva444p10;
802 s->blend_slice = blend_slice_rgba;
805 s->blend_slice = blend_slice_gbrap;
814 if (!
s->alpha_format)
819 s->blend_slice =
s->main_has_alpha ? blend_slice_yuva420_pm : blend_slice_yuv420_pm;
822 s->blend_slice =
s->main_has_alpha ? blend_slice_yuva422_pm : blend_slice_yuv422_pm;
825 s->blend_slice =
s->main_has_alpha ? blend_slice_yuva444_pm : blend_slice_yuv444_pm;
828 s->blend_slice =
s->main_has_alpha ? blend_slice_rgba_pm : blend_slice_rgb_pm;
831 s->blend_slice =
s->main_has_alpha ? blend_slice_gbrap_pm : blend_slice_gbrp_pm;
836 s->blend_slice = blend_slice_yuva420_pm;
839 s->blend_slice = blend_slice_yuva422_pm;
842 s->blend_slice = blend_slice_yuva444_pm;
848 s->blend_slice = blend_slice_rgba_pm;
851 s->blend_slice = blend_slice_gbrap_pm;
863 s->alpha_format,
s->main_has_alpha);
902 if (
s->x < mainpic->
width &&
s->x + second->
width >= 0 &&
928 #define OFFSET(x) offsetof(OverlayContext, x)
929 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
930 #define TFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
935 {
"eof_action",
"Action to take when encountering EOF from secondary input ",
944 {
"shortest",
"force termination when the shortest input terminates",
OFFSET(
fs.opt_shortest),
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1,
FLAGS },
988 .p.priv_class = &overlay_class,
991 .preinit = overlay_framesync_preinit,
int ff_framesync_configure(FFFrameSync *fs)
Configure a frame sync structure.
AVPixelFormat
Pixel format.
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).
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 they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static int set_expr(AVExpr **pexpr, const char *expr, const char *option, void *log_ctx)
void ff_framesync_uninit(FFFrameSync *fs)
Free all memory currently allocated.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
static const AVFilterPad avfilter_vf_overlay_outputs[]
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
#define FILTER_INPUTS(array)
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).
static int do_blend(FFFrameSync *fs)
#define AV_PIX_FMT_YUVA420P10
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
#define AV_PIX_FMT_YUV420P10
#define AV_LOG_VERBOSE
Detailed information.
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
const char * name
Filter name.
A link between two filters.
#define AV_PIX_FMT_YUVA422P10
Link properties exposed to filter code, but not external callers.
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.
static const char *const var_names[]
static int slice_end(AVCodecContext *avctx, AVFrame *pict, int *got_output)
Handle slice ends.
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
#define DEFINE_ALPHA_COMPOSITE(depth, T, nbits)
@ OVERLAY_FORMAT_YUV422P10
void av_expr_free(AVExpr *e)
Free a parsed expression previously created with av_expr_parse().
A filter pad used for either input or output.
#define DEFINE_BLEND_SLICE_PACKED_FMT(format_, blend_slice_fn_suffix_, main_has_alpha_, direct_)
void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format, int alpha_format, int main_has_alpha)
#define AV_PIX_FMT_YUV444P10
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int config_input_main(AVFilterLink *inlink)
@ 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_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
static double av_q2d(AVRational a)
Convert an AVRational to a double.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
Evaluate a previously parsed expression.
#define UNPREMULTIPLY_ALPHA(x, y)
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
int ff_fmt_is_in(int fmt, const int *fmts)
Tell if an integer is contained in the provided -1-terminated list of integers.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static void eval_expr(AVFilterContext *ctx)
#define FILTER_OUTPUTS(array)
@ 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_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
static int config_input_overlay(AVFilterLink *inlink)
New swscale design to change SwsGraph is what coordinates multiple passes These can include cascaded scaling error diffusion and so on Or we could have separate passes for the vertical and horizontal scaling In between each SwsPass lies a fully allocated image buffer Graph passes may have different levels of e g we can have a single threaded error diffusion pass following a multi threaded scaling pass SwsGraph is internally recreated whenever the image format
#define fs(width, name, subs,...)
static av_cold void uninit(AVFilterContext *ctx)
@ 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 DEFINE_BLEND_PLANE(depth, T, nbits)
#define AV_PIX_FMT_YUV422P10
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
static const AVFilterPad avfilter_vf_overlay_inputs[]
static FilterLink * ff_filter_link(AVFilterLink *link)
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
static const AVOption overlay_options[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int ff_framesync_init_dualinput(FFFrameSync *fs, AVFilterContext *parent)
Initialize a frame sync structure for dualinput.
@ OVERLAY_FORMAT_YUV420P10
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
#define AV_NOPTS_VALUE
Undefined timestamp value.
AVFilterContext * src
source filter
static int config_output(AVFilterLink *outlink)
const FFFilter ff_vf_overlay
@ 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 DEFINE_BLEND_SLICE_PLANAR_FMT(format_, blend_slice_fn_suffix_, hsub_, vsub_, main_has_alpha_, direct_)
#define i(width, name, range_min, range_max)
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)
int w
agreed upon image width
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Used for passing data between threads.
#define FILTER_QUERY_FUNC2(func)
@ AV_PIX_FMT_NV21
as above, but U and V bytes are swapped
const char * name
Pad name.
static int normalize_xy(double d, int chroma_sub)
static int slice_start(SliceContext *sc, VVCContext *s, VVCFrameContext *fc, const CodedBitstreamUnit *unit, const int is_first_slice)
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
@ 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...
int h
agreed upon image height
int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
@ AV_OPT_TYPE_INT
Underlying C type is int.
static int activate(AVFilterContext *ctx)
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
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.
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
AVFilter p
The public AVFilter.
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
FRAMESYNC_DEFINE_CLASS(overlay, OverlayContext, fs)
static const int16_t alpha[]
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
#define DEFINE_BLEND_SLICE_YUV(depth, nbits)
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
int ff_framesync_activate(FFFrameSync *fs)
Examine the frames in the filter's input and try to produce output.
@ 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...
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.
static enum AVPixelFormat alpha_pix_fmts[]
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
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.
static av_cold int init(AVFilterContext *ctx)