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

Go to the source code of this file.

Data Structures

struct  PreMultiplyContext
 

Macros

#define OFFSET(x)   offsetof(PreMultiplyContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define premultiply_options   options
 

Functions

 AVFILTER_DEFINE_CLASS (premultiply)
 
static int query_formats (AVFilterContext *ctx)
 
static void premultiply8 (const uint8_t *msrc, const uint8_t *asrc, uint8_t *dst, ptrdiff_t mlinesize, ptrdiff_t alinesize, ptrdiff_t dlinesize, int w, int h, int half, int shift, int offset)
 
static void premultiply8yuv (const uint8_t *msrc, const uint8_t *asrc, uint8_t *dst, ptrdiff_t mlinesize, ptrdiff_t alinesize, ptrdiff_t dlinesize, int w, int h, int half, int shift, int offset)
 
static void premultiply8offset (const uint8_t *msrc, const uint8_t *asrc, uint8_t *dst, ptrdiff_t mlinesize, ptrdiff_t alinesize, ptrdiff_t dlinesize, int w, int h, int half, int shift, int offset)
 
static void premultiply16 (const uint8_t *mmsrc, const uint8_t *aasrc, uint8_t *ddst, ptrdiff_t mlinesize, ptrdiff_t alinesize, ptrdiff_t dlinesize, int w, int h, int half, int shift, int offset)
 
static void premultiply16yuv (const uint8_t *mmsrc, const uint8_t *aasrc, uint8_t *ddst, ptrdiff_t mlinesize, ptrdiff_t alinesize, ptrdiff_t dlinesize, int w, int h, int half, int shift, int offset)
 
static void premultiply16offset (const uint8_t *mmsrc, const uint8_t *aasrc, uint8_t *ddst, ptrdiff_t mlinesize, ptrdiff_t alinesize, ptrdiff_t dlinesize, int w, int h, int half, int shift, int offset)
 
static void unpremultiply8 (const uint8_t *msrc, const uint8_t *asrc, uint8_t *dst, ptrdiff_t mlinesize, ptrdiff_t alinesize, ptrdiff_t dlinesize, int w, int h, int half, int max, int offset)
 
static void unpremultiply8yuv (const uint8_t *msrc, const uint8_t *asrc, uint8_t *dst, ptrdiff_t mlinesize, ptrdiff_t alinesize, ptrdiff_t dlinesize, int w, int h, int half, int max, int offset)
 
static void unpremultiply8offset (const uint8_t *msrc, const uint8_t *asrc, uint8_t *dst, ptrdiff_t mlinesize, ptrdiff_t alinesize, ptrdiff_t dlinesize, int w, int h, int half, int max, int offset)
 
static void unpremultiply16 (const uint8_t *mmsrc, const uint8_t *aasrc, uint8_t *ddst, ptrdiff_t mlinesize, ptrdiff_t alinesize, ptrdiff_t dlinesize, int w, int h, int half, int max, int offset)
 
static void unpremultiply16yuv (const uint8_t *mmsrc, const uint8_t *aasrc, uint8_t *ddst, ptrdiff_t mlinesize, ptrdiff_t alinesize, ptrdiff_t dlinesize, int w, int h, int half, int max, int offset)
 
static void unpremultiply16offset (const uint8_t *mmsrc, const uint8_t *aasrc, uint8_t *ddst, ptrdiff_t mlinesize, ptrdiff_t alinesize, ptrdiff_t dlinesize, int w, int h, int half, int max, int offset)
 
static int filter_frame (AVFilterContext *ctx, AVFrame **out, AVFrame *base, AVFrame *alpha)
 
static int process_frame (FFFrameSync *fs)
 
static int config_input (AVFilterLink *inlink)
 
static int config_output (AVFilterLink *outlink)
 
static int activate (AVFilterContext *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption options []
 
static const AVFilterPad premultiply_outputs []
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 50 of file vf_premultiply.c.

◆ FLAGS

Definition at line 51 of file vf_premultiply.c.

◆ premultiply_options

#define premultiply_options   options

Definition at line 59 of file vf_premultiply.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( premultiply  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 62 of file vf_premultiply.c.

◆ premultiply8()

static void premultiply8 ( const uint8_t msrc,
const uint8_t asrc,
uint8_t dst,
ptrdiff_t  mlinesize,
ptrdiff_t  alinesize,
ptrdiff_t  dlinesize,
int  w,
int  h,
int  half,
int  shift,
int  offset 
)
static

Definition at line 88 of file vf_premultiply.c.

Referenced by filter_frame().

◆ premultiply8yuv()

static void premultiply8yuv ( const uint8_t msrc,
const uint8_t asrc,
uint8_t dst,
ptrdiff_t  mlinesize,
ptrdiff_t  alinesize,
ptrdiff_t  dlinesize,
int  w,
int  h,
int  half,
int  shift,
int  offset 
)
static

Definition at line 108 of file vf_premultiply.c.

Referenced by filter_frame().

◆ premultiply8offset()

static void premultiply8offset ( const uint8_t msrc,
const uint8_t asrc,
uint8_t dst,
ptrdiff_t  mlinesize,
ptrdiff_t  alinesize,
ptrdiff_t  dlinesize,
int  w,
int  h,
int  half,
int  shift,
int  offset 
)
static

Definition at line 128 of file vf_premultiply.c.

Referenced by filter_frame().

◆ premultiply16()

static void premultiply16 ( const uint8_t mmsrc,
const uint8_t aasrc,
uint8_t ddst,
ptrdiff_t  mlinesize,
ptrdiff_t  alinesize,
ptrdiff_t  dlinesize,
int  w,
int  h,
int  half,
int  shift,
int  offset 
)
static

Definition at line 148 of file vf_premultiply.c.

Referenced by filter_frame().

◆ premultiply16yuv()

static void premultiply16yuv ( const uint8_t mmsrc,
const uint8_t aasrc,
uint8_t ddst,
ptrdiff_t  mlinesize,
ptrdiff_t  alinesize,
ptrdiff_t  dlinesize,
int  w,
int  h,
int  half,
int  shift,
int  offset 
)
static

Definition at line 171 of file vf_premultiply.c.

Referenced by filter_frame().

◆ premultiply16offset()

static void premultiply16offset ( const uint8_t mmsrc,
const uint8_t aasrc,
uint8_t ddst,
ptrdiff_t  mlinesize,
ptrdiff_t  alinesize,
ptrdiff_t  dlinesize,
int  w,
int  h,
int  half,
int  shift,
int  offset 
)
static

Definition at line 194 of file vf_premultiply.c.

Referenced by filter_frame().

◆ unpremultiply8()

static void unpremultiply8 ( const uint8_t msrc,
const uint8_t asrc,
uint8_t dst,
ptrdiff_t  mlinesize,
ptrdiff_t  alinesize,
ptrdiff_t  dlinesize,
int  w,
int  h,
int  half,
int  max,
int  offset 
)
static

Definition at line 217 of file vf_premultiply.c.

Referenced by filter_frame().

◆ unpremultiply8yuv()

static void unpremultiply8yuv ( const uint8_t msrc,
const uint8_t asrc,
uint8_t dst,
ptrdiff_t  mlinesize,
ptrdiff_t  alinesize,
ptrdiff_t  dlinesize,
int  w,
int  h,
int  half,
int  max,
int  offset 
)
static

Definition at line 240 of file vf_premultiply.c.

Referenced by filter_frame().

◆ unpremultiply8offset()

static void unpremultiply8offset ( const uint8_t msrc,
const uint8_t asrc,
uint8_t dst,
ptrdiff_t  mlinesize,
ptrdiff_t  alinesize,
ptrdiff_t  dlinesize,
int  w,
int  h,
int  half,
int  max,
int  offset 
)
static

Definition at line 263 of file vf_premultiply.c.

Referenced by filter_frame().

◆ unpremultiply16()

static void unpremultiply16 ( const uint8_t mmsrc,
const uint8_t aasrc,
uint8_t ddst,
ptrdiff_t  mlinesize,
ptrdiff_t  alinesize,
ptrdiff_t  dlinesize,
int  w,
int  h,
int  half,
int  max,
int  offset 
)
static

Definition at line 286 of file vf_premultiply.c.

Referenced by filter_frame().

◆ unpremultiply16yuv()

static void unpremultiply16yuv ( const uint8_t mmsrc,
const uint8_t aasrc,
uint8_t ddst,
ptrdiff_t  mlinesize,
ptrdiff_t  alinesize,
ptrdiff_t  dlinesize,
int  w,
int  h,
int  half,
int  max,
int  offset 
)
static

Definition at line 312 of file vf_premultiply.c.

Referenced by filter_frame().

◆ unpremultiply16offset()

static void unpremultiply16offset ( const uint8_t mmsrc,
const uint8_t aasrc,
uint8_t ddst,
ptrdiff_t  mlinesize,
ptrdiff_t  alinesize,
ptrdiff_t  dlinesize,
int  w,
int  h,
int  half,
int  max,
int  offset 
)
static

Definition at line 338 of file vf_premultiply.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterContext ctx,
AVFrame **  out,
AVFrame base,
AVFrame alpha 
)
static

Definition at line 364 of file vf_premultiply.c.

Referenced by activate(), and process_frame().

◆ process_frame()

static int process_frame ( FFFrameSync fs)
static

Definition at line 498 of file vf_premultiply.c.

Referenced by config_output().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 518 of file vf_premultiply.c.

Referenced by init().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 545 of file vf_premultiply.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 599 of file vf_premultiply.c.

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 631 of file vf_premultiply.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 667 of file vf_premultiply.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, FLAGS },
{ "inplace","enable inplace mode", OFFSET(inplace), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define FLAGS
static const struct @272 planes[]
#define OFFSET(x)

Definition at line 53 of file vf_premultiply.c.

◆ premultiply_outputs

const AVFilterPad premultiply_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_output(AVFilterLink *outlink)

Definition at line 675 of file vf_premultiply.c.