FFmpeg
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
vf_geq.c File Reference

Generic equation change filter Originally written by Michael Niedermayer for the MPlayer project, and ported by Clément Bœsch for FFmpeg. More...

#include "libavutil/avstring.h"
#include "libavutil/eval.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  GEQContext
 

Macros

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

Enumerations

enum  {
  VAR_X, VAR_Y, VAR_W, VAR_H,
  VAR_N, VAR_SW, VAR_SH, VAR_T,
  VAR_VARS_NB
}
 

Functions

 AVFILTER_DEFINE_CLASS (geq)
 
static double getpix (void *priv, double x, double y, int plane)
 
static double lum (void *priv, double x, double y)
 
static double cb (void *priv, double x, double y)
 
static double cr (void *priv, double x, double y)
 
static double alpha (void *priv, double x, double y)
 
static av_cold int geq_init (AVFilterContext *ctx, const char *args)
 
static int geq_query_formats (AVFilterContext *ctx)
 
static int geq_config_props (AVFilterLink *inlink)
 
static int geq_filter_frame (AVFilterLink *inlink, AVFilterBufferRef *in)
 
static av_cold void geq_uninit (AVFilterContext *ctx)
 

Variables

static const AVOption geq_options []
 
static const char *const var_names [] = { "X", "Y", "W", "H", "N", "SW", "SH", "T", NULL }
 
static const AVFilterPad geq_inputs []
 
static const AVFilterPad geq_outputs []
 
AVFilter avfilter_vf_geq
 

Detailed Description

Generic equation change filter Originally written by Michael Niedermayer for the MPlayer project, and ported by Clément Bœsch for FFmpeg.

Definition in file vf_geq.c.

Macro Definition Documentation

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

Definition at line 45 of file vf_geq.c.

Definition at line 46 of file vf_geq.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
VAR_X 
VAR_Y 
VAR_W 
VAR_H 
VAR_N 
VAR_SW 
VAR_SH 
VAR_T 
VAR_VARS_NB 

Definition at line 89 of file vf_geq.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( geq  )
static double getpix ( void priv,
double  x,
double  y,
int  plane 
)
inlinestatic

Definition at line 58 of file vf_geq.c.

Referenced by alpha(), cb(), cr(), and lum().

static double lum ( void priv,
double  x,
double  y 
)
static

Definition at line 83 of file vf_geq.c.

Referenced by blend_subrect(), and geq_init().

static double cb ( void priv,
double  x,
double  y 
)
static
static double cr ( void priv,
double  x,
double  y 
)
static
static double alpha ( void priv,
double  x,
double  y 
)
static
static av_cold int geq_init ( AVFilterContext ctx,
const char *  args 
)
static

Definition at line 91 of file vf_geq.c.

static int geq_query_formats ( AVFilterContext ctx)
static

Definition at line 142 of file vf_geq.c.

static int geq_config_props ( AVFilterLink inlink)
static

Definition at line 155 of file vf_geq.c.

static int geq_filter_frame ( AVFilterLink inlink,
AVFilterBufferRef in 
)
static

Definition at line 166 of file vf_geq.c.

static av_cold void geq_uninit ( AVFilterContext ctx)
static

Definition at line 211 of file vf_geq.c.

Variable Documentation

const AVOption geq_options[]
static
Initial value:
= {
{ "lum_expr", "set luminance expression", OFFSET(expr_str[0]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "cb_expr", "set chroma blue expression", OFFSET(expr_str[1]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "cr_expr", "set chroma red expression", OFFSET(expr_str[2]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "alpha_expr", "set alpha expression", OFFSET(expr_str[3]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{NULL},
}

Definition at line 48 of file vf_geq.c.

const char* const var_names[] = { "X", "Y", "W", "H", "N", "SW", "SH", "T", NULL }
static

Definition at line 88 of file vf_geq.c.

Referenced by geq_init().

const AVFilterPad geq_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = geq_config_props,
.filter_frame = geq_filter_frame,
.min_perms = AV_PERM_READ,
},
{ NULL }
}

Definition at line 221 of file vf_geq.c.

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

Definition at line 232 of file vf_geq.c.

AVFilter avfilter_vf_geq
Initial value:
= {
.name = "geq",
.description = NULL_IF_CONFIG_SMALL("Apply generic equation to each pixel."),
.priv_size = sizeof(GEQContext),
.priv_class = &geq_class,
}

Definition at line 240 of file vf_geq.c.