FFmpeg
Data Structures | Macros | Functions | Variables
vf_normalize.c File Reference
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  NormalizeHistory
 
struct  NormalizeLocal
 
struct  NormalizeContext
 

Macros

#define OFFSET(x)   offsetof(NormalizeContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define FLAGSR   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (normalize)
 
static void find_min_max (NormalizeContext *s, AVFrame *in, NormalizeLocal min[3], NormalizeLocal max[3])
 
static void process (NormalizeContext *s, AVFrame *in, AVFrame *out)
 
static void find_min_max_planar (NormalizeContext *s, AVFrame *in, NormalizeLocal min[3], NormalizeLocal max[3])
 
static void process_planar (NormalizeContext *s, AVFrame *in, AVFrame *out)
 
static void find_min_max_16 (NormalizeContext *s, AVFrame *in, NormalizeLocal min[3], NormalizeLocal max[3])
 
static void process_16 (NormalizeContext *s, AVFrame *in, AVFrame *out)
 
static void find_min_max_planar_16 (NormalizeContext *s, AVFrame *in, NormalizeLocal min[3], NormalizeLocal max[3])
 
static void process_planar_16 (NormalizeContext *s, AVFrame *in, AVFrame *out)
 
static void normalize (NormalizeContext *s, AVFrame *in, AVFrame *out)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 

Variables

static const AVOption normalize_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter ff_vf_normalize
 

Macro Definition Documentation

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

Definition at line 125 of file vf_normalize.c.

Definition at line 126 of file vf_normalize.c.

Definition at line 127 of file vf_normalize.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( normalize  )
static void find_min_max ( NormalizeContext s,
AVFrame in,
NormalizeLocal  min[3],
NormalizeLocal  max[3] 
)
static

Definition at line 140 of file vf_normalize.c.

Referenced by config_input().

static void process ( NormalizeContext s,
AVFrame in,
AVFrame out 
)
static

Definition at line 156 of file vf_normalize.c.

Referenced by config_input(), and swscale().

static void find_min_max_planar ( NormalizeContext s,
AVFrame in,
NormalizeLocal  min[3],
NormalizeLocal  max[3] 
)
static

Definition at line 173 of file vf_normalize.c.

Referenced by config_input().

static void process_planar ( NormalizeContext s,
AVFrame in,
AVFrame out 
)
static

Definition at line 193 of file vf_normalize.c.

Referenced by config_input().

static void find_min_max_16 ( NormalizeContext s,
AVFrame in,
NormalizeLocal  min[3],
NormalizeLocal  max[3] 
)
static

Definition at line 214 of file vf_normalize.c.

Referenced by config_input().

static void process_16 ( NormalizeContext s,
AVFrame in,
AVFrame out 
)
static

Definition at line 230 of file vf_normalize.c.

Referenced by config_input().

static void find_min_max_planar_16 ( NormalizeContext s,
AVFrame in,
NormalizeLocal  min[3],
NormalizeLocal  max[3] 
)
static

Definition at line 247 of file vf_normalize.c.

Referenced by config_input().

static void process_planar_16 ( NormalizeContext s,
AVFrame in,
AVFrame out 
)
static

Definition at line 267 of file vf_normalize.c.

Referenced by config_input().

static void normalize ( NormalizeContext s,
AVFrame in,
AVFrame out 
)
static

Definition at line 291 of file vf_normalize.c.

Referenced by filter_frame().

static int query_formats ( AVFilterContext ctx)
static

Definition at line 391 of file vf_normalize.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 423 of file vf_normalize.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 469 of file vf_normalize.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 479 of file vf_normalize.c.

Variable Documentation

const AVOption normalize_options[]
static
Initial value:
= {
{ "blackpt", "output color to which darkest input color is mapped", OFFSET(blackpt), AV_OPT_TYPE_COLOR, { .str = "black" }, CHAR_MIN, CHAR_MAX, FLAGSR },
{ "whitept", "output color to which brightest input color is mapped", OFFSET(whitept), AV_OPT_TYPE_COLOR, { .str = "white" }, CHAR_MIN, CHAR_MAX, FLAGSR },
{ "smoothing", "amount of temporal smoothing of the input range, to reduce flicker", OFFSET(smoothing), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX/8, FLAGS },
{ "independence", "proportion of independent to linked channel normalization", OFFSET(independence), AV_OPT_TYPE_FLOAT, {.dbl=1.0}, 0.0, 1.0, FLAGSR },
{ "strength", "strength of filter, from no effect to full normalization", OFFSET(strength), AV_OPT_TYPE_FLOAT, {.dbl=1.0}, 0.0, 1.0, FLAGSR },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define FLAGSR
Definition: vf_normalize.c:127
#define OFFSET(x)
Definition: vf_normalize.c:125
#define FLAGS
Definition: vf_normalize.c:126

Definition at line 129 of file vf_normalize.c.

const AVFilterPad inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_normalize.c:479
static int config_input(AVFilterLink *inlink)
Definition: vf_normalize.c:423

Definition at line 515 of file vf_normalize.c.

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32

Definition at line 525 of file vf_normalize.c.

AVFilter ff_vf_normalize
Initial value:
= {
.name = "normalize",
.description = NULL_IF_CONFIG_SMALL("Normalize RGB video."),
.priv_size = sizeof(NormalizeContext),
.priv_class = &normalize_class,
}
static int query_formats(AVFilterContext *ctx)
Definition: vf_normalize.c:391
static const AVFilterPad outputs[]
Definition: vf_normalize.c:525
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options...
Definition: avfilter.c:869
static const AVFilterPad inputs[]
Definition: vf_normalize.c:515
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_normalize.c:469
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:133
#define flags(name, subs,...)
Definition: cbs_av1.c:564
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_afftdn.c:1374

Definition at line 533 of file vf_normalize.c.