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

very simple video equalizer More...

#include "libavfilter/internal.h"
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "vf_eq.h"

Go to the source code of this file.

Macros

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

Functions

static void create_lut (EQParameters *param)
 TODO:
 
static void apply_lut (EQParameters *param, uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, int w, int h)
 
static void process_c (EQParameters *param, uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, int w, int h)
 
static void check_values (EQParameters *param, EQContext *eq)
 
static void set_contrast (EQContext *eq)
 
static void set_brightness (EQContext *eq)
 
static void set_gamma (EQContext *eq)
 
static void set_saturation (EQContext *eq)
 
static int initialize (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
 AVFILTER_DEFINE_CLASS (eq)
 

Variables

static const AVFilterPad eq_inputs []
 
static const AVFilterPad eq_outputs []
 
static const AVOption eq_options []
 
AVFilter ff_vf_eq
 

Detailed Description

very simple video equalizer

Definition in file vf_eq.c.

Macro Definition Documentation

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

Definition at line 237 of file vf_eq.c.

Definition at line 238 of file vf_eq.c.

Function Documentation

static void create_lut ( EQParameters param)
static

TODO:

  • Add support to process_command

Definition at line 42 of file vf_eq.c.

Referenced by apply_lut().

static void apply_lut ( EQParameters param,
uint8_t dst,
int  dst_stride,
const uint8_t src,
int  src_stride,
int  w,
int  h 
)
static

Definition at line 67 of file vf_eq.c.

Referenced by check_values().

static void process_c ( EQParameters param,
uint8_t dst,
int  dst_stride,
const uint8_t src,
int  src_stride,
int  w,
int  h 
)
static

Definition at line 82 of file vf_eq.c.

Referenced by initialize().

static void check_values ( EQParameters param,
EQContext eq 
)
static

Definition at line 102 of file vf_eq.c.

Referenced by set_brightness(), set_contrast(), set_gamma(), and set_saturation().

static void set_contrast ( EQContext eq)
static

Definition at line 112 of file vf_eq.c.

Referenced by initialize().

static void set_brightness ( EQContext eq)
static

Definition at line 119 of file vf_eq.c.

Referenced by initialize().

static void set_gamma ( EQContext eq)
static

Definition at line 126 of file vf_eq.c.

Referenced by initialize().

static void set_saturation ( EQContext eq)
static

Definition at line 140 of file vf_eq.c.

Referenced by initialize().

static int initialize ( AVFilterContext ctx)
static

Definition at line 150 of file vf_eq.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 167 of file vf_eq.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 184 of file vf_eq.c.

AVFILTER_DEFINE_CLASS ( eq  )

Variable Documentation

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

Definition at line 220 of file vf_eq.c.

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

Definition at line 229 of file vf_eq.c.

const AVOption eq_options[]
static
Initial value:
= {
{ "contrast", "set the contrast adjustment, negative values give a negative image",
OFFSET(contrast), AV_OPT_TYPE_DOUBLE, {.dbl = 1.0}, -2.0, 2.0, FLAGS },
{ "brightness", "set the brightness adjustment",
OFFSET(brightness), AV_OPT_TYPE_DOUBLE, {.dbl = 0.0}, -1.0, 1.0, FLAGS },
{ "saturation", "set the saturation adjustment",
OFFSET(saturation), AV_OPT_TYPE_DOUBLE, {.dbl = 1.0}, 0.0, 3.0, FLAGS },
{ "gamma", "set the initial gamma value",
OFFSET(gamma), AV_OPT_TYPE_DOUBLE, {.dbl = 1.0}, 0.1, 10.0, FLAGS },
{ "gamma_r", "gamma value for red",
OFFSET(gamma_r), AV_OPT_TYPE_DOUBLE, {.dbl = 1.0}, 0.1, 10.0, FLAGS },
{ "gamma_g", "gamma value for green",
OFFSET(gamma_g), AV_OPT_TYPE_DOUBLE, {.dbl = 1.0}, 0.1, 10.0, FLAGS },
{ "gamma_b", "gamma value for blue",
OFFSET(gamma_b), AV_OPT_TYPE_DOUBLE, {.dbl = 1.0}, 0.1, 10.0, FLAGS },
{ "gamma_weight", "set the gamma weight which reduces the effect of gamma on bright areas",
OFFSET(gamma_weight), AV_OPT_TYPE_DOUBLE, {.dbl = 1.0}, 0.0, 1.0, FLAGS },
{ NULL }
}

Definition at line 240 of file vf_eq.c.

AVFilter ff_vf_eq
Initial value:
= {
.name = "eq",
.description = NULL_IF_CONFIG_SMALL("Adjust brightness, contrast, gamma, and saturation."),
.priv_size = sizeof(EQContext),
.priv_class = &eq_class,
}

Definition at line 262 of file vf_eq.c.