FFmpeg
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
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"

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
 

Enumerations

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

Functions

 AVFILTER_DEFINE_CLASS (histogram)
 
static av_cold int init (AVFilterContext *ctx, const char *args)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int config_output (AVFilterLink *outlink)
 
static int filter_frame (AVFilterLink *inlink, AVFilterBufferRef *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 

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

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

Definition at line 53 of file vf_histogram.c.

Definition at line 54 of file vf_histogram.c.

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 av_cold int init ( AVFilterContext ctx,
const char *  args 
)
static

Definition at line 76 of file vf_histogram.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 100 of file vf_histogram.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 128 of file vf_histogram.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 148 of file vf_histogram.c.

static int filter_frame ( AVFilterLink inlink,
AVFilterBufferRef in 
)
static

Definition at line 177 of file vf_histogram.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 310 of file vf_histogram.c.

Variable Documentation

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 },
}

Definition at line 56 of file vf_histogram.c.

enum AVPixelFormat color_pix_fmts[]
static
Initial value:

Definition at line 90 of file vf_histogram.c.

Referenced by query_formats().

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

Definition at line 123 of file vf_histogram.c.

Referenced by config_input().

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

Definition at line 124 of file vf_histogram.c.

Referenced by config_input().

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

Definition at line 125 of file vf_histogram.c.

Referenced by config_input().

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

Definition at line 126 of file vf_histogram.c.

Referenced by config_input().

const AVFilterPad inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
.min_perms = AV_PERM_READ,
},
{ NULL }
}

Definition at line 317 of file vf_histogram.c.

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

Definition at line 328 of file vf_histogram.c.

AVFilter avfilter_vf_histogram
Initial value:
= {
.name = "histogram",
.description = NULL_IF_CONFIG_SMALL("Compute and draw a histogram."),
.priv_size = sizeof(HistogramContext),
.init = init,
.priv_class = &histogram_class,
}

Definition at line 337 of file vf_histogram.c.