Go to the source code of this file.
|
#define | SET_META(key, value) av_dict_set_int(metadata, key, value, 0) |
|
#define | FIND(DST, FROM, NOEND, INC, STEP0, STEP1, LEN) |
|
#define | FIND_EDGE(DST, FROM, NOEND, INC, STEP0, STEP1, LEN) |
|
#define | OFFSET(x) offsetof(CropDetectContext, x) |
|
#define | FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM |
|
#define | TFLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_RUNTIME_PARAM |
|
|
static int | comp (const int *a, const int *b) |
|
static int | checkline (void *ctx, const unsigned char *src, int stride, int len, int bpp) |
|
static int | checkline_edge (void *ctx, const unsigned char *src, int stride, int len, int bpp) |
|
static av_cold int | init (AVFilterContext *ctx) |
|
static av_cold void | uninit (AVFilterContext *ctx) |
|
static int | config_input (AVFilterLink *inlink) |
|
static int | filter_frame (AVFilterLink *inlink, AVFrame *frame) |
|
static int | process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags) |
|
| AVFILTER_DEFINE_CLASS (cropdetect) |
|
border detection filter Ported from MPlayer libmpcodecs/vf_cropdetect.c.
Definition in file vf_cropdetect.c.
◆ SET_META
◆ FIND
#define FIND |
( |
|
DST, |
|
|
|
FROM, |
|
|
|
NOEND, |
|
|
|
INC, |
|
|
|
STEP0, |
|
|
|
STEP1, |
|
|
|
LEN |
|
) |
| |
Value: outliers = 0;\
for (last_y = y = FROM; NOEND; y = y INC) {\
if (++outliers >
s->max_outliers) { \
DST = last_y;\
break;\
}\
} else\
last_y = y INC;\
}
◆ FIND_EDGE
#define FIND_EDGE |
( |
|
DST, |
|
|
|
FROM, |
|
|
|
NOEND, |
|
|
|
INC, |
|
|
|
STEP0, |
|
|
|
STEP1, |
|
|
|
LEN |
|
) |
| |
Value: for (last_y = y = FROM; NOEND; y = y INC) { \
if (last_y INC == y) { \
DST = y; \
break; \
} else \
last_y = y; \
} \
} \
if (!(NOEND)) { \
DST = y -(INC); \
}
◆ OFFSET
◆ FLAGS
◆ TFLAGS
◆ CropMode
Enumerator |
---|
MODE_BLACK | |
MODE_MV_EDGES | |
MODE_NB | |
Definition at line 78 of file vf_cropdetect.c.
◆ comp()
static int comp |
( |
const int * |
a, |
|
|
const int * |
b |
|
) |
| |
|
static |
◆ checkline()
static int checkline |
( |
void * |
ctx, |
|
|
const unsigned char * |
src, |
|
|
int |
stride, |
|
|
int |
len, |
|
|
int |
bpp |
|
) |
| |
|
static |
◆ checkline_edge()
static int checkline_edge |
( |
void * |
ctx, |
|
|
const unsigned char * |
src, |
|
|
int |
stride, |
|
|
int |
len, |
|
|
int |
bpp |
|
) |
| |
|
static |
◆ init()
◆ uninit()
◆ config_input()
◆ filter_frame()
◆ process_command()
static int process_command |
( |
AVFilterContext * |
ctx, |
|
|
const char * |
cmd, |
|
|
const char * |
args, |
|
|
char * |
res, |
|
|
int |
res_len, |
|
|
int |
flags |
|
) |
| |
|
static |
◆ AVFILTER_DEFINE_CLASS()
AVFILTER_DEFINE_CLASS |
( |
cropdetect |
| ) |
|
◆ pix_fmts
◆ cropdetect_options
Initial value:= {
{
"reset",
"Recalculate the crop area after this many frames",
OFFSET(reset_count),
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX,
FLAGS },
{
"reset_count",
"Recalculate the crop area after this many frames",
OFFSET(reset_count),
AV_OPT_TYPE_INT,{ .i64 = 0 }, 0, INT_MAX,
FLAGS },
{
"mv_threshold",
"motion vector threshold when estimating video window size",
OFFSET(mv_threshold),
AV_OPT_TYPE_INT, {.i64=8}, 0, 100,
FLAGS},
}
Definition at line 470 of file vf_cropdetect.c.
◆ avfilter_vf_cropdetect_inputs
Initial value:= {
{
.name = "default",
},
}
Definition at line 488 of file vf_cropdetect.c.
◆ ff_vf_cropdetect
Initial value:= {
.name = "cropdetect",
.priv_class = &cropdetect_class,
}
Definition at line 497 of file vf_cropdetect.c.
static av_cold int init(AVFilterContext *ctx)
#define FILTER_PIXFMTS_ARRAY(array)
#define AV_PIX_FMT_YUV420P10
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
static int checkline(void *ctx, const unsigned char *src, int stride, int len, int bpp)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
#define AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_YUV444P10
#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...
#define AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV420P16
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define FILTER_INPUTS(array)
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
@ 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_YUV422P10
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static enum AVPixelFormat pix_fmts[]
#define AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV444P12
static int config_input(AVFilterLink *inlink)
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
static av_always_inline av_const double round(double x)
@ AV_PIX_FMT_NV21
as above, but U and V bytes are swapped
#define AV_PIX_FMT_YUV444P9
static double limit(double x)
@ 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...
#define AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV422P14
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
#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)
static int checkline_edge(void *ctx, const unsigned char *src, int stride, int len, int bpp)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
static const AVFilterPad avfilter_vf_cropdetect_inputs[]
#define FILTER_OUTPUTS(array)
@ 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_YUV444P14
static av_cold void uninit(AVFilterContext *ctx)
static void BS_FUNC() skip(BSCTX *bc, unsigned int n)
Skip n bits in the buffer.
#define AV_PIX_FMT_YUV420P14