FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_geq.c File Reference
#include "libavutil/avassert.h"
#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
 
struct  ThreadData
 Used for passing data between threads. More...
 

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
}
 
enum  {
  Y = 0, U, V, A,
  G, B, R
}
 

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 slice_geq_filter (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int geq_filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void geq_uninit (AVFilterContext *ctx)
 

Variables

static const char *const var_names [] = { "X", "Y", "W", "H", "N", "SW", "SH", "T", NULL }
 
static const AVOption geq_options []
 
static const AVFilterPad geq_inputs []
 
static const AVFilterPad geq_outputs []
 
AVFilter ff_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

◆ OFFSET

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

Definition at line 55 of file vf_geq.c.

◆ FLAGS

Definition at line 56 of file vf_geq.c.

Enumeration Type Documentation

◆ anonymous enum

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 37 of file vf_geq.c.

◆ anonymous enum

anonymous enum
Enumerator

Definition at line 53 of file vf_geq.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( geq  )

◆ getpix()

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

Definition at line 78 of file vf_geq.c.

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

◆ lum()

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

Definition at line 111 of file vf_geq.c.

Referenced by geq_init().

◆ cb()

static double cb ( void *  priv,
double  x,
double  y 
)
static

◆ cr()

static double cr ( void *  priv,
double  x,
double  y 
)
static

◆ alpha()

static double alpha ( void *  priv,
double  x,
double  y 
)
static

Definition at line 114 of file vf_geq.c.

Referenced by geq_init().

◆ geq_init()

static av_cold int geq_init ( AVFilterContext ctx)
static

Definition at line 116 of file vf_geq.c.

◆ geq_query_formats()

static int geq_query_formats ( AVFilterContext ctx)
static

Definition at line 181 of file vf_geq.c.

◆ geq_config_props()

static int geq_config_props ( AVFilterLink inlink)
static

Definition at line 223 of file vf_geq.c.

◆ slice_geq_filter()

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

Definition at line 244 of file vf_geq.c.

Referenced by geq_filter_frame().

◆ geq_filter_frame()

static int geq_filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 292 of file vf_geq.c.

◆ geq_uninit()

static av_cold void geq_uninit ( AVFilterContext ctx)
static

Definition at line 338 of file vf_geq.c.

Variable Documentation

◆ var_names

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

Definition at line 36 of file vf_geq.c.

Referenced by geq_init().

◆ geq_options

const AVOption geq_options[]
static
Initial value:
= {
{ "lum_expr", "set luminance expression", OFFSET(expr_str[Y]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "lum", "set luminance expression", OFFSET(expr_str[Y]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "cb_expr", "set chroma blue expression", OFFSET(expr_str[U]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "cb", "set chroma blue expression", OFFSET(expr_str[U]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "cr_expr", "set chroma red expression", OFFSET(expr_str[V]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "cr", "set chroma red expression", OFFSET(expr_str[V]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "alpha_expr", "set alpha expression", OFFSET(expr_str[A]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "a", "set alpha expression", OFFSET(expr_str[A]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "red_expr", "set red expression", OFFSET(expr_str[R]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "r", "set red expression", OFFSET(expr_str[R]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "green_expr", "set green expression", OFFSET(expr_str[G]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "g", "set green expression", OFFSET(expr_str[G]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "blue_expr", "set blue expression", OFFSET(expr_str[B]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "b", "set blue expression", OFFSET(expr_str[B]), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS },
{NULL},
}

Definition at line 58 of file vf_geq.c.

◆ geq_inputs

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

Definition at line 347 of file vf_geq.c.

◆ geq_outputs

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

Definition at line 357 of file vf_geq.c.

◆ ff_vf_geq

AVFilter ff_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 365 of file vf_geq.c.

U
@ U
Definition: vf_geq.c:53
A
@ A
Definition: vf_geq.c:53
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
geq_query_formats
static int geq_query_formats(AVFilterContext *ctx)
Definition: vf_geq.c:181
geq_uninit
static av_cold void geq_uninit(AVFilterContext *ctx)
Definition: vf_geq.c:338
geq_outputs
static const AVFilterPad geq_outputs[]
Definition: vf_geq.c:357
Y
@ Y
Definition: vf_geq.c:53
B
@ B
Definition: vf_geq.c:53
geq_config_props
static int geq_config_props(AVFilterLink *inlink)
Definition: vf_geq.c:223
R
@ R
Definition: vf_geq.c:53
OFFSET
#define OFFSET(x)
Definition: vf_geq.c:55
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
NULL
#define NULL
Definition: coverity.c:32
inputs
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: filter_design.txt:243
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:188
geq_init
static av_cold int geq_init(AVFilterContext *ctx)
Definition: vf_geq.c:116
FLAGS
#define FLAGS
Definition: vf_geq.c:56
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:125
GEQContext
Definition: vf_geq.c:39
V
@ V
Definition: vf_geq.c:53
geq_filter_frame
static int geq_filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_geq.c:292
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:116
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: aeval.c:244
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:565
uninit
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:279
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:227
G
@ G
Definition: vf_geq.c:53
geq_inputs
static const AVFilterPad geq_inputs[]
Definition: vf_geq.c:347