Browse code

Fix slicify when the slice_direction is negative, make it send slices from the bottom to the top one.

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

Stefano Sabatini authored on 2009/12/07 02:40:41
Showing 1 changed files
... ...
@@ -78,11 +78,19 @@ static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
78 78
     SliceContext *slice = link->dst->priv;
79 79
     int y2;
80 80
 
81
+    if (slice_dir == 1) {
81 82
     for (y2 = y; y2 + slice->h <= y + h; y2 += slice->h)
82 83
         avfilter_draw_slice(link->dst->outputs[0], y2, slice->h, slice_dir);
83 84
 
84 85
     if (y2 < y + h)
85 86
         avfilter_draw_slice(link->dst->outputs[0], y2, y + h - y2, slice_dir);
87
+    } else if (slice_dir == -1) {
88
+        for (y2 = y + h; y2 - slice->h >= y; y2 -= slice->h)
89
+            avfilter_draw_slice(link->dst->outputs[0], y2 - slice->h, slice->h, slice_dir);
90
+
91
+        if (y2 > y)
92
+            avfilter_draw_slice(link->dst->outputs[0], y, y2 - y, slice_dir);
93
+    }
86 94
 }
87 95
 
88 96
 AVFilter avfilter_vf_slicify = {