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  VectorscopeMode {
  GRAY, 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_dots16 (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_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 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 []
 
static const char * positions_name []
 
static const uint16_t positions [][14][3]
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
AVFilter ff_vf_vectorscope
 

Macro Definition Documentation

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

Definition at line 76 of file vf_vectorscope.c.

Definition at line 77 of file vf_vectorscope.c.

Enumeration Type Documentation

Enumerator
GRAY 
COLOR 
COLOR2 
COLOR3 
COLOR4 
COLOR5 
MODE_NB 

Definition at line 32 of file vf_vectorscope.c.

Function Documentation

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

Definition at line 194 of file vf_vectorscope.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 253 of file vf_vectorscope.c.

static void envelope_instant16 ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 276 of file vf_vectorscope.c.

Referenced by envelope16(), and envelope_peak16().

static void envelope_peak16 ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 297 of file vf_vectorscope.c.

Referenced by envelope16().

static void envelope_instant ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 328 of file vf_vectorscope.c.

Referenced by envelope(), and envelope_peak().

static void envelope_peak ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 348 of file vf_vectorscope.c.

Referenced by envelope().

static void envelope16 ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 378 of file vf_vectorscope.c.

Referenced by vectorscope16().

static void envelope ( VectorscopeContext s,
AVFrame out 
)
static

Definition at line 389 of file vf_vectorscope.c.

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

Definition at line 400 of file vf_vectorscope.c.

Referenced by config_input().

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

Definition at line 598 of file vf_vectorscope.c.

Referenced by config_input().

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

Definition at line 850 of file vf_vectorscope.c.

Referenced by color_graticule(), and green_graticule().

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

Definition at line 873 of file vf_vectorscope.c.

Referenced by color_graticule16(), and green_graticule16().

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

Definition at line 896 of file vf_vectorscope.c.

Referenced by config_input().

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 900 of file vf_vectorscope.c.

Referenced by color_graticule(), and green_graticule().

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 926 of file vf_vectorscope.c.

Referenced by color_graticule16(), and green_graticule16().

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

Definition at line 952 of file vf_vectorscope.c.

Referenced by config_input().

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

Definition at line 1020 of file vf_vectorscope.c.

Referenced by config_input().

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

Definition at line 1086 of file vf_vectorscope.c.

Referenced by config_input().

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

Definition at line 1146 of file vf_vectorscope.c.

Referenced by config_input().

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 1204 of file vf_vectorscope.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 1247 of file vf_vectorscope.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 1323 of file vf_vectorscope.c.

Variable Documentation

const AVOption vectorscope_options[]
static

Definition at line 79 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:71
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:177

Definition at line 126 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:386
#define AV_PIX_FMT_YUVA444P9
Definition: pixfmt.h:423

Definition at line 131 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:390
#define AV_PIX_FMT_YUVA444P10
Definition: pixfmt.h:426

Definition at line 136 of file vf_vectorscope.c.

Referenced by query_formats().

enum AVPixelFormat out_yuv12_pix_fmts[]
static
Initial value:

Definition at line 141 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:168
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:215

Definition at line 146 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:402

Definition at line 151 of file vf_vectorscope.c.

Referenced by query_formats().

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

Definition at line 156 of file vf_vectorscope.c.

Referenced by query_formats().

enum AVPixelFormat out_rgb12_pix_fmts[]
static
Initial value:
= {
}
#define AV_PIX_FMT_GBRAP12
Definition: pixfmt.h:408
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:404

Definition at line 161 of file vf_vectorscope.c.

Referenced by query_formats().

enum AVPixelFormat in1_pix_fmts[]
static
Initial value:
= {
}
#define AV_PIX_FMT_GBRAP10
Definition: pixfmt.h:407
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:403
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:402
#define AV_PIX_FMT_GBRAP12
Definition: pixfmt.h:408
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:390
#define AV_PIX_FMT_YUVA444P10
Definition: pixfmt.h:426
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:386
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:177
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:404
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:394
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:215
#define AV_PIX_FMT_YUVA444P9
Definition: pixfmt.h:423
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:80

Definition at line 166 of file vf_vectorscope.c.

Referenced by query_formats().

enum AVPixelFormat in2_pix_fmts[]
static
Initial value:
= {
}
#define AV_PIX_FMT_YUVA422P9
Definition: pixfmt.h:422
#define AV_PIX_FMT_YUVA420P10
Definition: pixfmt.h:424
#define AV_PIX_FMT_GBRAP10
Definition: pixfmt.h:407
#define AV_PIX_FMT_YUVA422P10
Definition: pixfmt.h:425
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:403
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:391
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:421
#define AV_PIX_FMT_GBRP9
Definition: pixfmt.h:402
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:392
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:408
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:390
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:385
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_YUVA444P10
Definition: pixfmt.h:426
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:386
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:387
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:393
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:384
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:404
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:388
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:394
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:215
#define AV_PIX_FMT_YUVA444P9
Definition: pixfmt.h:423
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

Definition at line 177 of file vf_vectorscope.c.

Referenced by query_formats().

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

Definition at line 792 of file vf_vectorscope.c.

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

const uint16_t positions[][14][3]
static
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 1331 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 1341 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:186
static const AVFilterPad inputs[]
static const AVFilterPad outputs[]
static av_cold void uninit(AVFilterContext *ctx)
static int query_formats(AVFilterContext *ctx)

Definition at line 1350 of file vf_vectorscope.c.