avfilter/vf_weave: fix top vs bottom field order
authorPaul B Mahol <onemda@gmail.com>
Wed, 16 Aug 2017 11:29:34 +0000 (13:29 +0200)
committerPaul B Mahol <onemda@gmail.com>
Wed, 16 Aug 2017 11:37:53 +0000 (13:37 +0200)
Fixes #6590.

libavfilter/vf_weave.c
tests/fate/filter-video.mak

index 6d3dd7c..037f5d1 100644 (file)
@@ -100,20 +100,20 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 
     for (i = 0; i < s->nb_planes; i++) {
         if (s->double_weave && !(inlink->frame_count_out & 1)) {
-            av_image_copy_plane(out->data[i] + out->linesize[i] * !s->first_field,
+            av_image_copy_plane(out->data[i] + out->linesize[i] * s->first_field,
                                 out->linesize[i] * 2,
                                 in->data[i], in->linesize[i],
                                 s->linesize[i], s->planeheight[i]);
-            av_image_copy_plane(out->data[i] + out->linesize[i] * s->first_field,
+            av_image_copy_plane(out->data[i] + out->linesize[i] * !s->first_field,
                                 out->linesize[i] * 2,
                                 s->prev->data[i], s->prev->linesize[i],
                                 s->linesize[i], s->planeheight[i]);
         } else {
-            av_image_copy_plane(out->data[i] + out->linesize[i] * s->first_field,
+            av_image_copy_plane(out->data[i] + out->linesize[i] * !s->first_field,
                                 out->linesize[i] * 2,
                                 in->data[i], in->linesize[i],
                                 s->linesize[i], s->planeheight[i]);
-            av_image_copy_plane(out->data[i] + out->linesize[i] * !s->first_field,
+            av_image_copy_plane(out->data[i] + out->linesize[i] * s->first_field,
                                 out->linesize[i] * 2,
                                 s->prev->data[i], s->prev->linesize[i],
                                 s->linesize[i], s->planeheight[i]);
index 53fc7a6..79bbc5c 100644 (file)
@@ -289,7 +289,7 @@ FATE_FILTER_VSYNTH-$(CONFIG_SEPARATEFIELDS_FILTER) += fate-filter-separatefields
 fate-filter-separatefields: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf separatefields
 
 FATE_FILTER_VSYNTH-$(CONFIG_WEAVE_FILTER) += fate-filter-weave
-fate-filter-weave: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf weave
+fate-filter-weave: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf weave=bottom
 
 FATE_FILTER_VSYNTH-$(CONFIG_SELECT_FILTER) += fate-filter-select-alternate
 fate-filter-select-alternate: tests/data/filtergraphs/select-alternate