FFmpeg
Data Structures | Macros | Functions | Variables
vf_readvitc.c File Reference
#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/timecode.h"
#include "avfilter.h"
#include "filters.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  ReadVitcContext
 

Macros

#define LINE_DATA_SIZE   9
 
#define OFFSET(x)   offsetof(ReadVitcContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (readvitc)
 
static uint8_t get_vitc_crc (uint8_t *line)
 
static uint8_t get_pit_avg3 (uint8_t *line, int i)
 
static int read_vitc_line (ReadVitcContext *ctx, uint8_t *src, int line_size, int width, int height)
 
static unsigned bcd2uint (uint8_t high, uint8_t low)
 
static char * make_vitc_tc_string (char *buf, uint8_t *line)
 
static av_cold int init (AVFilterContext *ctx)
 
static int config_props (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 

Variables

static const AVOption readvitc_options []
 
static enum AVPixelFormat pixel_fmts []
 
static const AVFilterPad inputs []
 
const AVFilter ff_vf_readvitc
 

Detailed Description

Filter for reading the vertical interval timecode (VITC). See also https://en.wikipedia.org/wiki/Vertical_interval_timecode

Definition in file vf_readvitc.c.

Macro Definition Documentation

◆ LINE_DATA_SIZE

#define LINE_DATA_SIZE   9

Definition at line 35 of file vf_readvitc.c.

◆ OFFSET

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

Definition at line 52 of file vf_readvitc.c.

◆ FLAGS

Definition at line 53 of file vf_readvitc.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( readvitc  )

◆ get_vitc_crc()

static uint8_t get_vitc_crc ( uint8_t *  line)
static

Definition at line 64 of file vf_readvitc.c.

Referenced by read_vitc_line().

◆ get_pit_avg3()

static uint8_t get_pit_avg3 ( uint8_t *  line,
int  i 
)
inlinestatic

Definition at line 82 of file vf_readvitc.c.

Referenced by read_vitc_line().

◆ read_vitc_line()

static int read_vitc_line ( ReadVitcContext ctx,
uint8_t *  src,
int  line_size,
int  width,
int  height 
)
static

Definition at line 86 of file vf_readvitc.c.

Referenced by filter_frame().

◆ bcd2uint()

static unsigned bcd2uint ( uint8_t  high,
uint8_t  low 
)
static

Definition at line 138 of file vf_readvitc.c.

Referenced by make_vitc_tc_string().

◆ make_vitc_tc_string()

static char* make_vitc_tc_string ( char *  buf,
uint8_t *  line 
)
static

Definition at line 145 of file vf_readvitc.c.

Referenced by filter_frame().

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 157 of file vf_readvitc.c.

◆ config_props()

static int config_props ( AVFilterLink inlink)
static

Definition at line 175 of file vf_readvitc.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 208 of file vf_readvitc.c.

Variable Documentation

◆ readvitc_options

const AVOption readvitc_options[]
static
Initial value:
= {
{ "scan_max", "maximum line numbers to scan for VITC data", OFFSET(scan_max), AV_OPT_TYPE_INT, {.i64 = 45 }, -1, INT_MAX, FLAGS },
{ "thr_b", "black color threshold", OFFSET(thr_b), AV_OPT_TYPE_DOUBLE, {.dbl = 0.2 }, 0, 1.0, FLAGS },
{ "thr_w", "white color threshold", OFFSET(thr_w), AV_OPT_TYPE_DOUBLE, {.dbl = 0.6 }, 0, 1.0, FLAGS },
{ NULL }
}

Definition at line 55 of file vf_readvitc.c.

◆ pixel_fmts

enum AVPixelFormat pixel_fmts[]
static

◆ inputs

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

Definition at line 223 of file vf_readvitc.c.

◆ ff_vf_readvitc

const AVFilter ff_vf_readvitc
Initial value:
= {
.name = "readvitc",
.description = NULL_IF_CONFIG_SMALL("Read vertical interval timecode and write it to frame metadata."),
.priv_size = sizeof(ReadVitcContext),
.priv_class = &readvitc_class,
.init = init,
}

Definition at line 232 of file vf_readvitc.c.

config_props
static int config_props(AVFilterLink *inlink)
Definition: vf_readvitc.c:175
OFFSET
#define OFFSET(x)
Definition: vf_readvitc.c:52
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_readvitc.c:157
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: filters.h:242
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
inputs
static const AVFilterPad inputs[]
Definition: vf_readvitc.c:223
AV_PIX_FMT_YUV440P
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:106
FLAGS
#define FLAGS
Definition: vf_readvitc.c:53
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:283
ff_video_default_filterpad
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition: video.c:37
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:86
pixel_fmts
static enum AVPixelFormat pixel_fmts[]
Definition: vf_readvitc.c:186
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:108
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
Definition: opt.h:267
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:73
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
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:87
NULL
#define NULL
Definition: coverity.c:32
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:85
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:81
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:94
AV_PIX_FMT_NV16
@ AV_PIX_FMT_NV16
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:198
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:174
ReadVitcContext
Definition: vf_readvitc.c:37
AV_PIX_FMT_YUVJ440P
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
Definition: pixfmt.h:107
AV_PIX_FMT_NV21
@ AV_PIX_FMT_NV21
as above, but U and V bytes are swapped
Definition: pixfmt.h:97
AV_PIX_FMT_NV12
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition: pixfmt.h:96
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AVFILTER_FLAG_METADATA_ONLY
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
Definition: avfilter.h:168
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:78
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:77
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:80
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
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:79
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_readvitc.c:208
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:173