FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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  ThreadData
 Used for passing data between threads. More...
 
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 premultiply_slice (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
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

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

Definition at line 54 of file vf_premultiply.c.

Definition at line 55 of file vf_premultiply.c.

#define premultiply_options   options

Definition at line 63 of file vf_premultiply.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( premultiply  )
static int query_formats ( AVFilterContext ctx)
static

Definition at line 66 of file vf_premultiply.c.

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 92 of file vf_premultiply.c.

Referenced by filter_frame().

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 112 of file vf_premultiply.c.

Referenced by filter_frame().

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 132 of file vf_premultiply.c.

Referenced by filter_frame().

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 152 of file vf_premultiply.c.

Referenced by filter_frame().

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 175 of file vf_premultiply.c.

Referenced by filter_frame().

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 198 of file vf_premultiply.c.

Referenced by filter_frame().

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 221 of file vf_premultiply.c.

Referenced by filter_frame().

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 244 of file vf_premultiply.c.

Referenced by filter_frame().

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 267 of file vf_premultiply.c.

Referenced by filter_frame().

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 290 of file vf_premultiply.c.

Referenced by filter_frame().

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 316 of file vf_premultiply.c.

Referenced by filter_frame().

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 342 of file vf_premultiply.c.

Referenced by filter_frame().

static int premultiply_slice ( AVFilterContext ctx,
void arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 368 of file vf_premultiply.c.

Referenced by filter_frame().

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

Definition at line 403 of file vf_premultiply.c.

Referenced by activate(), and process_frame().

static int process_frame ( FFFrameSync fs)
static

Definition at line 531 of file vf_premultiply.c.

Referenced by config_output().

static int config_input ( AVFilterLink inlink)
static

Definition at line 551 of file vf_premultiply.c.

Referenced by init().

static int config_output ( AVFilterLink outlink)
static

Definition at line 578 of file vf_premultiply.c.

static int activate ( AVFilterContext ctx)
static

Definition at line 632 of file vf_premultiply.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 664 of file vf_premultiply.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 700 of file vf_premultiply.c.

Variable Documentation

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 @304 planes[]
#define OFFSET(x)

Definition at line 57 of file vf_premultiply.c.

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 708 of file vf_premultiply.c.