2012-07-26 19:45:53 +02:00
|
|
|
/*
|
2014-05-03 19:10:28 +02:00
|
|
|
* Copyright (c) 2012-2014 Clément Bœsch <u pkh me>
|
2012-07-26 19:45:53 +02:00
|
|
|
*
|
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Edge detection filter
|
|
|
|
*
|
2012-08-20 23:12:34 +02:00
|
|
|
* @see https://en.wikipedia.org/wiki/Canny_edge_detector
|
2012-07-26 19:45:53 +02:00
|
|
|
*/
|
|
|
|
|
2014-05-03 17:41:32 +02:00
|
|
|
#include "libavutil/avassert.h"
|
2012-07-26 19:45:53 +02:00
|
|
|
#include "libavutil/opt.h"
|
|
|
|
#include "avfilter.h"
|
|
|
|
#include "formats.h"
|
|
|
|
#include "internal.h"
|
|
|
|
#include "video.h"
|
|
|
|
|
2014-05-03 17:41:32 +02:00
|
|
|
enum FilterMode {
|
|
|
|
MODE_WIRES,
|
|
|
|
MODE_COLORMIX,
|
|
|
|
NB_MODE
|
|
|
|
};
|
|
|
|
|
|
|
|
struct plane_info {
|
2012-07-26 19:45:53 +02:00
|
|
|
uint8_t *tmpbuf;
|
|
|
|
uint16_t *gradients;
|
|
|
|
char *directions;
|
2014-05-03 17:41:32 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const AVClass *class;
|
|
|
|
struct plane_info planes[3];
|
|
|
|
int nb_planes;
|
2012-07-26 19:45:53 +02:00
|
|
|
double low, high;
|
|
|
|
uint8_t low_u8, high_u8;
|
2015-03-08 20:59:51 +01:00
|
|
|
int mode;
|
2012-07-26 19:45:53 +02:00
|
|
|
} EdgeDetectContext;
|
|
|
|
|
|
|
|
#define OFFSET(x) offsetof(EdgeDetectContext, x)
|
2012-08-13 13:40:01 +02:00
|
|
|
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
|
2012-07-26 19:45:53 +02:00
|
|
|
static const AVOption edgedetect_options[] = {
|
2012-08-13 13:40:01 +02:00
|
|
|
{ "high", "set high threshold", OFFSET(high), AV_OPT_TYPE_DOUBLE, {.dbl=50/255.}, 0, 1, FLAGS },
|
|
|
|
{ "low", "set low threshold", OFFSET(low), AV_OPT_TYPE_DOUBLE, {.dbl=20/255.}, 0, 1, FLAGS },
|
2014-05-03 17:41:32 +02:00
|
|
|
{ "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_WIRES}, 0, NB_MODE-1, FLAGS, "mode" },
|
|
|
|
{ "wires", "white/gray wires on black", 0, AV_OPT_TYPE_CONST, {.i64=MODE_WIRES}, INT_MIN, INT_MAX, FLAGS, "mode" },
|
|
|
|
{ "colormix", "mix colors", 0, AV_OPT_TYPE_CONST, {.i64=MODE_COLORMIX}, INT_MIN, INT_MAX, FLAGS, "mode" },
|
2013-09-07 14:13:50 +02:00
|
|
|
{ NULL }
|
2012-07-26 19:45:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
AVFILTER_DEFINE_CLASS(edgedetect);
|
|
|
|
|
2013-04-12 11:13:33 +02:00
|
|
|
static av_cold int init(AVFilterContext *ctx)
|
2012-07-26 19:45:53 +02:00
|
|
|
{
|
|
|
|
EdgeDetectContext *edgedetect = ctx->priv;
|
|
|
|
|
2012-08-17 08:07:37 +02:00
|
|
|
edgedetect->low_u8 = edgedetect->low * 255. + .5;
|
|
|
|
edgedetect->high_u8 = edgedetect->high * 255. + .5;
|
2012-07-26 19:45:53 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int query_formats(AVFilterContext *ctx)
|
|
|
|
{
|
2014-05-03 17:41:32 +02:00
|
|
|
const EdgeDetectContext *edgedetect = ctx->priv;
|
2015-03-15 14:20:34 +01:00
|
|
|
static const enum AVPixelFormat wires_pix_fmts[] = {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE};
|
|
|
|
static const enum AVPixelFormat colormix_pix_fmts[] = {AV_PIX_FMT_GBRP, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE};
|
|
|
|
AVFilterFormats *fmts_list;
|
|
|
|
const enum AVPixelFormat *pix_fmts = NULL;
|
2014-05-03 17:41:32 +02:00
|
|
|
|
|
|
|
if (edgedetect->mode == MODE_WIRES) {
|
2015-03-15 14:20:34 +01:00
|
|
|
pix_fmts = wires_pix_fmts;
|
2014-05-03 17:41:32 +02:00
|
|
|
} else if (edgedetect->mode == MODE_COLORMIX) {
|
2015-03-15 14:20:34 +01:00
|
|
|
pix_fmts = colormix_pix_fmts;
|
2014-05-03 17:41:32 +02:00
|
|
|
} else {
|
|
|
|
av_assert0(0);
|
|
|
|
}
|
2015-03-15 14:20:34 +01:00
|
|
|
fmts_list = ff_make_format_list(pix_fmts);
|
|
|
|
if (!fmts_list)
|
|
|
|
return AVERROR(ENOMEM);
|
|
|
|
return ff_set_common_formats(ctx, fmts_list);
|
2012-07-26 19:45:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static int config_props(AVFilterLink *inlink)
|
|
|
|
{
|
2014-05-03 17:41:32 +02:00
|
|
|
int p;
|
2012-07-26 19:45:53 +02:00
|
|
|
AVFilterContext *ctx = inlink->dst;
|
|
|
|
EdgeDetectContext *edgedetect = ctx->priv;
|
|
|
|
|
2014-05-03 17:41:32 +02:00
|
|
|
edgedetect->nb_planes = inlink->format == AV_PIX_FMT_GRAY8 ? 1 : 3;
|
|
|
|
for (p = 0; p < edgedetect->nb_planes; p++) {
|
|
|
|
struct plane_info *plane = &edgedetect->planes[p];
|
|
|
|
|
|
|
|
plane->tmpbuf = av_malloc(inlink->w * inlink->h);
|
|
|
|
plane->gradients = av_calloc(inlink->w * inlink->h, sizeof(*plane->gradients));
|
|
|
|
plane->directions = av_malloc(inlink->w * inlink->h);
|
|
|
|
if (!plane->tmpbuf || !plane->gradients || !plane->directions)
|
|
|
|
return AVERROR(ENOMEM);
|
|
|
|
}
|
2012-07-26 19:45:53 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void gaussian_blur(AVFilterContext *ctx, int w, int h,
|
|
|
|
uint8_t *dst, int dst_linesize,
|
|
|
|
const uint8_t *src, int src_linesize)
|
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
memcpy(dst, src, w); dst += dst_linesize; src += src_linesize;
|
|
|
|
memcpy(dst, src, w); dst += dst_linesize; src += src_linesize;
|
|
|
|
for (j = 2; j < h - 2; j++) {
|
|
|
|
dst[0] = src[0];
|
|
|
|
dst[1] = src[1];
|
|
|
|
for (i = 2; i < w - 2; i++) {
|
|
|
|
/* Gaussian mask of size 5x5 with sigma = 1.4 */
|
|
|
|
dst[i] = ((src[-2*src_linesize + i-2] + src[2*src_linesize + i-2]) * 2
|
|
|
|
+ (src[-2*src_linesize + i-1] + src[2*src_linesize + i-1]) * 4
|
|
|
|
+ (src[-2*src_linesize + i ] + src[2*src_linesize + i ]) * 5
|
|
|
|
+ (src[-2*src_linesize + i+1] + src[2*src_linesize + i+1]) * 4
|
|
|
|
+ (src[-2*src_linesize + i+2] + src[2*src_linesize + i+2]) * 2
|
|
|
|
|
|
|
|
+ (src[ -src_linesize + i-2] + src[ src_linesize + i-2]) * 4
|
|
|
|
+ (src[ -src_linesize + i-1] + src[ src_linesize + i-1]) * 9
|
|
|
|
+ (src[ -src_linesize + i ] + src[ src_linesize + i ]) * 12
|
|
|
|
+ (src[ -src_linesize + i+1] + src[ src_linesize + i+1]) * 9
|
|
|
|
+ (src[ -src_linesize + i+2] + src[ src_linesize + i+2]) * 4
|
|
|
|
|
|
|
|
+ src[i-2] * 5
|
|
|
|
+ src[i-1] * 12
|
|
|
|
+ src[i ] * 15
|
|
|
|
+ src[i+1] * 12
|
|
|
|
+ src[i+2] * 5) / 159;
|
|
|
|
}
|
|
|
|
dst[i ] = src[i ];
|
|
|
|
dst[i + 1] = src[i + 1];
|
|
|
|
|
|
|
|
dst += dst_linesize;
|
|
|
|
src += src_linesize;
|
|
|
|
}
|
|
|
|
memcpy(dst, src, w); dst += dst_linesize; src += src_linesize;
|
|
|
|
memcpy(dst, src, w);
|
|
|
|
}
|
|
|
|
|
|
|
|
enum {
|
|
|
|
DIRECTION_45UP,
|
|
|
|
DIRECTION_45DOWN,
|
|
|
|
DIRECTION_HORIZONTAL,
|
|
|
|
DIRECTION_VERTICAL,
|
|
|
|
};
|
|
|
|
|
|
|
|
static int get_rounded_direction(int gx, int gy)
|
|
|
|
{
|
|
|
|
/* reference angles:
|
|
|
|
* tan( pi/8) = sqrt(2)-1
|
|
|
|
* tan(3pi/8) = sqrt(2)+1
|
|
|
|
* Gy/Gx is the tangent of the angle (theta), so Gy/Gx is compared against
|
|
|
|
* <ref-angle>, or more simply Gy against <ref-angle>*Gx
|
|
|
|
*
|
2012-10-01 22:31:14 +02:00
|
|
|
* Gx and Gy bounds = [-1020;1020], using 16-bit arithmetic:
|
2012-07-26 19:45:53 +02:00
|
|
|
* round((sqrt(2)-1) * (1<<16)) = 27146
|
|
|
|
* round((sqrt(2)+1) * (1<<16)) = 158218
|
|
|
|
*/
|
|
|
|
if (gx) {
|
|
|
|
int tanpi8gx, tan3pi8gx;
|
|
|
|
|
|
|
|
if (gx < 0)
|
|
|
|
gx = -gx, gy = -gy;
|
|
|
|
gy <<= 16;
|
|
|
|
tanpi8gx = 27146 * gx;
|
|
|
|
tan3pi8gx = 158218 * gx;
|
|
|
|
if (gy > -tan3pi8gx && gy < -tanpi8gx) return DIRECTION_45UP;
|
|
|
|
if (gy > -tanpi8gx && gy < tanpi8gx) return DIRECTION_HORIZONTAL;
|
|
|
|
if (gy > tanpi8gx && gy < tan3pi8gx) return DIRECTION_45DOWN;
|
|
|
|
}
|
|
|
|
return DIRECTION_VERTICAL;
|
|
|
|
}
|
|
|
|
|
2014-05-03 14:57:51 +02:00
|
|
|
static void sobel(int w, int h,
|
|
|
|
uint16_t *dst, int dst_linesize,
|
|
|
|
int8_t *dir, int dir_linesize,
|
|
|
|
const uint8_t *src, int src_linesize)
|
2012-07-26 19:45:53 +02:00
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
for (j = 1; j < h - 1; j++) {
|
|
|
|
dst += dst_linesize;
|
2014-05-03 14:57:51 +02:00
|
|
|
dir += dir_linesize;
|
2012-07-26 19:45:53 +02:00
|
|
|
src += src_linesize;
|
|
|
|
for (i = 1; i < w - 1; i++) {
|
|
|
|
const int gx =
|
|
|
|
-1*src[-src_linesize + i-1] + 1*src[-src_linesize + i+1]
|
|
|
|
-2*src[ i-1] + 2*src[ i+1]
|
|
|
|
-1*src[ src_linesize + i-1] + 1*src[ src_linesize + i+1];
|
|
|
|
const int gy =
|
|
|
|
-1*src[-src_linesize + i-1] + 1*src[ src_linesize + i-1]
|
|
|
|
-2*src[-src_linesize + i ] + 2*src[ src_linesize + i ]
|
|
|
|
-1*src[-src_linesize + i+1] + 1*src[ src_linesize + i+1];
|
|
|
|
|
|
|
|
dst[i] = FFABS(gx) + FFABS(gy);
|
2014-05-03 14:57:51 +02:00
|
|
|
dir[i] = get_rounded_direction(gx, gy);
|
2012-07-26 19:45:53 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-03 14:57:51 +02:00
|
|
|
static void non_maximum_suppression(int w, int h,
|
2012-07-26 19:45:53 +02:00
|
|
|
uint8_t *dst, int dst_linesize,
|
2014-05-03 14:57:51 +02:00
|
|
|
const int8_t *dir, int dir_linesize,
|
2012-07-26 19:45:53 +02:00
|
|
|
const uint16_t *src, int src_linesize)
|
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
#define COPY_MAXIMA(ay, ax, by, bx) do { \
|
|
|
|
if (src[i] > src[(ay)*src_linesize + i+(ax)] && \
|
|
|
|
src[i] > src[(by)*src_linesize + i+(bx)]) \
|
|
|
|
dst[i] = av_clip_uint8(src[i]); \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
for (j = 1; j < h - 1; j++) {
|
|
|
|
dst += dst_linesize;
|
2014-05-03 14:57:51 +02:00
|
|
|
dir += dir_linesize;
|
2012-07-26 19:45:53 +02:00
|
|
|
src += src_linesize;
|
|
|
|
for (i = 1; i < w - 1; i++) {
|
2014-05-03 14:57:51 +02:00
|
|
|
switch (dir[i]) {
|
2012-07-26 19:45:53 +02:00
|
|
|
case DIRECTION_45UP: COPY_MAXIMA( 1, -1, -1, 1); break;
|
|
|
|
case DIRECTION_45DOWN: COPY_MAXIMA(-1, -1, 1, 1); break;
|
|
|
|
case DIRECTION_HORIZONTAL: COPY_MAXIMA( 0, -1, 0, 1); break;
|
|
|
|
case DIRECTION_VERTICAL: COPY_MAXIMA(-1, 0, 1, 0); break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-03 14:57:51 +02:00
|
|
|
static void double_threshold(int low, int high, int w, int h,
|
2012-07-26 19:45:53 +02:00
|
|
|
uint8_t *dst, int dst_linesize,
|
|
|
|
const uint8_t *src, int src_linesize)
|
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
for (j = 0; j < h; j++) {
|
|
|
|
for (i = 0; i < w; i++) {
|
|
|
|
if (src[i] > high) {
|
|
|
|
dst[i] = src[i];
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((!i || i == w - 1 || !j || j == h - 1) &&
|
|
|
|
src[i] > low &&
|
|
|
|
(src[-src_linesize + i-1] > high ||
|
|
|
|
src[-src_linesize + i ] > high ||
|
|
|
|
src[-src_linesize + i+1] > high ||
|
|
|
|
src[ i-1] > high ||
|
|
|
|
src[ i+1] > high ||
|
|
|
|
src[ src_linesize + i-1] > high ||
|
|
|
|
src[ src_linesize + i ] > high ||
|
|
|
|
src[ src_linesize + i+1] > high))
|
|
|
|
dst[i] = src[i];
|
|
|
|
else
|
|
|
|
dst[i] = 0;
|
|
|
|
}
|
|
|
|
dst += dst_linesize;
|
|
|
|
src += src_linesize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-03 17:41:32 +02:00
|
|
|
static void color_mix(int w, int h,
|
|
|
|
uint8_t *dst, int dst_linesize,
|
|
|
|
const uint8_t *src, int src_linesize)
|
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
for (j = 0; j < h; j++) {
|
|
|
|
for (i = 0; i < w; i++)
|
|
|
|
dst[i] = (dst[i] + src[i]) >> 1;
|
|
|
|
dst += dst_linesize;
|
|
|
|
src += src_linesize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-10 01:30:30 +01:00
|
|
|
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
2012-07-26 19:45:53 +02:00
|
|
|
{
|
|
|
|
AVFilterContext *ctx = inlink->dst;
|
|
|
|
EdgeDetectContext *edgedetect = ctx->priv;
|
2014-05-17 11:47:28 +02:00
|
|
|
AVFilterLink *outlink = ctx->outputs[0];
|
2014-05-03 17:41:32 +02:00
|
|
|
int p, direct = 0;
|
2013-03-10 01:30:30 +01:00
|
|
|
AVFrame *out;
|
2012-11-28 19:56:18 +01:00
|
|
|
|
2014-05-03 17:41:32 +02:00
|
|
|
if (edgedetect->mode != MODE_COLORMIX && av_frame_is_writable(in)) {
|
2013-04-03 00:21:11 +02:00
|
|
|
direct = 1;
|
|
|
|
out = in;
|
|
|
|
} else {
|
2013-04-03 00:31:19 +02:00
|
|
|
out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
|
|
|
|
if (!out) {
|
|
|
|
av_frame_free(&in);
|
|
|
|
return AVERROR(ENOMEM);
|
|
|
|
}
|
|
|
|
av_frame_copy_props(out, in);
|
2013-04-03 00:21:11 +02:00
|
|
|
}
|
2012-07-26 19:45:53 +02:00
|
|
|
|
2014-05-03 17:41:32 +02:00
|
|
|
for (p = 0; p < edgedetect->nb_planes; p++) {
|
|
|
|
struct plane_info *plane = &edgedetect->planes[p];
|
|
|
|
uint8_t *tmpbuf = plane->tmpbuf;
|
|
|
|
uint16_t *gradients = plane->gradients;
|
|
|
|
int8_t *directions = plane->directions;
|
|
|
|
|
2014-05-03 18:46:16 +02:00
|
|
|
/* gaussian filter to reduce noise */
|
|
|
|
gaussian_blur(ctx, inlink->w, inlink->h,
|
|
|
|
tmpbuf, inlink->w,
|
|
|
|
in->data[p], in->linesize[p]);
|
|
|
|
|
|
|
|
/* compute the 16-bits gradients and directions for the next step */
|
|
|
|
sobel(inlink->w, inlink->h,
|
|
|
|
gradients, inlink->w,
|
|
|
|
directions,inlink->w,
|
|
|
|
tmpbuf, inlink->w);
|
|
|
|
|
|
|
|
/* non_maximum_suppression() will actually keep & clip what's necessary and
|
|
|
|
* ignore the rest, so we need a clean output buffer */
|
|
|
|
memset(tmpbuf, 0, inlink->w * inlink->h);
|
|
|
|
non_maximum_suppression(inlink->w, inlink->h,
|
|
|
|
tmpbuf, inlink->w,
|
|
|
|
directions,inlink->w,
|
|
|
|
gradients, inlink->w);
|
|
|
|
|
|
|
|
/* keep high values, or low values surrounded by high values */
|
|
|
|
double_threshold(edgedetect->low_u8, edgedetect->high_u8,
|
|
|
|
inlink->w, inlink->h,
|
|
|
|
out->data[p], out->linesize[p],
|
|
|
|
tmpbuf, inlink->w);
|
2012-07-26 19:45:53 +02:00
|
|
|
|
2014-05-03 17:41:32 +02:00
|
|
|
if (edgedetect->mode == MODE_COLORMIX) {
|
|
|
|
color_mix(inlink->w, inlink->h,
|
|
|
|
out->data[p], out->linesize[p],
|
|
|
|
in->data[p], in->linesize[p]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-03 00:21:11 +02:00
|
|
|
if (!direct)
|
|
|
|
av_frame_free(&in);
|
2012-11-28 19:56:18 +01:00
|
|
|
return ff_filter_frame(outlink, out);
|
2012-07-26 19:45:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static av_cold void uninit(AVFilterContext *ctx)
|
|
|
|
{
|
2014-05-03 17:41:32 +02:00
|
|
|
int p;
|
2012-07-26 19:45:53 +02:00
|
|
|
EdgeDetectContext *edgedetect = ctx->priv;
|
2014-05-03 17:41:32 +02:00
|
|
|
|
|
|
|
for (p = 0; p < edgedetect->nb_planes; p++) {
|
|
|
|
struct plane_info *plane = &edgedetect->planes[p];
|
|
|
|
av_freep(&plane->tmpbuf);
|
|
|
|
av_freep(&plane->gradients);
|
|
|
|
av_freep(&plane->directions);
|
|
|
|
}
|
2012-07-26 19:45:53 +02:00
|
|
|
}
|
|
|
|
|
2012-11-28 20:01:59 +01:00
|
|
|
static const AVFilterPad edgedetect_inputs[] = {
|
|
|
|
{
|
|
|
|
.name = "default",
|
|
|
|
.type = AVMEDIA_TYPE_VIDEO,
|
|
|
|
.config_props = config_props,
|
|
|
|
.filter_frame = filter_frame,
|
2015-01-15 11:39:41 +01:00
|
|
|
},
|
|
|
|
{ NULL }
|
2012-11-28 20:01:59 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
static const AVFilterPad edgedetect_outputs[] = {
|
2015-01-15 11:39:41 +01:00
|
|
|
{
|
|
|
|
.name = "default",
|
|
|
|
.type = AVMEDIA_TYPE_VIDEO,
|
|
|
|
},
|
|
|
|
{ NULL }
|
2012-11-28 20:01:59 +01:00
|
|
|
};
|
|
|
|
|
2013-10-29 11:50:56 +01:00
|
|
|
AVFilter ff_vf_edgedetect = {
|
2012-07-26 19:45:53 +02:00
|
|
|
.name = "edgedetect",
|
|
|
|
.description = NULL_IF_CONFIG_SMALL("Detect and draw edge."),
|
|
|
|
.priv_size = sizeof(EdgeDetectContext),
|
|
|
|
.init = init,
|
|
|
|
.uninit = uninit,
|
|
|
|
.query_formats = query_formats,
|
2012-11-28 20:01:59 +01:00
|
|
|
.inputs = edgedetect_inputs,
|
|
|
|
.outputs = edgedetect_outputs,
|
2012-11-28 23:36:50 +01:00
|
|
|
.priv_class = &edgedetect_class,
|
2013-05-09 01:04:41 +02:00
|
|
|
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
|
2012-07-26 19:45:53 +02:00
|
|
|
};
|