FFmpeg
Data Structures | Macros | Functions | Variables
vf_histogram.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/colorspace.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.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
 
#define COMMON_OPTIONS
 

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 levels_in_pix_fmts []
 
static enum AVPixelFormat levels_out_yuv8_pix_fmts []
 
static enum AVPixelFormat levels_out_yuv9_pix_fmts []
 
static enum AVPixelFormat levels_out_yuv10_pix_fmts []
 
static enum AVPixelFormat levels_out_yuv12_pix_fmts []
 
static enum AVPixelFormat levels_out_rgb8_pix_fmts []
 
static enum AVPixelFormat levels_out_rgb9_pix_fmts []
 
static enum AVPixelFormat levels_out_rgb10_pix_fmts []
 
static enum AVPixelFormat levels_out_rgb12_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 []
 

Macro Definition Documentation

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

Definition at line 62 of file vf_histogram.c.

Definition at line 63 of file vf_histogram.c.

#define COMMON_OPTIONS
Value:
{ "display_mode", "set display mode", OFFSET(display_mode), AV_OPT_TYPE_INT, {.i64=2}, 0, 2, FLAGS, "display_mode"}, \
{ "d", "set display mode", OFFSET(display_mode), AV_OPT_TYPE_INT, {.i64=2}, 0, 2, FLAGS, "display_mode"}, \
{ "overlay", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "display_mode" }, \
{ "parade", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "display_mode" }, \
{ "stack", NULL, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "display_mode" }, \
{ "levels_mode", "set levels mode", OFFSET(levels_mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS, "levels_mode"}, \
{ "m", "set levels mode", OFFSET(levels_mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS, "levels_mode"}, \
{ "linear", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "levels_mode" }, \
{ "logarithmic", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "levels_mode" }, \
{ "components", "set color components to display", OFFSET(components), AV_OPT_TYPE_INT, {.i64=7}, 1, 15, FLAGS}, \
{ "c", "set color components to display", OFFSET(components), AV_OPT_TYPE_INT, {.i64=7}, 1, 15, FLAGS},
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: vf_histogram.c:62
#define FLAGS
Definition: vf_histogram.c:63

Definition at line 65 of file vf_histogram.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( histogram  )
static int query_formats ( AVFilterContext ctx)
static

Definition at line 150 of file vf_histogram.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 206 of file vf_histogram.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 250 of file vf_histogram.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 281 of file vf_histogram.c.

Variable Documentation

const AVOption histogram_options[]
static
Initial value:
= {
{ "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},
{ "fgopacity", "set foreground opacity", OFFSET(fgopacity), AV_OPT_TYPE_FLOAT, {.dbl=0.7}, 0, 1, FLAGS},
{ "f", "set foreground opacity", OFFSET(fgopacity), AV_OPT_TYPE_FLOAT, {.dbl=0.7}, 0, 1, FLAGS},
{ "bgopacity", "set background opacity", OFFSET(bgopacity), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, 0, 1, FLAGS},
{ "b", "set background opacity", OFFSET(bgopacity), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, 0, 1, FLAGS},
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: vf_histogram.c:62
#define COMMON_OPTIONS
Definition: vf_histogram.c:65
#define FLAGS
Definition: vf_histogram.c:63

Definition at line 78 of file vf_histogram.c.

enum AVPixelFormat levels_in_pix_fmts[]
static
Initial value:
= {
}
#define AV_PIX_FMT_YUVA422P9
Definition: pixfmt.h:429
#define AV_PIX_FMT_YUVA420P10
Definition: pixfmt.h:431
#define AV_PIX_FMT_GBRAP10
Definition: pixfmt.h:414
#define AV_PIX_FMT_YUVA422P10
Definition: pixfmt.h:432
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:168
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:410
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:398
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:101
#define AV_PIX_FMT_YUVA420P9
Definition: pixfmt.h:428
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:409
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:79
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:399
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:176
#define AV_PIX_FMT_GBRAP12
Definition: pixfmt.h:415
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:397
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:392
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:78
#define AV_PIX_FMT_YUVA444P12
Definition: pixfmt.h:435
#define AV_PIX_FMT_YUVA444P10
Definition: pixfmt.h:433
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:393
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:177
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:394
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:72
#define AV_PIX_FMT_YUV440P12
Definition: pixfmt.h:400
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:391
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:411
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:395
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:401
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
Y , 8bpp.
Definition: pixfmt.h:74
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:215
#define AV_PIX_FMT_YUVA444P9
Definition: pixfmt.h:430
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:80
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:73
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:258
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:99
#define AV_PIX_FMT_YUVA422P12
Definition: pixfmt.h:434

Definition at line 91 of file vf_histogram.c.

Referenced by query_formats().

enum AVPixelFormat levels_out_yuv8_pix_fmts[]
static
Initial value:
= {
}
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:177

Definition at line 110 of file vf_histogram.c.

Referenced by query_formats().

enum AVPixelFormat levels_out_yuv9_pix_fmts[]
static
Initial value:
= {
}
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:393
#define AV_PIX_FMT_YUVA444P9
Definition: pixfmt.h:430

Definition at line 115 of file vf_histogram.c.

Referenced by query_formats().

enum AVPixelFormat levels_out_yuv10_pix_fmts[]
static
Initial value:
= {
}
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:397
#define AV_PIX_FMT_YUVA444P10
Definition: pixfmt.h:433

Definition at line 120 of file vf_histogram.c.

Referenced by query_formats().

enum AVPixelFormat levels_out_yuv12_pix_fmts[]
static
Initial value:
= {
}
#define AV_PIX_FMT_YUVA444P12
Definition: pixfmt.h:435
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:401

Definition at line 125 of file vf_histogram.c.

Referenced by query_formats().

enum AVPixelFormat levels_out_rgb8_pix_fmts[]
static
Initial value:
= {
}
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:168
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:215

Definition at line 130 of file vf_histogram.c.

Referenced by query_formats().

enum AVPixelFormat levels_out_rgb9_pix_fmts[]
static
Initial value:
= {
}
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:409

Definition at line 135 of file vf_histogram.c.

Referenced by query_formats().

enum AVPixelFormat levels_out_rgb10_pix_fmts[]
static
Initial value:
= {
}
#define AV_PIX_FMT_GBRAP10
Definition: pixfmt.h:414
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:410

Definition at line 140 of file vf_histogram.c.

Referenced by query_formats().

enum AVPixelFormat levels_out_rgb12_pix_fmts[]
static
Initial value:
= {
}
#define AV_PIX_FMT_GBRAP12
Definition: pixfmt.h:415
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:411

Definition at line 145 of file vf_histogram.c.

Referenced by query_formats().

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

Definition at line 201 of file vf_histogram.c.

Referenced by config_input().

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

Definition at line 202 of file vf_histogram.c.

Referenced by config_input().

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

Definition at line 203 of file vf_histogram.c.

Referenced by config_input().

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

Definition at line 204 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,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_input(AVFilterLink *inlink)
Definition: vf_histogram.c:206
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_histogram.c:281

Definition at line 459 of file vf_histogram.c.

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_output(AVFilterLink *outlink)
Definition: vf_histogram.c:250

Definition at line 469 of file vf_histogram.c.