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"
Include dependency graph for vf_geq.c:

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)
 
static int geq_query_formats (AVFilterContext *ctx)
 
static int geq_config_props (AVFilterLink *inlink)
 
static int geq_filter_frame (AVFilterLink *inlink, AVFrame *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

Definition at line 46 of file vf_geq.c.

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

Definition at line 45 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 cb ( void priv,
double  x,
double  y 
)
static

Definition at line 84 of file vf_geq.c.

Referenced by geq_init().

static int geq_config_props ( AVFilterLink inlink)
static

Definition at line 148 of file vf_geq.c.

static int geq_filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 159 of file vf_geq.c.

static av_cold int geq_init ( AVFilterContext ctx)
static

Definition at line 91 of file vf_geq.c.

static int geq_query_formats ( AVFilterContext ctx)
static

Definition at line 135 of file vf_geq.c.

static av_cold void geq_uninit ( AVFilterContext ctx)
static

Definition at line 204 of file vf_geq.c.

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 av_picture_pad(), blend_subrect(), and geq_init().

Variable Documentation

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,
}
static const AVFilterPad geq_inputs[]
Definition: vf_geq.c:213
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:117
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static av_cold void geq_uninit(AVFilterContext *ctx)
Definition: vf_geq.c:204
static const AVFilterPad geq_outputs[]
Definition: vf_geq.c:223
static int query_formats(AVFilterContext *ctx)
Definition: af_aconvert.c:73
static int geq_query_formats(AVFilterContext *ctx)
Definition: vf_geq.c:135
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:334
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_cold int geq_init(AVFilterContext *ctx)
Definition: vf_geq.c:91
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 at line 231 of file vf_geq.c.

const AVFilterPad geq_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = geq_config_props,
.filter_frame = geq_filter_frame,
},
{ NULL }
}
static int geq_config_props(AVFilterLink *inlink)
Definition: vf_geq.c:148
NULL
Definition: eval.c:55
static int geq_filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_geq.c:159

Definition at line 213 of file vf_geq.c.

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},
}
#define OFFSET(x)
Definition: vf_geq.c:45
NULL
Definition: eval.c:55
#define FLAGS
Definition: vf_geq.c:46

Definition at line 48 of file vf_geq.c.

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

Definition at line 223 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().