diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-11-27 10:49:45 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-11-28 11:50:19 +0400 |
commit | 565e4993c63f797e2d50ad2f1e8f62fdbe299666 (patch) | |
tree | bae5282b2ee875de4b01467f3cfaab54b0ab6ec0 /libavfilter/vf_vflip.c | |
parent | bb6c67bb36b136de10256f0999128df4a42f9ffc (diff) |
lavfi: merge start_frame/draw_slice/end_frame
Any alleged performance benefits gained from the split are purely
mythological and do not justify added code complexity.
Diffstat (limited to 'libavfilter/vf_vflip.c')
-rw-r--r-- | libavfilter/vf_vflip.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/libavfilter/vf_vflip.c b/libavfilter/vf_vflip.c index f12290aa03..5e6e9653bd 100644 --- a/libavfilter/vf_vflip.c +++ b/libavfilter/vf_vflip.c @@ -69,41 +69,28 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms, return picref; } -static int start_frame(AVFilterLink *link, AVFilterBufferRef *inpicref) +static int filter_frame(AVFilterLink *link, AVFilterBufferRef *frame) { FlipContext *flip = link->dst->priv; - AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0); int i; - if (!outpicref) - return AVERROR(ENOMEM); - for (i = 0; i < 4; i ++) { int vsub = i == 1 || i == 2 ? flip->vsub : 0; - if (outpicref->data[i]) { - outpicref->data[i] += ((link->h >> vsub)-1) * outpicref->linesize[i]; - outpicref->linesize[i] = -outpicref->linesize[i]; + if (frame->data[i]) { + frame->data[i] += ((link->h >> vsub)-1) * frame->linesize[i]; + frame->linesize[i] = -frame->linesize[i]; } } - return ff_start_frame(link->dst->outputs[0], outpicref); -} - -static int draw_slice(AVFilterLink *link, int y, int h, int slice_dir) -{ - AVFilterContext *ctx = link->dst; - - return ff_draw_slice(ctx->outputs[0], link->h - (y+h), h, -1 * slice_dir); + return ff_filter_frame(link->dst->outputs[0], frame); } - static const AVFilterPad avfilter_vf_vflip_inputs[] = { { .name = "default", .type = AVMEDIA_TYPE_VIDEO, .get_video_buffer = get_video_buffer, - .start_frame = start_frame, - .draw_slice = draw_slice, + .filter_frame = filter_frame, .config_props = config_input, }, { NULL } |