FFmpeg  4.3
vf_overlay.h
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
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.
8  *
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.
13  *
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
17  */
18 
19 #ifndef AVFILTER_OVERLAY_H
20 #define AVFILTER_OVERLAY_H
21 
22 #include "libavutil/eval.h"
23 #include "libavutil/pixdesc.h"
24 #include "framesync.h"
25 #include "avfilter.h"
26 
27 enum var_name {
40 };
41 
50 };
51 
52 typedef struct OverlayContext {
53  const AVClass *class;
54  int x, y; ///< position of overlaid picture
55 
62  int format; ///< OverlayFormat
64  int eval_mode; ///< EvalMode
65 
67 
68  int main_pix_step[4]; ///< steps per pixel for each plane of the main output
69  int overlay_pix_step[4]; ///< steps per pixel for each plane of the overlay
70  int hsub, vsub; ///< chroma subsampling values
71  const AVPixFmtDescriptor *main_desc; ///< format descriptor for main input
72 
74  char *x_expr, *y_expr;
75 
77 
78  int (*blend_row[4])(uint8_t *d, uint8_t *da, uint8_t *s, uint8_t *a, int w,
79  ptrdiff_t alinesize);
80  int (*blend_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
82 
83 void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format,
84  int alpha_format, int main_has_alpha);
85 
86 #endif /* AVFILTER_OVERLAY_H */
OverlayContext::blend_slice
int(* blend_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
Definition: vf_overlay.h:80
VAR_N
@ VAR_N
Definition: vf_overlay.h:36
VAR_OW
@ VAR_OW
Definition: vf_overlay.h:30
OverlayFormat
OverlayFormat
Definition: vf_overlay.h:42
pixdesc.h
VAR_X
@ VAR_X
Definition: vf_overlay.h:34
OverlayContext::var_values
double var_values[VAR_VARS_NB]
Definition: vf_overlay.h:73
OverlayContext::y
int y
position of overlaid picture
Definition: vf_overlay.h:54
OverlayContext::main_desc
const AVPixFmtDescriptor * main_desc
format descriptor for main input
Definition: vf_overlay.h:71
OverlayContext::y_expr
char * y_expr
Definition: vf_overlay.h:74
FFFrameSync
Frame sync structure.
Definition: framesync.h:146
VAR_VARS_NB
@ VAR_VARS_NB
Definition: vf_overlay.h:39
OVERLAY_FORMAT_RGB
@ OVERLAY_FORMAT_RGB
Definition: vf_overlay.h:46
OverlayContext::vsub
int vsub
chroma subsampling values
Definition: vf_overlay.h:70
ff_overlay_init_x86
void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format, int alpha_format, int main_has_alpha)
Definition: vf_overlay_init.c:35
OverlayContext::eval_mode
int eval_mode
EvalMode.
Definition: vf_overlay.h:64
s
#define s(width, name)
Definition: cbs_vp9.c:257
OverlayContext::alpha_format
int alpha_format
Definition: vf_overlay.h:63
OVERLAY_FORMAT_YUV422
@ OVERLAY_FORMAT_YUV422
Definition: vf_overlay.h:44
format
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 format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
VAR_HSUB
@ VAR_HSUB
Definition: vf_overlay.h:32
OverlayContext::x_expr
char * x_expr
Definition: vf_overlay.h:74
OverlayContext::main_is_packed_rgb
uint8_t main_is_packed_rgb
Definition: vf_overlay.h:56
VAR_MW
@ VAR_MW
Definition: vf_overlay.h:28
ctx
AVFormatContext * ctx
Definition: movenc.c:48
AVExpr
Definition: eval.c:157
OverlayContext::x
int x
Definition: vf_overlay.h:54
arg
const char * arg
Definition: jacosubdec.c:66
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:67
VAR_T
@ VAR_T
Definition: vf_overlay.h:38
OverlayContext
Definition: vf_overlay.h:52
eval.h
VAR_MAIN_W
@ VAR_MAIN_W
Definition: vf_overlay.h:28
OverlayContext::overlay_has_alpha
uint8_t overlay_has_alpha
Definition: vf_overlay.h:61
OVERLAY_FORMAT_NB
@ OVERLAY_FORMAT_NB
Definition: vf_overlay.h:49
var_name
var_name
Definition: aeval.c:46
OVERLAY_FORMAT_YUV420
@ OVERLAY_FORMAT_YUV420
Definition: vf_overlay.h:43
VAR_MH
@ VAR_MH
Definition: vf_overlay.h:29
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
VAR_POS
@ VAR_POS
Definition: vf_overlay.h:37
OverlayContext::hsub
int hsub
Definition: vf_overlay.h:70
OverlayContext::main_pix_step
int main_pix_step[4]
steps per pixel for each plane of the main output
Definition: vf_overlay.h:68
OVERLAY_FORMAT_AUTO
@ OVERLAY_FORMAT_AUTO
Definition: vf_overlay.h:48
OverlayContext::overlay_is_packed_rgb
uint8_t overlay_is_packed_rgb
Definition: vf_overlay.h:59
OverlayContext::x_pexpr
AVExpr * x_pexpr
Definition: vf_overlay.h:76
uint8_t
uint8_t
Definition: audio_convert.c:194
VAR_OVERLAY_H
@ VAR_OVERLAY_H
Definition: vf_overlay.h:31
OverlayContext::overlay_rgba_map
uint8_t overlay_rgba_map[4]
Definition: vf_overlay.h:60
w
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo ug o o w
Definition: fate.txt:150
OverlayContext::y_pexpr
AVExpr * y_pexpr
Definition: vf_overlay.h:76
OverlayContext::format
int format
OverlayFormat.
Definition: vf_overlay.h:62
VAR_Y
@ VAR_Y
Definition: vf_overlay.h:35
framesync.h
VAR_VSUB
@ VAR_VSUB
Definition: vf_overlay.h:33
VAR_MAIN_H
@ VAR_MAIN_H
Definition: vf_overlay.h:29
OverlayContext::blend_row
int(* blend_row[4])(uint8_t *d, uint8_t *da, uint8_t *s, uint8_t *a, int w, ptrdiff_t alinesize)
Definition: vf_overlay.h:78
avfilter.h
VAR_OH
@ VAR_OH
Definition: vf_overlay.h:31
AVFilterContext
An instance of a filter.
Definition: avfilter.h:338
OVERLAY_FORMAT_GBRP
@ OVERLAY_FORMAT_GBRP
Definition: vf_overlay.h:47
OverlayContext::fs
FFFrameSync fs
Definition: vf_overlay.h:66
OVERLAY_FORMAT_YUV444
@ OVERLAY_FORMAT_YUV444
Definition: vf_overlay.h:45
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:81
OverlayContext::overlay_pix_step
int overlay_pix_step[4]
steps per pixel for each plane of the overlay
Definition: vf_overlay.h:69
int
int
Definition: ffmpeg_filter.c:192
VAR_OVERLAY_W
@ VAR_OVERLAY_W
Definition: vf_overlay.h:30
OverlayContext::main_has_alpha
uint8_t main_has_alpha
Definition: vf_overlay.h:58
OverlayContext::main_rgba_map
uint8_t main_rgba_map[4]
Definition: vf_overlay.h:57