FFmpeg
Data Structures | Macros | Functions | Variables
vf_multiply.c File Reference
#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "framesync.h"

Go to the source code of this file.

Data Structures

struct  MultiplyContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

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

Functions

static int config_input (AVFilterLink *inlink)
 
static void multiply (const uint8_t *ssrc, const uint8_t *rref, uint8_t *ddst, float scale, float offset, int w)
 
static int multiply_slice (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int process_frame (FFFrameSync *fs)
 
static int config_output (AVFilterLink *outlink)
 
static int activate (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (multiply)
 

Variables

static const AVOption multiply_options []
 
static enum AVPixelFormat pix_fmts []
 
static const AVFilterPad multiply_inputs []
 
static const AVFilterPad multiply_outputs []
 
const AVFilter ff_vf_multiply
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 43 of file vf_multiply.c.

◆ FLAGS

Definition at line 44 of file vf_multiply.c.

Function Documentation

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 62 of file vf_multiply.c.

◆ multiply()

static void multiply ( const uint8_t *  ssrc,
const uint8_t *  rref,
uint8_t *  ddst,
float  scale,
float  offset,
int  w 
)
static

Definition at line 75 of file vf_multiply.c.

Referenced by multiply_slice().

◆ multiply_slice()

static int multiply_slice ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 89 of file vf_multiply.c.

Referenced by process_frame().

◆ process_frame()

static int process_frame ( FFFrameSync fs)
static

Definition at line 126 of file vf_multiply.c.

Referenced by config_output().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 162 of file vf_multiply.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 206 of file vf_multiply.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 212 of file vf_multiply.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( multiply  )

Variable Documentation

◆ multiply_options

const AVOption multiply_options[]
static
Initial value:
= {
{ "scale", "set scale", OFFSET(scale), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0., 9., FLAGS },
{ "offset", "set offset", OFFSET(offset), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, -1., 1., FLAGS },
{ "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_FLAGS, {.i64=0xF}, 0., 0xF, FLAGS },
{ NULL }
}

Definition at line 50 of file vf_multiply.c.

◆ pix_fmts

enum AVPixelFormat pix_fmts[]
static
Initial value:

Definition at line 57 of file vf_multiply.c.

◆ multiply_inputs

const AVFilterPad multiply_inputs[]
static
Initial value:
= {
{
.name = "source",
.config_props = config_input,
},
{
.name = "factor",
},
}

Definition at line 219 of file vf_multiply.c.

◆ multiply_outputs

const AVFilterPad multiply_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
}

Definition at line 231 of file vf_multiply.c.

◆ ff_vf_multiply

const AVFilter ff_vf_multiply
Initial value:
= {
.name = "multiply",
.description = NULL_IF_CONFIG_SMALL("Multiply first video stream with second video stream."),
.priv_class = &multiply_class,
.priv_size = sizeof(MultiplyContext),
.process_command = ff_filter_process_command,
}

Definition at line 241 of file vf_multiply.c.

FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:170
OFFSET
#define OFFSET(x)
Definition: vf_multiply.c:43
scale
static av_always_inline float scale(float x, float s)
Definition: vf_v360.c:1389
multiply_inputs
static const AVFilterPad multiply_inputs[]
Definition: vf_multiply.c:219
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:190
NULL
#define NULL
Definition: coverity.c:32
MultiplyContext
Definition: vf_multiply.c:30
multiply_outputs
static const AVFilterPad multiply_outputs[]
Definition: vf_multiply.c:231
FLAGS
#define FLAGS
Definition: vf_multiply.c:44
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_multiply.c:212
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: vf_multiply.c:57
planes
static const struct @335 planes[]
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:117
AV_PIX_FMT_GBRPF32
#define AV_PIX_FMT_GBRPF32
Definition: pixfmt.h:440
ff_filter_process_command
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Definition: avfilter.c:863
offset
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
Definition: writing_filters.txt:86
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:228
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_PIX_FMT_GBRAPF32
#define AV_PIX_FMT_GBRAPF32
Definition: pixfmt.h:441
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_multiply.c:162
activate
static int activate(AVFilterContext *ctx)
Definition: vf_multiply.c:206
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:127
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
AV_OPT_TYPE_FLAGS
@ AV_OPT_TYPE_FLAGS
Definition: opt.h:224
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:160
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_multiply.c:62