Commit 2609ad3e authored by Stefano Sabatini's avatar Stefano Sabatini

Revert commit r22596.

  commit ab8610aa176c13b5e25a2d8770df28a14665e169
  Author: koorogi <koorogi@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
  Date:   Thu Mar 18 23:13:04 2010 +0000

    The vflip filter does not need to keep ownership of a picture reference.
    Avoid creating and releasing useless extra picture references in the
    start_frame and end_frame callbacks.

    Originally committed as revision 22596 to svn://svn.ffmpeg.org/ffmpeg/trunk

The new reference creation is required when the linesizes are used by the
previous filters in the filterchain, for example as in "pad=W:H:X:Y,vflip".

Originally committed as revision 26059 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 69b8d83e
...@@ -60,21 +60,22 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms, ...@@ -60,21 +60,22 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms,
return picref; return picref;
} }
static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) static void start_frame(AVFilterLink *link, AVFilterBufferRef *inpicref)
{ {
FlipContext *flip = link->dst->priv; FlipContext *flip = link->dst->priv;
AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0);
int i; int i;
for (i = 0; i < 4; i ++) { for (i = 0; i < 4; i ++) {
int vsub = i == 1 || i == 2 ? flip->vsub : 0; int vsub = i == 1 || i == 2 ? flip->vsub : 0;
if (picref->data[i]) { if (outpicref->data[i]) {
picref->data[i] += ((link->h >> vsub)-1) * picref->linesize[i]; outpicref->data[i] += ((link->h >> vsub)-1) * outpicref->linesize[i];
picref->linesize[i] = -picref->linesize[i]; outpicref->linesize[i] = -outpicref->linesize[i];
} }
} }
avfilter_start_frame(link->dst->outputs[0], picref); avfilter_start_frame(link->dst->outputs[0], outpicref);
} }
static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir) static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
...@@ -95,7 +96,6 @@ AVFilter avfilter_vf_vflip = { ...@@ -95,7 +96,6 @@ AVFilter avfilter_vf_vflip = {
.get_video_buffer = get_video_buffer, .get_video_buffer = get_video_buffer,
.start_frame = start_frame, .start_frame = start_frame,
.draw_slice = draw_slice, .draw_slice = draw_slice,
.end_frame = avfilter_null_end_frame,
.config_props = config_input, }, .config_props = config_input, },
{ .name = NULL}}, { .name = NULL}},
.outputs = (AVFilterPad[]) {{ .name = "default", .outputs = (AVFilterPad[]) {{ .name = "default",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment