]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/vf_vectorscope: make color mode more useful
authorPaul B Mahol <onemda@gmail.com>
Sun, 30 Aug 2015 13:34:17 +0000 (13:34 +0000)
committerPaul B Mahol <onemda@gmail.com>
Sun, 30 Aug 2015 13:37:21 +0000 (13:37 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavfilter/vf_vectorscope.c
tests/ref/fate/filter-vectorscope_color

index b1967a2fe0399b1a5e11ef7ffc80e6a7434c0ddd..5b0937699d0c5d77421d048e0e085c04540e57db 100644 (file)
@@ -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)
index 40165b6b0f8641c50a34ae9e9d0abcb315f1f525..3d184f6ca1e39ab70faf55c916866581efea8c34 100644 (file)
@@ -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