[FFmpeg-cvslog] avfilter/vf_vectorscope: make color mode more useful

Paul B Mahol git at videolan.org
Sun Aug 30 15:48:07 CEST 2015


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Aug 30 13:34:17 2015 +0000| [dead1964ea8c4a87adb098c2c1abb2778b01831f] | committer: Paul B Mahol

avfilter/vf_vectorscope: make color mode more useful

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dead1964ea8c4a87adb098c2c1abb2778b01831f
---

 libavfilter/vf_vectorscope.c            |   22 ++++++++++++----------
 tests/ref/fate/filter-vectorscope_color |    6 +++---
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/libavfilter/vf_vectorscope.c b/libavfilter/vf_vectorscope.c
index b1967a2..5b09376 100644
--- a/libavfilter/vf_vectorscope.c
+++ b/libavfilter/vf_vectorscope.c
@@ -305,16 +305,6 @@ static void vectorscope(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd
                 }
             }
         }
-        if (s->mode == COLOR) {
-            for (i = 0; i < out->height; i++) {
-                for (j = 0; j < out->width; j++) {
-                    if (!dpd[i * out->linesize[pd] + j]) {
-                        dpx[i * out->linesize[px] + j] = j;
-                        dpy[i * out->linesize[py] + j] = i;
-                    }
-                }
-            }
-        }
         break;
     case COLOR2:
         if (s->is_yuv) {
@@ -393,6 +383,18 @@ static void vectorscope(VectorscopeContext *s, AVFrame *in, AVFrame *out, int pd
     }
 
     envelope(s, out);
+
+    if (s->mode == COLOR) {
+        for (i = 0; i < out->height; i++) {
+            for (j = 0; j < out->width; j++) {
+                if (!dpd[i * out->linesize[pd] + j]) {
+                    dpx[i * out->linesize[px] + j] = j;
+                    dpy[i * out->linesize[py] + j] = i;
+                    dpd[i * out->linesize[pd] + j] = 128;
+                }
+            }
+        }
+    }
 }
 
 static int filter_frame(AVFilterLink *inlink, AVFrame *in)
diff --git a/tests/ref/fate/filter-vectorscope_color b/tests/ref/fate/filter-vectorscope_color
index 40165b6..3d184f6 100644
--- a/tests/ref/fate/filter-vectorscope_color
+++ b/tests/ref/fate/filter-vectorscope_color
@@ -1,4 +1,4 @@
 #tb 0: 1/25
-0,          0,          0,        1,   196608, 0x9d705c63
-0,          1,          1,        1,   196608, 0x9fbf6f2c
-0,          2,          2,        1,   196608, 0x257b7290
+0,          0,          0,        1,   196608, 0x1890aa30
+0,          1,          1,        1,   196608, 0xa490acf9
+0,          2,          2,        1,   196608, 0x404a775d



More information about the ffmpeg-cvslog mailing list