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 set_expr (AVExpr **pexpr, const char *expr, const char *option, void *log_ctx)
 
static int initialize (AVFilterContext *ctx)
 
static void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 
 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 346 of file vf_eq.c.

Definition at line 347 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(), and process_command().

static void set_brightness ( EQContext eq)
static

Definition at line 120 of file vf_eq.c.

Referenced by initialize(), and process_command().

static void set_gamma ( EQContext eq)
static

Definition at line 128 of file vf_eq.c.

Referenced by initialize(), and process_command().

static void set_saturation ( EQContext eq)
static

Definition at line 149 of file vf_eq.c.

Referenced by initialize(), and process_command().

static int set_expr ( AVExpr **  pexpr,
const char *  expr,
const char *  option,
void log_ctx 
)
static

Definition at line 162 of file vf_eq.c.

Referenced by initialize(), and process_command().

static int initialize ( AVFilterContext ctx)
static

Definition at line 183 of file vf_eq.c.

static void uninit ( AVFilterContext ctx)
static

Definition at line 211 of file vf_eq.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 225 of file vf_eq.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 242 of file vf_eq.c.

static int process_command ( AVFilterContext ctx,
const char *  cmd,
const char *  args,
char *  res,
int  res_len,
int  flags 
)
static

Definition at line 279 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 329 of file vf_eq.c.

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

Definition at line 338 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_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "brightness", "set the brightness adjustment",
OFFSET(brightness_expr), AV_OPT_TYPE_STRING, {.str = "0.0"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "saturation", "set the saturation adjustment",
OFFSET(saturation_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "gamma", "set the initial gamma value",
OFFSET(gamma_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "gamma_r", "gamma value for red",
OFFSET(gamma_r_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "gamma_g", "gamma value for green",
OFFSET(gamma_g_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "gamma_b", "gamma value for blue",
OFFSET(gamma_b_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "gamma_weight", "set the gamma weight which reduces the effect of gamma on bright areas",
OFFSET(gamma_weight_expr), AV_OPT_TYPE_STRING, {.str = "1.0"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ NULL }
}

Definition at line 349 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 371 of file vf_eq.c.