diff options
author | Clément Bœsch <u@pkh.me> | 2014-05-03 18:46:16 +0200 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2014-05-03 19:07:14 +0200 |
commit | 365c79bd4e2e648d03666770a99c3cf81bc5abdb (patch) | |
tree | a99a30c213224ff1f32af731085b1ec405a05bf6 /libavfilter/vf_edgedetect.c | |
parent | b17e98ded0e2489427009acc7f8a8fffaa1ff075 (diff) | |
download | ffmpeg-365c79bd4e2e648d03666770a99c3cf81bc5abdb.tar.gz |
avfilter/edgedetect: reindent after previous commit.
Diffstat (limited to 'libavfilter/vf_edgedetect.c')
-rw-r--r-- | libavfilter/vf_edgedetect.c | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/libavfilter/vf_edgedetect.c b/libavfilter/vf_edgedetect.c index 0e87f92740..94a56f7042 100644 --- a/libavfilter/vf_edgedetect.c +++ b/libavfilter/vf_edgedetect.c @@ -80,9 +80,8 @@ static int query_formats(AVFilterContext *ctx) const EdgeDetectContext *edgedetect = ctx->priv; if (edgedetect->mode == MODE_WIRES) { - /* TODO: reindent */ - static const enum AVPixelFormat pix_fmts[] = {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE}; - ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); + static const enum AVPixelFormat pix_fmts[] = {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE}; + ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); } else if (edgedetect->mode == MODE_COLORMIX) { static const enum AVPixelFormat pix_fmts[] = {AV_PIX_FMT_GBRP, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE}; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); @@ -313,31 +312,30 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) uint16_t *gradients = plane->gradients; int8_t *directions = plane->directions; - /* TODO: reindent */ - /* 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); + /* 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); if (edgedetect->mode == MODE_COLORMIX) { color_mix(inlink->w, inlink->h, |