vf_histogram.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
Include dependency graph for vf_histogram.c:

Go to the source code of this file.

Data Structures

struct  HistogramContext
 

Macros

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

Typedefs

typedef struct HistogramContext HistogramContext
 

Enumerations

enum  HistogramMode {
  MODE_LEVELS, MODE_WAVEFORM, MODE_COLOR, MODE_COLOR2,
  MODE_NB
}
 

Functions

 AVFILTER_DEFINE_CLASS (histogram)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int config_output (AVFilterLink *outlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 

Variables

static const AVOption histogram_options []
 
static enum AVPixelFormat color_pix_fmts []
 
static enum AVPixelFormat levels_pix_fmts []
 
static const uint8_t black_yuva_color [4] = { 0, 127, 127, 255 }
 
static const uint8_t black_gbrp_color [4] = { 0, 0, 0, 255 }
 
static const uint8_t white_yuva_color [4] = { 255, 127, 127, 255 }
 
static const uint8_t white_gbrp_color [4] = { 255, 255, 255, 255 }
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter avfilter_vf_histogram
 

Macro Definition Documentation

Definition at line 54 of file vf_histogram.c.

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

Definition at line 53 of file vf_histogram.c.

Typedef Documentation

Enumeration Type Documentation

Enumerator
MODE_LEVELS 
MODE_WAVEFORM 
MODE_COLOR 
MODE_COLOR2 
MODE_NB 

Definition at line 30 of file vf_histogram.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( histogram  )
static int config_input ( AVFilterLink inlink)
static

Definition at line 114 of file vf_histogram.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 134 of file vf_histogram.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 163 of file vf_histogram.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 86 of file vf_histogram.c.

Variable Documentation

AVFilter avfilter_vf_histogram
Initial value:
= {
.name = "histogram",
.description = NULL_IF_CONFIG_SMALL("Compute and draw a histogram."),
.priv_size = sizeof(HistogramContext),
.priv_class = &histogram_class,
}
static const AVFilterPad inputs[]
Definition: vf_histogram.c:292
static const AVFilterPad outputs[]
Definition: vf_histogram.c:302
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
struct HistogramContext HistogramContext
static int query_formats(AVFilterContext *ctx)
Definition: vf_histogram.c:86

Definition at line 311 of file vf_histogram.c.

const uint8_t black_gbrp_color[4] = { 0, 0, 0, 255 }
static

Definition at line 110 of file vf_histogram.c.

Referenced by config_input().

const uint8_t black_yuva_color[4] = { 0, 127, 127, 255 }
static

Definition at line 109 of file vf_histogram.c.

Referenced by config_input().

enum AVPixelFormat color_pix_fmts[]
static
Initial value:
= {
}
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:73
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:218
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
Definition: pixfmt.h:82

Definition at line 76 of file vf_histogram.c.

Referenced by query_formats().

const AVOption histogram_options[]
static
Initial value:
= {
{ "mode", "set histogram mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_LEVELS}, 0, MODE_NB-1, FLAGS, "mode"},
{ "levels", "standard histogram", 0, AV_OPT_TYPE_CONST, {.i64=MODE_LEVELS}, 0, 0, FLAGS, "mode" },
{ "waveform", "per row/column luminance graph", 0, AV_OPT_TYPE_CONST, {.i64=MODE_WAVEFORM}, 0, 0, FLAGS, "mode" },
{ "color", "chroma values in vectorscope", 0, AV_OPT_TYPE_CONST, {.i64=MODE_COLOR}, 0, 0, FLAGS, "mode" },
{ "color2", "chroma values in vectorscope", 0, AV_OPT_TYPE_CONST, {.i64=MODE_COLOR2}, 0, 0, FLAGS, "mode" },
{ "level_height", "set level height", OFFSET(level_height), AV_OPT_TYPE_INT, {.i64=200}, 50, 2048, FLAGS},
{ "scale_height", "set scale height", OFFSET(scale_height), AV_OPT_TYPE_INT, {.i64=12}, 0, 40, FLAGS},
{ "step", "set waveform step value", OFFSET(step), AV_OPT_TYPE_INT, {.i64=10}, 1, 255, FLAGS},
{ "waveform_mode", "set waveform mode", OFFSET(waveform_mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS, "waveform_mode"},
{ "row", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "waveform_mode" },
{ "column", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "waveform_mode" },
{ "display_mode", "set display mode", OFFSET(display_mode), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS, "display_mode"},
{ "parade", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "display_mode" },
{ "overlay", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "display_mode" },
{ NULL },
}
mode
Definition: f_perms.c:27
#define OFFSET(x)
Definition: vf_histogram.c:53
NULL
Definition: eval.c:55
#define FLAGS
Definition: vf_histogram.c:54
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But a word about which is also called distortion Distortion can be quantified by almost any quality measurement one chooses the sum of squared differences is used but more complex methods that consider psychovisual effects can be used as well It makes no difference in this discussion First step

Definition at line 56 of file vf_histogram.c.

const AVFilterPad inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
},
{ NULL }
}
static int config_input(AVFilterLink *inlink)
Definition: vf_histogram.c:114
NULL
Definition: eval.c:55
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_histogram.c:163

Definition at line 292 of file vf_histogram.c.

enum AVPixelFormat levels_pix_fmts[]
static
Initial value:
= {
}
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:73
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:168
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:218
Y , 8bpp.
Definition: pixfmt.h:76
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
Definition: pixfmt.h:82

Definition at line 81 of file vf_histogram.c.

Referenced by query_formats().

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}
NULL
Definition: eval.c:55
static int config_output(AVFilterLink *outlink)
Definition: vf_histogram.c:134

Definition at line 302 of file vf_histogram.c.

const uint8_t white_gbrp_color[4] = { 255, 255, 255, 255 }
static

Definition at line 112 of file vf_histogram.c.

Referenced by config_input().

const uint8_t white_yuva_color[4] = { 255, 127, 127, 255 }
static

Definition at line 111 of file vf_histogram.c.

Referenced by config_input().