All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
vf_readeia608.c File Reference

Filter for reading closed captioning data (EIA-608). More...

#include <string.h>
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/timestamp.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  ReadEIA608Context


#define FALL   0
#define RISE   1
#define OFFSET(x)   offsetof(ReadEIA608Context, x)


static int query_formats (AVFilterContext *ctx)
static int config_input (AVFilterLink *inlink)
static void extract_line (AVFilterContext *ctx, AVFilterLink *inlink, AVFrame *in, int line)
static int filter_frame (AVFilterLink *inlink, AVFrame *in)


static const AVOption readeia608_options []
static const AVFilterPad readeia608_inputs []
static const AVFilterPad readeia608_outputs []
AVFilter ff_vf_readeia608

Detailed Description

Filter for reading closed captioning data (EIA-608).

See also https://en.wikipedia.org/wiki/EIA-608

Definition in file vf_readeia608.c.

Macro Definition Documentation

#define FALL   0

Definition at line 39 of file vf_readeia608.c.

Referenced by extract_line().

#define RISE   1

Definition at line 40 of file vf_readeia608.c.

Referenced by extract_line().

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

Definition at line 56 of file vf_readeia608.c.

Definition at line 57 of file vf_readeia608.c.

Function Documentation

static int query_formats ( AVFilterContext ctx)

Definition at line 76 of file vf_readeia608.c.

static int config_input ( AVFilterLink inlink)

Definition at line 94 of file vf_readeia608.c.

static void extract_line ( AVFilterContext ctx,
AVFilterLink inlink,
AVFrame in,
int  line 

Definition at line 121 of file vf_readeia608.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame in 

Definition at line 227 of file vf_readeia608.c.

Variable Documentation

const AVOption readeia608_options[]
Initial value:
= {
{ "scan_min", "set from which line to scan for codes", OFFSET(start), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, FLAGS },
{ "scan_max", "set to which line to scan for codes", OFFSET(end), AV_OPT_TYPE_INT, {.i64=29}, 0, INT_MAX, FLAGS },
{ "mac", "set minimal acceptable amplitude change for sync codes detection", OFFSET(mac), AV_OPT_TYPE_FLOAT, {.dbl=.2}, 0.001, 1, FLAGS },
{ "spw", "set ratio of width reserved for sync code detection", OFFSET(spw), AV_OPT_TYPE_FLOAT, {.dbl=.27}, 0.1, 0.7, FLAGS },
{ "mhd", "set max peaks height difference for sync code detection", OFFSET(mhd), AV_OPT_TYPE_FLOAT, {.dbl=.1}, 0, 0.5, FLAGS },
{ "mpd", "set max peaks period difference for sync code detection", OFFSET(mpd), AV_OPT_TYPE_FLOAT, {.dbl=.1}, 0, 0.5, FLAGS },
{ "msd", "set first two max start code bits differences", OFFSET(msd), AV_OPT_TYPE_FLOAT, {.dbl=.02}, 0, 0.5, FLAGS },
{ "bhd", "set min ratio of bits height compared to 3rd start code bit", OFFSET(bhd), AV_OPT_TYPE_FLOAT, {.dbl=.75}, 0.01, 1, FLAGS },
{ "th_w", "set white color threshold", OFFSET(wth), AV_OPT_TYPE_FLOAT, {.dbl=.35}, 0.1, 1, FLAGS },
{ "th_b", "set black color threshold", OFFSET(bth), AV_OPT_TYPE_FLOAT, {.dbl=.15}, 0, 0.5, FLAGS },
{ "chp", "check and apply parity bit", OFFSET(chp), AV_OPT_TYPE_BOOL, {.i64= 0}, 0, 1, FLAGS },
{ NULL }
#define NULL
Definition: coverity.c:32
static av_cold int end(AVCodecContext *avctx)
Definition: avrndec.c:90
#define FLAGS
Definition: vf_readeia608.c:57
void INT64 start
Definition: avisynth_c.h:690
#define OFFSET(x)
Definition: vf_readeia608.c:56

Definition at line 59 of file vf_readeia608.c.

const AVFilterPad readeia608_inputs[]
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_readeia608.c:94
static int filter_frame(AVFilterLink *inlink, AVFrame *in)

Definition at line 241 of file vf_readeia608.c.

const AVFilterPad readeia608_outputs[]
Initial value:
= {
.name = "default",
{ NULL }
#define NULL
Definition: coverity.c:32

Definition at line 251 of file vf_readeia608.c.

AVFilter ff_vf_readeia608
Initial value:
= {
.name = "readeia608",
.description = NULL_IF_CONFIG_SMALL("Read EIA-608 Closed Caption codes from input video and write them to frame metadata."),
.priv_size = sizeof(ReadEIA608Context),
.priv_class = &readeia608_class,
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:125
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVFilterPad readeia608_outputs[]
static const AVFilterPad readeia608_inputs[]
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
#define flags(name, subs,...)
Definition: cbs_av1.c:596
static int query_formats(AVFilterContext *ctx)
Definition: vf_readeia608.c:76

Definition at line 259 of file vf_readeia608.c.