FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
vf_vectorscope.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/intreadwrite.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  VectorscopeContext
 

Macros

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

Enumerations

enum  VectorscopeMode {
  GRAY, COLOR, COLOR2, COLOR3,
  COLOR4, MODE_NB
}
 

Functions

 AVFILTER_DEFINE_CLASS (vectorscope)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 
static void envelope_instant16 (VectorscopeContext *s, AVFrame *out)
 
static void envelope_peak16 (VectorscopeContext *s, AVFrame *out)
 
static void envelope_instant (VectorscopeContext *s, AVFrame *out)
 
static void envelope_peak (VectorscopeContext *s, AVFrame *out)
 
static void envelope16 (VectorscopeContext *s, AVFrame *out)
 
static void envelope (VectorscopeContext *s, AVFrame *out)
 
static void vectorscope16 (VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd)
 
static void vectorscope8 (VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int config_input (AVFilterLink *inlink)
 

Variables

static const AVOption vectorscope_options []
 
static enum AVPixelFormat out_yuv8_pix_fmts []
 
static enum AVPixelFormat out_yuv9_pix_fmts []
 
static enum AVPixelFormat out_yuv10_pix_fmts []
 
static enum AVPixelFormat out_rgb8_pix_fmts []
 
static enum AVPixelFormat out_rgb9_pix_fmts []
 
static enum AVPixelFormat out_rgb10_pix_fmts []
 
static enum AVPixelFormat in1_pix_fmts []
 
static enum AVPixelFormat in2_pix_fmts []
 
static const uint8_t black_yuva_color [4] = { 0, 127, 127, 0 }
 
static const uint8_t black_gbrp_color [4] = { 0, 0, 0, 0 }
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter ff_vf_vectorscope
 

Macro Definition Documentation

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

Definition at line 60 of file vf_vectorscope.c.

Definition at line 61 of file vf_vectorscope.c.

Enumeration Type Documentation

Enumerator
GRAY 
COLOR 
COLOR2 
COLOR3 
COLOR4 
MODE_NB 

Definition at line 31 of file vf_vectorscope.c.

Function Documentation

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

Definition at line 137 of file vf_vectorscope.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 193 of file vf_vectorscope.c.

static void envelope_instant16 ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 203 of file vf_vectorscope.c.

Referenced by envelope16(), and envelope_peak16().

static void envelope_peak16 ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 224 of file vf_vectorscope.c.

Referenced by envelope16().

static void envelope_instant ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 255 of file vf_vectorscope.c.

Referenced by envelope(), and envelope_peak().

static void envelope_peak ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 275 of file vf_vectorscope.c.

Referenced by envelope().

static void envelope16 ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 305 of file vf_vectorscope.c.

Referenced by vectorscope16().

static void envelope ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 316 of file vf_vectorscope.c.

Referenced by vectorscope8().

static void vectorscope16 ( VectorscopeContext s,
AVFrame in,
AVFrame out,
int  pd 
)
static

Definition at line 327 of file vf_vectorscope.c.

Referenced by config_input().

static void vectorscope8 ( VectorscopeContext s,
AVFrame in,
AVFrame out,
int  pd 
)
static

Definition at line 486 of file vf_vectorscope.c.

Referenced by config_input().

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 639 of file vf_vectorscope.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 659 of file vf_vectorscope.c.

Variable Documentation

const AVOption vectorscope_options[]
static
Initial value:
= {
{ "mode", "set vectorscope mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, MODE_NB-1, FLAGS, "mode"},
{ "m", "set vectorscope mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, MODE_NB-1, FLAGS, "mode"},
{ "gray", 0, 0, AV_OPT_TYPE_CONST, {.i64=GRAY}, 0, 0, FLAGS, "mode" },
{ "color", 0, 0, AV_OPT_TYPE_CONST, {.i64=COLOR}, 0, 0, FLAGS, "mode" },
{ "color2", 0, 0, AV_OPT_TYPE_CONST, {.i64=COLOR2}, 0, 0, FLAGS, "mode" },
{ "color3", 0, 0, AV_OPT_TYPE_CONST, {.i64=COLOR3}, 0, 0, FLAGS, "mode" },
{ "color4", 0, 0, AV_OPT_TYPE_CONST, {.i64=COLOR4}, 0, 0, FLAGS, "mode" },
{ "x", "set color component on X axis", OFFSET(x), AV_OPT_TYPE_INT, {.i64=1}, 0, 2, FLAGS},
{ "y", "set color component on Y axis", OFFSET(y), AV_OPT_TYPE_INT, {.i64=2}, 0, 2, FLAGS},
{ "intensity", "set intensity", OFFSET(fintensity), AV_OPT_TYPE_FLOAT, {.dbl=0.004}, 0, 1, FLAGS},
{ "i", "set intensity", OFFSET(fintensity), AV_OPT_TYPE_FLOAT, {.dbl=0.004}, 0, 1, FLAGS},
{ "envelope", "set envelope", OFFSET(envelope), AV_OPT_TYPE_INT, {.i64=0}, 0, 3, FLAGS, "envelope"},
{ "e", "set envelope", OFFSET(envelope), AV_OPT_TYPE_INT, {.i64=0}, 0, 3, FLAGS, "envelope"},
{ "none", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "envelope" },
{ "instant", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "envelope" },
{ "peak", 0, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "envelope" },
{ "peak+instant", 0, 0, AV_OPT_TYPE_CONST, {.i64=3}, 0, 0, FLAGS, "envelope" },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
mode
Definition: f_perms.c:27
static void envelope(VectorscopeContext *s, AVFrame *out)
#define FLAGS

Definition at line 63 of file vf_vectorscope.c.

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

Definition at line 86 of file vf_vectorscope.c.

Referenced by query_formats().

enum AVPixelFormat out_yuv9_pix_fmts[]
static
Initial value:
= {
}
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:329

Definition at line 91 of file vf_vectorscope.c.

Referenced by query_formats().

enum AVPixelFormat out_yuv10_pix_fmts[]
static
Initial value:
= {
}
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:333

Definition at line 96 of file vf_vectorscope.c.

Referenced by query_formats().

enum AVPixelFormat out_rgb8_pix_fmts[]
static
Initial value:
= {
}
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:181
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:229

Definition at line 101 of file vf_vectorscope.c.

Referenced by query_formats().

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

Definition at line 106 of file vf_vectorscope.c.

Referenced by query_formats().

enum AVPixelFormat out_rgb10_pix_fmts[]
static
Initial value:
= {
}
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:346

Definition at line 111 of file vf_vectorscope.c.

Referenced by query_formats().

enum AVPixelFormat in1_pix_fmts[]
static
Initial value:
= {
}
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:68
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:181
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:346
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:345
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:333
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:329
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:189
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:229
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:77

Definition at line 116 of file vf_vectorscope.c.

Referenced by query_formats().

enum AVPixelFormat in2_pix_fmts[]
static
Initial value:
= {
}
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:68
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:181
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:346
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:103
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:345
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:76
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:188
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:333
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:67
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:328
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:75
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:329
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:189
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:330
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:69
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:327
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:331
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:63
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:229
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:77
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:70
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:266
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:101

Definition at line 124 of file vf_vectorscope.c.

Referenced by query_formats().

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

Definition at line 190 of file vf_vectorscope.c.

Referenced by config_input().

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

Definition at line 191 of file vf_vectorscope.c.

Referenced by config_input().

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

Definition at line 705 of file vf_vectorscope.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 at line 715 of file vf_vectorscope.c.

AVFilter ff_vf_vectorscope
Initial value:
= {
.name = "vectorscope",
.description = NULL_IF_CONFIG_SMALL("Video vectorscope."),
.priv_size = sizeof(VectorscopeContext),
.priv_class = &vectorscope_class,
}
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static const AVFilterPad inputs[]
static const AVFilterPad outputs[]
static int query_formats(AVFilterContext *ctx)

Definition at line 724 of file vf_vectorscope.c.