FFmpeg  4.3
Data Structures | Macros | Functions | Variables
vf_floodfill.c File Reference
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  Points
 
struct  FloodfillContext
 

Macros

#define OFFSET(x)   offsetof(FloodfillContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Functions

static int is_inside (int x, int y, int w, int h)
 
static int is_same4 (AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3)
 
static int is_same4_16 (AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3)
 
static int is_same3 (AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3)
 
static int is_same3_16 (AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3)
 
static int is_same1 (AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3)
 
static int is_same1_16 (AVFrame *frame, int x, int y, unsigned s0, unsigned s1, unsigned s2, unsigned s3)
 
static void set_pixel1 (AVFrame *frame, int x, int y, unsigned d0, unsigned d1, unsigned d2, unsigned d3)
 
static void set_pixel1_16 (AVFrame *frame, int x, int y, unsigned d0, unsigned d1, unsigned d2, unsigned d3)
 
static void set_pixel3 (AVFrame *frame, int x, int y, unsigned d0, unsigned d1, unsigned d2, unsigned d3)
 
static void set_pixel3_16 (AVFrame *frame, int x, int y, unsigned d0, unsigned d1, unsigned d2, unsigned d3)
 
static void set_pixel4 (AVFrame *frame, int x, int y, unsigned d0, unsigned d1, unsigned d2, unsigned d3)
 
static void set_pixel4_16 (AVFrame *frame, int x, int y, unsigned d0, unsigned d1, unsigned d2, unsigned d3)
 
static void pick_pixel1 (AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3)
 
static void pick_pixel1_16 (AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3)
 
static void pick_pixel3 (AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3)
 
static void pick_pixel3_16 (AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3)
 
static void pick_pixel4 (AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3)
 
static void pick_pixel4_16 (AVFrame *frame, int x, int y, int *s0, int *s1, int *s2, int *s3)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *link, AVFrame *frame)
 
static av_cold int query_formats (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (floodfill)
 

Variables

static const AVFilterPad floodfill_inputs []
 
static const AVFilterPad floodfill_outputs []
 
static const AVOption floodfill_options []
 
AVFilter ff_vf_floodfill
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(FloodfillContext, x)

Definition at line 404 of file vf_floodfill.c.

◆ FLAGS

Definition at line 405 of file vf_floodfill.c.

Function Documentation

◆ is_inside()

static int is_inside ( int  x,
int  y,
int  w,
int  h 
)
static

Definition at line 53 of file vf_floodfill.c.

Referenced by filter_frame().

◆ is_same4()

static int is_same4 ( AVFrame frame,
int  x,
int  y,
unsigned  s0,
unsigned  s1,
unsigned  s2,
unsigned  s3 
)
static

Definition at line 60 of file vf_floodfill.c.

Referenced by config_input().

◆ is_same4_16()

static int is_same4_16 ( AVFrame frame,
int  x,
int  y,
unsigned  s0,
unsigned  s1,
unsigned  s2,
unsigned  s3 
)
static

Definition at line 73 of file vf_floodfill.c.

Referenced by config_input().

◆ is_same3()

static int is_same3 ( AVFrame frame,
int  x,
int  y,
unsigned  s0,
unsigned  s1,
unsigned  s2,
unsigned  s3 
)
static

Definition at line 86 of file vf_floodfill.c.

Referenced by config_input().

◆ is_same3_16()

static int is_same3_16 ( AVFrame frame,
int  x,
int  y,
unsigned  s0,
unsigned  s1,
unsigned  s2,
unsigned  s3 
)
static

Definition at line 98 of file vf_floodfill.c.

Referenced by config_input().

◆ is_same1()

static int is_same1 ( AVFrame frame,
int  x,
int  y,
unsigned  s0,
unsigned  s1,
unsigned  s2,
unsigned  s3 
)
static

Definition at line 110 of file vf_floodfill.c.

Referenced by config_input().

◆ is_same1_16()

static int is_same1_16 ( AVFrame frame,
int  x,
int  y,
unsigned  s0,
unsigned  s1,
unsigned  s2,
unsigned  s3 
)
static

Definition at line 120 of file vf_floodfill.c.

Referenced by config_input().

◆ set_pixel1()

static void set_pixel1 ( AVFrame frame,
int  x,
int  y,
unsigned  d0,
unsigned  d1,
unsigned  d2,
unsigned  d3 
)
static

Definition at line 130 of file vf_floodfill.c.

Referenced by config_input().

◆ set_pixel1_16()

static void set_pixel1_16 ( AVFrame frame,
int  x,
int  y,
unsigned  d0,
unsigned  d1,
unsigned  d2,
unsigned  d3 
)
static

Definition at line 136 of file vf_floodfill.c.

Referenced by config_input().

◆ set_pixel3()

static void set_pixel3 ( AVFrame frame,
int  x,
int  y,
unsigned  d0,
unsigned  d1,
unsigned  d2,
unsigned  d3 
)
static

Definition at line 142 of file vf_floodfill.c.

Referenced by config_input().

◆ set_pixel3_16()

static void set_pixel3_16 ( AVFrame frame,
int  x,
int  y,
unsigned  d0,
unsigned  d1,
unsigned  d2,
unsigned  d3 
)
static

Definition at line 150 of file vf_floodfill.c.

Referenced by config_input().

◆ set_pixel4()

static void set_pixel4 ( AVFrame frame,
int  x,
int  y,
unsigned  d0,
unsigned  d1,
unsigned  d2,
unsigned  d3 
)
static

Definition at line 158 of file vf_floodfill.c.

Referenced by config_input().

◆ set_pixel4_16()

static void set_pixel4_16 ( AVFrame frame,
int  x,
int  y,
unsigned  d0,
unsigned  d1,
unsigned  d2,
unsigned  d3 
)
static

Definition at line 167 of file vf_floodfill.c.

Referenced by config_input().

◆ pick_pixel1()

static void pick_pixel1 ( AVFrame frame,
int  x,
int  y,
int s0,
int s1,
int s2,
int s3 
)
static

Definition at line 176 of file vf_floodfill.c.

Referenced by config_input().

◆ pick_pixel1_16()

static void pick_pixel1_16 ( AVFrame frame,
int  x,
int  y,
int s0,
int s1,
int s2,
int s3 
)
static

Definition at line 183 of file vf_floodfill.c.

Referenced by config_input().

◆ pick_pixel3()

static void pick_pixel3 ( AVFrame frame,
int  x,
int  y,
int s0,
int s1,
int s2,
int s3 
)
static

Definition at line 190 of file vf_floodfill.c.

Referenced by config_input().

◆ pick_pixel3_16()

static void pick_pixel3_16 ( AVFrame frame,
int  x,
int  y,
int s0,
int s1,
int s2,
int s3 
)
static

Definition at line 201 of file vf_floodfill.c.

Referenced by config_input().

◆ pick_pixel4()

static void pick_pixel4 ( AVFrame frame,
int  x,
int  y,
int s0,
int s1,
int s2,
int s3 
)
static

Definition at line 212 of file vf_floodfill.c.

Referenced by config_input().

◆ pick_pixel4_16()

static void pick_pixel4_16 ( AVFrame frame,
int  x,
int  y,
int s0,
int s1,
int s2,
int s3 
)
static

Definition at line 225 of file vf_floodfill.c.

Referenced by config_input().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 238 of file vf_floodfill.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink link,
AVFrame frame 
)
static

Definition at line 281 of file vf_floodfill.c.

◆ query_formats()

static av_cold int query_formats ( AVFilterContext ctx)
static

Definition at line 358 of file vf_floodfill.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 379 of file vf_floodfill.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( floodfill  )

Variable Documentation

◆ floodfill_inputs

const AVFilterPad floodfill_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
},
{ NULL }
}

Definition at line 386 of file vf_floodfill.c.

◆ floodfill_outputs

const AVFilterPad floodfill_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}

Definition at line 396 of file vf_floodfill.c.

◆ floodfill_options

const AVOption floodfill_options[]
static
Initial value:
= {
{ "x", "set pixel x coordinate", OFFSET(x), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS },
{ "y", "set pixel y coordinate", OFFSET(y), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS },
{ "s0", "set source #0 component value", OFFSET(s[0]), AV_OPT_TYPE_INT, {.i64=0},-1, UINT16_MAX, FLAGS },
{ "s1", "set source #1 component value", OFFSET(s[1]), AV_OPT_TYPE_INT, {.i64=0},-1, UINT16_MAX, FLAGS },
{ "s2", "set source #2 component value", OFFSET(s[2]), AV_OPT_TYPE_INT, {.i64=0},-1, UINT16_MAX, FLAGS },
{ "s3", "set source #3 component value", OFFSET(s[3]), AV_OPT_TYPE_INT, {.i64=0},-1, UINT16_MAX, FLAGS },
{ "d0", "set destination #0 component value", OFFSET(d[0]), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS },
{ "d1", "set destination #1 component value", OFFSET(d[1]), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS },
{ "d2", "set destination #2 component value", OFFSET(d[2]), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS },
{ "d3", "set destination #3 component value", OFFSET(d[3]), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS },
{ NULL }
}

Definition at line 407 of file vf_floodfill.c.

◆ ff_vf_floodfill

AVFilter ff_vf_floodfill
Initial value:
= {
.name = "floodfill",
.description = NULL_IF_CONFIG_SMALL("Fill area with same color with another color."),
.priv_size = sizeof(FloodfillContext),
.priv_class = &floodfill_class,
}

Definition at line 423 of file vf_floodfill.c.

query_formats
static av_cold int query_formats(AVFilterContext *ctx)
Definition: vf_floodfill.c:358
floodfill_inputs
static const AVFilterPad floodfill_inputs[]
Definition: vf_floodfill.c:386
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_floodfill.c:379
x
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 x
Definition: fate.txt:150
s
#define s(width, name)
Definition: cbs_vp9.c:257
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_floodfill.c:238
NULL
#define NULL
Definition: coverity.c:32
filter_frame
static int filter_frame(AVFilterLink *link, AVFrame *frame)
Definition: vf_floodfill.c:281
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
FLAGS
#define FLAGS
Definition: vf_floodfill.c:405
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:186
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:125
OFFSET
#define OFFSET(x)
Definition: vf_floodfill.c:404
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:564
floodfill_outputs
static const AVFilterPad floodfill_outputs[]
Definition: vf_floodfill.c:396
FloodfillContext
Definition: vf_floodfill.c:33