FFmpeg
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 "libavutil/xga_font_data.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  GraticuleType {
  GRAT_NONE, GRAT_GREEN, GRAT_COLOR, GRAT_INVERT,
  NB_GRATICULES, GRAT_NONE, GRAT_GREEN, GRAT_ORANGE,
  GRAT_INVERT, NB_GRATICULES
}
 
enum  VectorscopeMode {
  TINT, COLOR, COLOR2, COLOR3,
  COLOR4, COLOR5, 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 void draw_dots (uint8_t *dst, int L, int v, float o)
 
static void draw_idots (uint8_t *dst, int L, float o)
 
static void draw_dots16 (uint16_t *dst, int L, int v, float o)
 
static void draw_idots16 (uint16_t *dst, int L, int v, float o)
 
static void none_graticule (VectorscopeContext *s, AVFrame *out, int X, int Y, int D, int P)
 
static void draw_ihtext (AVFrame *out, int x, int y, float o1, float o2, const char *txt, const uint8_t color[4])
 
static void draw_ihtext16 (AVFrame *out, int x, int y, float o1, float o2, const char *txt, const uint16_t color[4])
 
static void draw_htext (AVFrame *out, int x, int y, float o1, float o2, const char *txt, const uint8_t color[4])
 
static void draw_htext16 (AVFrame *out, int x, int y, float o1, float o2, const char *txt, const uint16_t color[4])
 
static void color_graticule16 (VectorscopeContext *s, AVFrame *out, int X, int Y, int D, int P)
 
static void color_graticule (VectorscopeContext *s, AVFrame *out, int X, int Y, int D, int P)
 
static void green_graticule16 (VectorscopeContext *s, AVFrame *out, int X, int Y, int D, int P)
 
static void green_graticule (VectorscopeContext *s, AVFrame *out, int X, int Y, int D, int P)
 
static void invert_graticule16 (VectorscopeContext *s, AVFrame *out, int X, int Y, int D, int P)
 
static void invert_graticule (VectorscopeContext *s, AVFrame *out, int X, int Y, int D, int P)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int config_input (AVFilterLink *inlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 

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_yuv12_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 out_rgb12_pix_fmts []
 
static enum AVPixelFormat in1_pix_fmts []
 
static enum AVPixelFormat in2_pix_fmts []
 
const static char * positions_name []
 
const static uint16_t positions [][14][3]
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
const AVFilter ff_vf_vectorscope
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 86 of file vf_vectorscope.c.

◆ FLAGS

Definition at line 87 of file vf_vectorscope.c.

Enumeration Type Documentation

◆ GraticuleType

Enumerator
GRAT_NONE 
GRAT_GREEN 
GRAT_COLOR 
GRAT_INVERT 
NB_GRATICULES 
GRAT_NONE 
GRAT_GREEN 
GRAT_ORANGE 
GRAT_INVERT 
NB_GRATICULES 

Definition at line 32 of file vf_vectorscope.c.

◆ VectorscopeMode

Enumerator
TINT 
COLOR 
COLOR2 
COLOR3 
COLOR4 
COLOR5 
MODE_NB 

Definition at line 40 of file vf_vectorscope.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( vectorscope  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 211 of file vf_vectorscope.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 270 of file vf_vectorscope.c.

◆ envelope_instant16()

static void envelope_instant16 ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 293 of file vf_vectorscope.c.

Referenced by envelope16(), and envelope_peak16().

◆ envelope_peak16()

static void envelope_peak16 ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 314 of file vf_vectorscope.c.

Referenced by envelope16().

◆ envelope_instant()

static void envelope_instant ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 345 of file vf_vectorscope.c.

Referenced by envelope(), and envelope_peak().

◆ envelope_peak()

static void envelope_peak ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 365 of file vf_vectorscope.c.

Referenced by envelope().

◆ envelope16()

static void envelope16 ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 395 of file vf_vectorscope.c.

Referenced by vectorscope16().

◆ envelope()

static void envelope ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 406 of file vf_vectorscope.c.

Referenced by vectorscope8().

◆ vectorscope16()

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

Definition at line 417 of file vf_vectorscope.c.

Referenced by config_input().

◆ vectorscope8()

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

Definition at line 617 of file vf_vectorscope.c.

Referenced by config_input().

◆ draw_dots()

static void draw_dots ( uint8_t *  dst,
int  L,
int  v,
float  o 
)
static

Definition at line 871 of file vf_vectorscope.c.

Referenced by color_graticule(), and green_graticule().

◆ draw_idots()

static void draw_idots ( uint8_t *  dst,
int  L,
float  o 
)
static

Definition at line 894 of file vf_vectorscope.c.

Referenced by invert_graticule().

◆ draw_dots16()

static void draw_dots16 ( uint16_t *  dst,
int  L,
int  v,
float  o 
)
static

Definition at line 916 of file vf_vectorscope.c.

Referenced by color_graticule16(), green_graticule16(), and invert_graticule16().

◆ draw_idots16()

static void draw_idots16 ( uint16_t *  dst,
int  L,
int  v,
float  o 
)
static

Definition at line 939 of file vf_vectorscope.c.

Referenced by invert_graticule16().

◆ none_graticule()

static void none_graticule ( VectorscopeContext s,
AVFrame out,
int  X,
int  Y,
int  D,
int  P 
)
static

Definition at line 961 of file vf_vectorscope.c.

Referenced by config_input().

◆ draw_ihtext()

static void draw_ihtext ( AVFrame out,
int  x,
int  y,
float  o1,
float  o2,
const char *  txt,
const uint8_t  color[4] 
)
static

Definition at line 965 of file vf_vectorscope.c.

Referenced by invert_graticule().

◆ draw_ihtext16()

static void draw_ihtext16 ( AVFrame out,
int  x,
int  y,
float  o1,
float  o2,
const char *  txt,
const uint16_t  color[4] 
)
static

Definition at line 990 of file vf_vectorscope.c.

Referenced by invert_graticule16().

◆ draw_htext()

static void draw_htext ( AVFrame out,
int  x,
int  y,
float  o1,
float  o2,
const char *  txt,
const uint8_t  color[4] 
)
static

Definition at line 1016 of file vf_vectorscope.c.

Referenced by color_graticule(), and green_graticule().

◆ draw_htext16()

static void draw_htext16 ( AVFrame out,
int  x,
int  y,
float  o1,
float  o2,
const char *  txt,
const uint16_t  color[4] 
)
static

Definition at line 1042 of file vf_vectorscope.c.

Referenced by color_graticule16(), and green_graticule16().

◆ color_graticule16()

static void color_graticule16 ( VectorscopeContext s,
AVFrame out,
int  X,
int  Y,
int  D,
int  P 
)
static

Definition at line 1068 of file vf_vectorscope.c.

Referenced by config_input().

◆ color_graticule()

static void color_graticule ( VectorscopeContext s,
AVFrame out,
int  X,
int  Y,
int  D,
int  P 
)
static

Definition at line 1136 of file vf_vectorscope.c.

Referenced by config_input().

◆ green_graticule16()

static void green_graticule16 ( VectorscopeContext s,
AVFrame out,
int  X,
int  Y,
int  D,
int  P 
)
static

Definition at line 1202 of file vf_vectorscope.c.

Referenced by config_input().

◆ green_graticule()

static void green_graticule ( VectorscopeContext s,
AVFrame out,
int  X,
int  Y,
int  D,
int  P 
)
static

Definition at line 1262 of file vf_vectorscope.c.

Referenced by config_input().

◆ invert_graticule16()

static void invert_graticule16 ( VectorscopeContext s,
AVFrame out,
int  X,
int  Y,
int  D,
int  P 
)
static

Definition at line 1320 of file vf_vectorscope.c.

Referenced by config_input().

◆ invert_graticule()

static void invert_graticule ( VectorscopeContext s,
AVFrame out,
int  X,
int  Y,
int  D,
int  P 
)
static

Definition at line 1379 of file vf_vectorscope.c.

Referenced by config_input().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 1437 of file vf_vectorscope.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 1480 of file vf_vectorscope.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 1563 of file vf_vectorscope.c.

Variable Documentation

◆ vectorscope_options

const AVOption vectorscope_options[]
static

Definition at line 89 of file vf_vectorscope.c.

◆ out_yuv8_pix_fmts

enum AVPixelFormat out_yuv8_pix_fmts[]
static
Initial value:

Definition at line 142 of file vf_vectorscope.c.

Referenced by query_formats().

◆ out_yuv9_pix_fmts

enum AVPixelFormat out_yuv9_pix_fmts[]
static
Initial value:

Definition at line 147 of file vf_vectorscope.c.

Referenced by query_formats().

◆ out_yuv10_pix_fmts

enum AVPixelFormat out_yuv10_pix_fmts[]
static
Initial value:

Definition at line 152 of file vf_vectorscope.c.

Referenced by query_formats().

◆ out_yuv12_pix_fmts

enum AVPixelFormat out_yuv12_pix_fmts[]
static
Initial value:

Definition at line 157 of file vf_vectorscope.c.

Referenced by query_formats().

◆ out_rgb8_pix_fmts

enum AVPixelFormat out_rgb8_pix_fmts[]
static
Initial value:

Definition at line 162 of file vf_vectorscope.c.

Referenced by query_formats().

◆ out_rgb9_pix_fmts

enum AVPixelFormat out_rgb9_pix_fmts[]
static
Initial value:

Definition at line 167 of file vf_vectorscope.c.

Referenced by query_formats().

◆ out_rgb10_pix_fmts

enum AVPixelFormat out_rgb10_pix_fmts[]
static
Initial value:

Definition at line 172 of file vf_vectorscope.c.

Referenced by query_formats().

◆ out_rgb12_pix_fmts

enum AVPixelFormat out_rgb12_pix_fmts[]
static
Initial value:

Definition at line 177 of file vf_vectorscope.c.

Referenced by query_formats().

◆ in1_pix_fmts

enum AVPixelFormat in1_pix_fmts[]
static

◆ in2_pix_fmts

enum AVPixelFormat in2_pix_fmts[]
static

◆ positions_name

const static char* positions_name[]
static
Initial value:
= {
"R", "B", "Cy", "Yl", "G", "Mg",
}

Definition at line 813 of file vf_vectorscope.c.

Referenced by color_graticule(), color_graticule16(), green_graticule(), green_graticule16(), invert_graticule(), and invert_graticule16().

◆ positions

const static uint16_t positions[][14][3]
static

◆ inputs

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

Definition at line 1571 of file vf_vectorscope.c.

◆ outputs

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

Definition at line 1580 of file vf_vectorscope.c.

◆ ff_vf_vectorscope

const AVFilter ff_vf_vectorscope
Initial value:
= {
.name = "vectorscope",
.description = NULL_IF_CONFIG_SMALL("Video vectorscope."),
.priv_size = sizeof(VectorscopeContext),
.priv_class = &vectorscope_class,
}

Definition at line 1588 of file vf_vectorscope.c.

query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_vectorscope.c:211
outputs
static const AVFilterPad outputs[]
Definition: vf_vectorscope.c:1580
AV_PIX_FMT_YUVA422P9
#define AV_PIX_FMT_YUVA422P9
Definition: pixfmt.h:439
AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_YUVA420P10
Definition: pixfmt.h:441
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:168
AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:404
AV_PIX_FMT_YUV440P
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:99
AV_PIX_FMT_YUVA422P10
#define AV_PIX_FMT_YUVA422P10
Definition: pixfmt.h:442
inputs
static const AVFilterPad inputs[]
Definition: vf_vectorscope.c:1571
AV_PIX_FMT_YUVA420P9
#define AV_PIX_FMT_YUVA420P9
Definition: pixfmt.h:438
AV_PIX_FMT_GBRAP
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:205
AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:420
AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:402
AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:407
AV_PIX_FMT_YUVJ411P
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition: pixfmt.h:248
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_vectorscope.c:1437
AV_PIX_FMT_YUVJ422P
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:79
AV_PIX_FMT_GBRAP10
#define AV_PIX_FMT_GBRAP10
Definition: pixfmt.h:424
AV_PIX_FMT_GBRAP12
#define AV_PIX_FMT_GBRAP12
Definition: pixfmt.h:425
AV_PIX_FMT_YUVA420P
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:101
AV_PIX_FMT_YUVA444P12
#define AV_PIX_FMT_YUVA444P12
Definition: pixfmt.h:445
AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:401
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:191
AV_PIX_FMT_YUVJ444P
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:80
AV_PIX_FMT_YUVJ420P
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:78
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:405
AV_PIX_FMT_GBRP9
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:419
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_vectorscope.c:1563
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:409
AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:411
AV_PIX_FMT_YUVA444P
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:167
AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUVA444P10
Definition: pixfmt.h:443
AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:421
AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:403
AV_PIX_FMT_YUVA444P9
#define AV_PIX_FMT_YUVA444P9
Definition: pixfmt.h:440
AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:408
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_PIX_FMT_YUVA422P12
#define AV_PIX_FMT_YUVA422P12
Definition: pixfmt.h:444
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_vectorscope.c:270
VectorscopeContext
Definition: vf_vectorscope.c:50
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_vectorscope.c:1480
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
AV_PIX_FMT_GBRP
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:158
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:192
AV_PIX_FMT_YUV411P
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:73
AV_PIX_FMT_YUV410P
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:72
AV_PIX_FMT_YUV440P12
#define AV_PIX_FMT_YUV440P12
Definition: pixfmt.h:410
AV_PIX_FMT_YUVA422P
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:166