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

Codec debug viewer filter. More...

#include "libavutil/imgutils.h"
#include "libavutil/motion_vector.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  CodecViewContext
 

Macros

#define MV_P_FOR   (1<<0)
 
#define MV_B_FOR   (1<<1)
 
#define MV_B_BACK   (1<<2)
 
#define OFFSET(x)   offsetof(CodecViewContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (codecview)
 
static int query_formats (AVFilterContext *ctx)
 
static int clip_line (int *sx, int *sy, int *ex, int *ey, int maxx)
 
static void draw_line (uint8_t *buf, int sx, int sy, int ex, int ey, int w, int h, int stride, int color)
 Draw a line from (ex, ey) -> (sx, sy). More...
 
static void draw_arrow (uint8_t *buf, int sx, int sy, int ex, int ey, int w, int h, int stride, int color, int tail, int direction)
 Draw an arrow from (ex, ey) -> (sx, sy). More...
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 
static int config_input (AVFilterLink *inlink)
 

Variables

static const AVOption codecview_options []
 
static const AVFilterPad codecview_inputs []
 
static const AVFilterPad codecview_outputs []
 
AVFilter ff_vf_codecview
 

Detailed Description

Codec debug viewer filter.

All the MV drawing code from Michael Niedermayer is extracted from libavcodec/mpegvideo.c.

TODO: segmentation

Definition in file vf_codecview.c.

Macro Definition Documentation

#define MV_P_FOR   (1<<0)

Definition at line 38 of file vf_codecview.c.

Referenced by filter_frame().

#define MV_B_FOR   (1<<1)

Definition at line 39 of file vf_codecview.c.

Referenced by filter_frame().

#define MV_B_BACK   (1<<2)

Definition at line 40 of file vf_codecview.c.

Referenced by filter_frame().

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

Definition at line 49 of file vf_codecview.c.

Definition at line 50 of file vf_codecview.c.

Function Documentation

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

Definition at line 62 of file vf_codecview.c.

static int clip_line ( int *  sx,
int *  sy,
int *  ex,
int *  ey,
int  maxx 
)
static

Definition at line 73 of file vf_codecview.c.

Referenced by draw_line().

static void draw_line ( uint8_t buf,
int  sx,
int  sy,
int  ex,
int  ey,
int  w,
int  h,
int  stride,
int  color 
)
static

Draw a line from (ex, ey) -> (sx, sy).

Parameters
wwidth of the image
hheight of the image
stridestride/linesize of the image
colorcolor of the arrow

Definition at line 101 of file vf_codecview.c.

Referenced by draw_arrow().

static void draw_arrow ( uint8_t buf,
int  sx,
int  sy,
int  ex,
int  ey,
int  w,
int  h,
int  stride,
int  color,
int  tail,
int  direction 
)
static

Draw an arrow from (ex, ey) -> (sx, sy).

Parameters
wwidth of the image
hheight of the image
stridestride/linesize of the image
colorcolor of the arrow

Definition at line 159 of file vf_codecview.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 197 of file vf_codecview.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 248 of file vf_codecview.c.

Variable Documentation

const AVOption codecview_options[]
static
Initial value:
= {
{ "mv", "set motion vectors to visualize", OFFSET(mv), AV_OPT_TYPE_FLAGS, {.i64=0}, 0, INT_MAX, FLAGS, "mv" },
{"pf", "forward predicted MVs of P-frames", 0, AV_OPT_TYPE_CONST, {.i64 = MV_P_FOR }, INT_MIN, INT_MAX, FLAGS, "mv"},
{"bf", "forward predicted MVs of B-frames", 0, AV_OPT_TYPE_CONST, {.i64 = MV_B_FOR }, INT_MIN, INT_MAX, FLAGS, "mv"},
{"bb", "backward predicted MVs of B-frames", 0, AV_OPT_TYPE_CONST, {.i64 = MV_B_BACK }, INT_MIN, INT_MAX, FLAGS, "mv"},
{ "qp", NULL, OFFSET(qp), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, .flags = FLAGS },
{ NULL }
}
#define MV_B_BACK
Definition: vf_codecview.c:40
#define NULL
Definition: coverity.c:32
#define FLAGS
Definition: vf_codecview.c:50
#define MV_P_FOR
Definition: vf_codecview.c:38
#define MV_B_FOR
Definition: vf_codecview.c:39
#define OFFSET(x)
Definition: vf_codecview.c:49
static const int8_t mv[256][2]
Definition: 4xm.c:77

Definition at line 51 of file vf_codecview.c.

const AVFilterPad codecview_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
.needs_writable = 1,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_codecview.c:197
static int config_input(AVFilterLink *inlink)
Definition: vf_codecview.c:248

Definition at line 259 of file vf_codecview.c.

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

Definition at line 270 of file vf_codecview.c.

AVFilter ff_vf_codecview
Initial value:
= {
.name = "codecview",
.description = NULL_IF_CONFIG_SMALL("Visualize information about some codecs."),
.priv_size = sizeof(CodecViewContext),
.priv_class = &codecview_class,
}
static const AVFilterPad codecview_outputs[]
Definition: vf_codecview.c:270
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:122
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static const AVFilterPad outputs[]
Definition: af_afftfilt.c:385
static const AVFilterPad inputs[]
Definition: af_afftfilt.c:375
static int query_formats(AVFilterContext *ctx)
Definition: vf_codecview.c:62
static int flags
Definition: cpu.c:47
static const AVFilterPad codecview_inputs[]
Definition: vf_codecview.c:259

Definition at line 278 of file vf_codecview.c.