2 * This file is part of FFmpeg.
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef AVFILTER_OVERLAY_H
20 #define AVFILTER_OVERLAY_H
22 #include "libavutil/eval.h"
23 #include "libavutil/pixdesc.h"
24 #include "framesync.h"
30 VAR_OVERLAY_W, VAR_OW,
31 VAR_OVERLAY_H, VAR_OH,
43 OVERLAY_FORMAT_YUV420,
44 OVERLAY_FORMAT_YUV420P10,
45 OVERLAY_FORMAT_YUV422,
46 OVERLAY_FORMAT_YUV422P10,
47 OVERLAY_FORMAT_YUV444,
54 typedef struct OverlayContext {
56 int x, y; ///< position of overlaid picture
58 uint8_t main_is_packed_rgb;
59 uint8_t main_rgba_map[4];
60 uint8_t main_has_alpha;
61 uint8_t overlay_is_packed_rgb;
62 uint8_t overlay_rgba_map[4];
63 uint8_t overlay_has_alpha;
64 int format; ///< OverlayFormat
66 int eval_mode; ///< EvalMode
70 int main_pix_step[4]; ///< steps per pixel for each plane of the main output
71 int overlay_pix_step[4]; ///< steps per pixel for each plane of the overlay
72 int hsub, vsub; ///< chroma subsampling values
73 const AVPixFmtDescriptor *main_desc; ///< format descriptor for main input
75 double var_values[VAR_VARS_NB];
76 char *x_expr, *y_expr;
78 AVExpr *x_pexpr, *y_pexpr;
80 int (*blend_row[4])(uint8_t *d, uint8_t *da, uint8_t *s, uint8_t *a, int w,
82 int (*blend_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
85 void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format,
86 int alpha_format, int main_has_alpha);
88 #endif /* AVFILTER_OVERLAY_H */