#include <string.h>
#include "libavutil/internal.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "filters.h"
#include "video.h"
Go to the source code of this file.
|
| AVFILTER_DEFINE_CLASS (readeia608) |
|
static int | config_filter (AVFilterContext *ctx, int start, int end) |
|
static void | build_histogram (ReadEIA608Context *s, ScanItem *scan, const LineItem *line, int len) |
|
static void | find_black_and_white (ReadEIA608Context *s, ScanItem *scan) |
|
static float | meanf (const LineItem *line, int len) |
|
static float | stddevf (const LineItem *line, int len) |
|
static void | thresholding (ReadEIA608Context *s, ScanItem *scan, LineItem *line, int lag, float threshold, float influence, int len) |
|
static int | periods (const LineItem *line, CodeItem *code, int len) |
|
static void | dump_code (AVFilterContext *ctx, ScanItem *scan, int len, int item) |
|
static int | config_input (AVFilterLink *inlink) |
|
static void | extract_line (AVFilterContext *ctx, AVFrame *in, ScanItem *scan, int w, int nb_line) |
|
static int | extract_lines (AVFilterContext *ctx, void *arg, int job, int nb_jobs) |
|
static int | filter_frame (AVFilterLink *inlink, AVFrame *in) |
|
static av_cold void | uninit (AVFilterContext *ctx) |
|
static int | process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags) |
|
Filter for reading closed captioning data (EIA-608). See also https://en.wikipedia.org/wiki/EIA-608
Definition in file vf_readeia608.c.
◆ LAG
◆ CLOCK_BITSIZE_MIN
#define CLOCK_BITSIZE_MIN 0.2f |
◆ CLOCK_BITSIZE_MAX
#define CLOCK_BITSIZE_MAX 1.5f |
◆ SYNC_BITSIZE_MIN
#define SYNC_BITSIZE_MIN 12.f |
◆ SYNC_BITSIZE_MAX
#define SYNC_BITSIZE_MAX 15.f |
◆ OFFSET
◆ FLAGS
◆ READ_LINE
Value:
{ \
const
type *
src = (
const type *)(&in->data[0][nb_line * in->linesize[0]]);
\
for (
int i = 0;
i <
w;
i++) { \
\
src[d] +
src[e] +
src[
f] + 6) / 7; \
} \
} else { \
for (
int i = 0;
i <
w;
i++) { \
} \
} \
}
Definition at line 316 of file vf_readeia608.c.
◆ AVFILTER_DEFINE_CLASS()
AVFILTER_DEFINE_CLASS |
( |
readeia608 |
| ) |
|
◆ config_filter()
◆ build_histogram()
◆ find_black_and_white()
◆ meanf()
◆ stddevf()
◆ thresholding()
◆ periods()
◆ dump_code()
◆ config_input()
◆ extract_line()
◆ extract_lines()
static int extract_lines |
( |
AVFilterContext * |
ctx, |
|
|
void * |
arg, |
|
|
int |
job, |
|
|
int |
nb_jobs |
|
) |
| |
|
static |
◆ filter_frame()
◆ uninit()
◆ process_command()
static int process_command |
( |
AVFilterContext * |
ctx, |
|
|
const char * |
cmd, |
|
|
const char * |
args, |
|
|
char * |
res, |
|
|
int |
res_len, |
|
|
int |
flags |
|
) |
| |
|
static |
◆ readeia608_options
◆ pixel_fmts
◆ readeia608_inputs
Initial value:= {
{
.name = "default",
},
}
Definition at line 532 of file vf_readeia608.c.
◆ 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_class = &readeia608_class,
}
Definition at line 541 of file vf_readeia608.c.
#define AV_PIX_FMT_YUVA422P16
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
#define FILTER_PIXFMTS_ARRAY(array)
#define AV_PIX_FMT_YUVA422P9
#define FILTER_INPUTS(array)
This structure describes decoded (raw) audio or video data.
#define AV_PIX_FMT_YUVA420P16
#define AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_YUV420P10
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
#define AV_PIX_FMT_YUVA422P10
#define AV_PIX_FMT_YUVA420P9
#define AV_PIX_FMT_YUVA444P16
#define AV_PIX_FMT_YUV422P9
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
#define AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_YUV444P10
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
#define AV_PIX_FMT_YUV422P16
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
#define AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUVA444P12
#define AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_GRAY14
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static enum AVPixelFormat pixel_fmts[]
#define FILTER_OUTPUTS(array)
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
#define AV_PIX_FMT_GRAY10
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
#define AV_PIX_FMT_YUV440P10
static const AVFilterPad readeia608_inputs[]
#define AV_PIX_FMT_YUV422P10
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static av_cold void uninit(AVFilterContext *ctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV444P12
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
#define AV_PIX_FMT_YUVA444P10
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
static int config_input(AVFilterLink *inlink)
#define i(width, name, range_min, range_max)
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
#define AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUVA444P9
#define AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_YUVA422P12
@ AV_OPT_TYPE_INT
Underlying C type is int.
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
#define AV_PIX_FMT_YUV440P12
#define AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_GRAY12
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
#define AV_PIX_FMT_YUV420P14