History

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

Bobby Bingham committed 16 years ago

Commit 15ba0151 parent d313e171 file · +5 −5Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_vflip.c+5−5
@@ -63,19 +63,18 @@ static AVFilterPicRef *get_video_buffer(AVFilterLink *link, int perms, · 62 unmodified lines
63static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)63static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
64{64{
65 FlipContext *flip = link->dst->priv;65 FlipContext *flip = link->dst->priv;
66 AVFilterPicRef *ref2 = avfilter_ref_pic(picref, ~0);
67 int i;66 int i;
68 67
69 for (i = 0; i < 4; i ++) {68 for (i = 0; i < 4; i ++) {
70 int vsub = i == 1 || i == 2 ? flip->vsub : 0;69 int vsub = i == 1 || i == 2 ? flip->vsub : 0;
71 70
72 if (ref2->data[i]) {71 if (picref->data[i]) {
73 ref2->data[i] += ((link->h >> vsub)-1) * ref2->linesize[i];72 picref->data[i] += ((link->h >> vsub)-1) * picref->linesize[i];
74 ref2->linesize[i] = -ref2->linesize[i];73 picref->linesize[i] = -picref->linesize[i];
75 }74 }
76 }75 }
77 76
78 avfilter_start_frame(link->dst->outputs[0], ref2);77 avfilter_start_frame(link->dst->outputs[0], picref);
79}78}
80 79
81static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)80static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
@@ -96,6 +95,7 @@ AVFilter avfilter_vf_vflip = { · 14 unmodified lines
96 .get_video_buffer = get_video_buffer,95 .get_video_buffer = get_video_buffer,
97 .start_frame = start_frame,96 .start_frame = start_frame,
98 .draw_slice = draw_slice,97 .draw_slice = draw_slice,
98 .end_frame = avfilter_null_end_frame,
99 .config_props = config_input, },99 .config_props = config_input, },
100 { .name = NULL}},100 { .name = NULL}},
101 .outputs = (AVFilterPad[]) {{ .name = "default",101 .outputs = (AVFilterPad[]) {{ .name = "default",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t