|
FFmpeg
|
#include "avfilter.h"#include "formats.h"#include "libavutil/common.h"#include "libavutil/eval.h"#include "libavutil/avstring.h"#include "libavutil/pixdesc.h"#include "libavutil/imgutils.h"#include "libavutil/mathematics.h"#include "libavutil/opt.h"#include "libavutil/timestamp.h"#include "filters.h"#include "drawutils.h"#include "framesync.h"#include "video.h"#include "vf_overlay.h"Go to the source code of this file.
Data Structures | |
| struct | ThreadData |
| Used for passing data between threads. More... | |
Macros | |
| #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 |
Functions | |
| 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 (AVFilterContext *ctx) |
| 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) |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuv420, yuv_8_8bits, 1, 1, 0, 1) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuva420, yuv_8_8bits, 1, 1, 1, 1) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuv420p10, yuv_16_10bits, 1, 1, 0, 1) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuva420p10, yuv_16_10bits, 1, 1, 1, 1) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuv422p10, yuv_16_10bits, 1, 0, 0, 1) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuva422p10, yuv_16_10bits, 1, 0, 1, 1) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuv422, yuv_8_8bits, 1, 0, 0, 1) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuva422, yuv_8_8bits, 1, 0, 1, 1) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuv444, yuv_8_8bits, 0, 0, 0, 1) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuva444, yuv_8_8bits, 0, 0, 1, 1) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuv444p10, yuv_16_10bits, 0, 0, 0, 1) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuva444p10, yuv_16_10bits, 0, 0, 1, 1) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (gbrp, planar_rgb, 0, 0, 0, 1) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (gbrap, planar_rgb, 0, 0, 1, 1) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuv420_pm, yuv_8_8bits, 1, 1, 0, 0) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuva420_pm, yuv_8_8bits, 1, 1, 1, 0) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuv422_pm, yuv_8_8bits, 1, 0, 0, 0) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuva422_pm, yuv_8_8bits, 1, 0, 1, 0) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuv444_pm, yuv_8_8bits, 0, 0, 0, 0) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (yuva444_pm, yuv_8_8bits, 0, 0, 1, 0) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (gbrp_pm, planar_rgb, 0, 0, 0, 0) | |
| DEFINE_BLEND_SLICE_PLANAR_FMT (gbrap_pm, planar_rgb, 0, 0, 1, 0) | |
| DEFINE_BLEND_SLICE_PACKED_FMT (rgb, rgb, 0, 1) | |
| DEFINE_BLEND_SLICE_PACKED_FMT (rgba, rgb, 1, 1) | |
| DEFINE_BLEND_SLICE_PACKED_FMT (rgb_pm, rgb, 0, 0) | |
| DEFINE_BLEND_SLICE_PACKED_FMT (rgba_pm, rgb, 1, 0) | |
| 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) | |
Variables | |
| static const char *const | var_names [] |
| static enum AVPixelFormat | alpha_pix_fmts [] |
| static const AVOption | overlay_options [] |
| static const AVFilterPad | avfilter_vf_overlay_inputs [] |
| static const AVFilterPad | avfilter_vf_overlay_outputs [] |
| const AVFilter | ff_vf_overlay |
overlay one video on top of another
Definition in file vf_overlay.c.
| #define MAIN 0 |
Definition at line 65 of file vf_overlay.c.
| #define OVERLAY 1 |
Definition at line 66 of file vf_overlay.c.
| #define R 0 |
Definition at line 68 of file vf_overlay.c.
| #define G 1 |
Definition at line 69 of file vf_overlay.c.
| #define B 2 |
Definition at line 70 of file vf_overlay.c.
| #define A 3 |
Definition at line 71 of file vf_overlay.c.
| #define Y 0 |
Definition at line 73 of file vf_overlay.c.
| #define U 1 |
Definition at line 74 of file vf_overlay.c.
| #define V 2 |
Definition at line 75 of file vf_overlay.c.
| #define FAST_DIV255 | ( | x | ) | ((((x) + 128) * 257) >> 16) |
Definition at line 352 of file vf_overlay.c.
| #define UNPREMULTIPLY_ALPHA | ( | x, | |
| y | |||
| ) | ((((x) << 16) - ((x) << 9) + (x)) / ((((x) + (y)) << 8) - ((x) + (y)) - (y) * (x))) |
Definition at line 358 of file vf_overlay.c.
| #define DEFINE_BLEND_PLANE | ( | depth, | |
| nbits | |||
| ) |
Definition at line 451 of file vf_overlay.c.
| #define DEFINE_ALPHA_COMPOSITE | ( | depth, | |
| nbits | |||
| ) |
Definition at line 579 of file vf_overlay.c.
| #define DEFINE_BLEND_SLICE_YUV | ( | depth, | |
| nbits | |||
| ) |
Definition at line 632 of file vf_overlay.c.
| #define DEFINE_BLEND_SLICE_PLANAR_FMT | ( | format_, | |
| blend_slice_fn_suffix_, | |||
| hsub_, | |||
| vsub_, | |||
| main_has_alpha_, | |||
| direct_ | |||
| ) |
Definition at line 693 of file vf_overlay.c.
| #define DEFINE_BLEND_SLICE_PACKED_FMT | ( | format_, | |
| blend_slice_fn_suffix_, | |||
| main_has_alpha_, | |||
| direct_ | |||
| ) |
Definition at line 729 of file vf_overlay.c.
| #define OFFSET | ( | x | ) | offsetof(OverlayContext, x) |
Definition at line 945 of file vf_overlay.c.
| #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM |
Definition at line 946 of file vf_overlay.c.
| enum EvalMode |
Definition at line 77 of file vf_overlay.c.
|
static |
Definition at line 83 of file vf_overlay.c.
|
inlinestatic |
Definition at line 92 of file vf_overlay.c.
Referenced by eval_expr().
|
static |
Definition at line 99 of file vf_overlay.c.
Referenced by config_input_overlay(), do_blend(), and process_command().
|
static |
Definition at line 111 of file vf_overlay.c.
Referenced by config_input_overlay(), and process_command().
|
static |
Definition at line 132 of file vf_overlay.c.
|
static |
Definition at line 164 of file vf_overlay.c.
|
static |
Definition at line 285 of file vf_overlay.c.
|
static |
Definition at line 334 of file vf_overlay.c.
|
static |
Blend image in src to destination buffer dst at position (x, y).
< the amount of overlay to blend on to main
Definition at line 364 of file vf_overlay.c.
|
static |
Definition at line 664 of file vf_overlay.c.
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuv420 | , |
| yuv_8_8bits | , | ||
| 1 | , | ||
| 1 | , | ||
| 0 | , | ||
| 1 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuva420 | , |
| yuv_8_8bits | , | ||
| 1 | , | ||
| 1 | , | ||
| 1 | , | ||
| 1 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuv420p10 | , |
| yuv_16_10bits | , | ||
| 1 | , | ||
| 1 | , | ||
| 0 | , | ||
| 1 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuva420p10 | , |
| yuv_16_10bits | , | ||
| 1 | , | ||
| 1 | , | ||
| 1 | , | ||
| 1 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuv422p10 | , |
| yuv_16_10bits | , | ||
| 1 | , | ||
| 0 | , | ||
| 0 | , | ||
| 1 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuva422p10 | , |
| yuv_16_10bits | , | ||
| 1 | , | ||
| 0 | , | ||
| 1 | , | ||
| 1 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuv422 | , |
| yuv_8_8bits | , | ||
| 1 | , | ||
| 0 | , | ||
| 0 | , | ||
| 1 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuva422 | , |
| yuv_8_8bits | , | ||
| 1 | , | ||
| 0 | , | ||
| 1 | , | ||
| 1 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuv444 | , |
| yuv_8_8bits | , | ||
| 0 | , | ||
| 0 | , | ||
| 0 | , | ||
| 1 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuva444 | , |
| yuv_8_8bits | , | ||
| 0 | , | ||
| 0 | , | ||
| 1 | , | ||
| 1 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuv444p10 | , |
| yuv_16_10bits | , | ||
| 0 | , | ||
| 0 | , | ||
| 0 | , | ||
| 1 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuva444p10 | , |
| yuv_16_10bits | , | ||
| 0 | , | ||
| 0 | , | ||
| 1 | , | ||
| 1 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | gbrp | , |
| planar_rgb | , | ||
| 0 | , | ||
| 0 | , | ||
| 0 | , | ||
| 1 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | gbrap | , |
| planar_rgb | , | ||
| 0 | , | ||
| 0 | , | ||
| 1 | , | ||
| 1 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuv420_pm | , |
| yuv_8_8bits | , | ||
| 1 | , | ||
| 1 | , | ||
| 0 | , | ||
| 0 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuva420_pm | , |
| yuv_8_8bits | , | ||
| 1 | , | ||
| 1 | , | ||
| 1 | , | ||
| 0 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuv422_pm | , |
| yuv_8_8bits | , | ||
| 1 | , | ||
| 0 | , | ||
| 0 | , | ||
| 0 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuva422_pm | , |
| yuv_8_8bits | , | ||
| 1 | , | ||
| 0 | , | ||
| 1 | , | ||
| 0 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuv444_pm | , |
| yuv_8_8bits | , | ||
| 0 | , | ||
| 0 | , | ||
| 0 | , | ||
| 0 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | yuva444_pm | , |
| yuv_8_8bits | , | ||
| 0 | , | ||
| 0 | , | ||
| 1 | , | ||
| 0 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | gbrp_pm | , |
| planar_rgb | , | ||
| 0 | , | ||
| 0 | , | ||
| 0 | , | ||
| 0 | |||
| ) |
| DEFINE_BLEND_SLICE_PLANAR_FMT | ( | gbrap_pm | , |
| planar_rgb | , | ||
| 0 | , | ||
| 0 | , | ||
| 1 | , | ||
| 0 | |||
| ) |
| DEFINE_BLEND_SLICE_PACKED_FMT | ( | rgba | , |
| rgb | , | ||
| 1 | , | ||
| 1 | |||
| ) |
| DEFINE_BLEND_SLICE_PACKED_FMT | ( | rgb_pm | , |
| rgb | , | ||
| 0 | , | ||
| 0 | |||
| ) |
| DEFINE_BLEND_SLICE_PACKED_FMT | ( | rgba_pm | , |
| rgb | , | ||
| 1 | , | ||
| 0 | |||
| ) |
|
static |
Definition at line 747 of file vf_overlay.c.
|
static |
Definition at line 878 of file vf_overlay.c.
Referenced by init().
|
static |
Definition at line 931 of file vf_overlay.c.
|
static |
Definition at line 939 of file vf_overlay.c.
| FRAMESYNC_DEFINE_CLASS | ( | overlay | , |
| OverlayContext | , | ||
| fs | |||
| ) |
|
static |
Definition at line 48 of file vf_overlay.c.
Referenced by set_expr().
|
static |
Definition at line 157 of file vf_overlay.c.
Referenced by config_input_main(), config_input_overlay(), and query_formats().
|
static |
Definition at line 948 of file vf_overlay.c.
|
static |
Definition at line 980 of file vf_overlay.c.
|
static |
Definition at line 993 of file vf_overlay.c.
| const AVFilter ff_vf_overlay |
Definition at line 1001 of file vf_overlay.c.
1.8.17