[FFmpeg-cvslog] avfilter/vf_vectorscope: always flip output vertically

Paul B Mahol git at videolan.org
Sun Mar 20 21:11:18 CET 2016


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Mar 20 21:03:43 2016 +0100| [8f66a2da38094cf09f9b6f109bcde251e8ec7795] | committer: Paul B Mahol

avfilter/vf_vectorscope: always flip output vertically

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

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

 libavfilter/vf_vectorscope.c             |   12 ++++++++++--
 tests/ref/fate/filter-vectorscope_color  |    6 +++---
 tests/ref/fate/filter-vectorscope_color2 |    6 +++---
 tests/ref/fate/filter-vectorscope_color3 |    6 +++---
 tests/ref/fate/filter-vectorscope_color4 |    6 +++---
 tests/ref/fate/filter-vectorscope_gray   |    6 +++---
 tests/ref/fate/filter-vectorscope_xy     |    6 +++---
 7 files changed, 28 insertions(+), 20 deletions(-)

diff --git a/libavfilter/vf_vectorscope.c b/libavfilter/vf_vectorscope.c
index 7d2123b..987bc66 100644
--- a/libavfilter/vf_vectorscope.c
+++ b/libavfilter/vf_vectorscope.c
@@ -911,7 +911,7 @@ static void draw_htext(AVFrame *out, int x, int y, float o1, float o2, const cha
             int v = color[plane];
 
             uint8_t *p = out->data[plane] + y * out->linesize[plane] + (x + i * 8);
-            for (char_y = 0; char_y < font_height; char_y++) {
+            for (char_y = font_height - 1; char_y >= 0; char_y--) {
                 for (mask = 0x80; mask; mask >>= 1) {
                     if (font[txt[i] * font_height + char_y] & mask)
                         p[0] = p[0] * o2 + v * o1;
@@ -937,7 +937,7 @@ static void draw_htext16(AVFrame *out, int x, int y, float o1, float o2, const c
             int v = color[plane];
 
             uint16_t *p = (uint16_t *)(out->data[plane] + y * out->linesize[plane]) + (x + i * 8);
-            for (char_y = 0; char_y < font_height; char_y++) {
+            for (char_y = font_height - 1; char_y >= 0; char_y--) {
                 for (mask = 0x80; mask; mask >>= 1) {
                     if (font[txt[i] * font_height + char_y] & mask)
                         p[0] = p[0] * o2 + v * o1;
@@ -1207,6 +1207,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     VectorscopeContext *s = ctx->priv;
     AVFilterLink *outlink = ctx->outputs[0];
     AVFrame *out;
+    int plane;
 
     if (s->colorspace) {
         s->cs = (s->depth - 8) * 2 + s->colorspace - 1;
@@ -1232,6 +1233,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     s->vectorscope(s, in, out, s->pd);
     s->graticulef(s, out, s->x, s->y, s->pd, s->cs);
 
+    for (plane = 0; plane < 4; plane++) {
+        if (out->data[plane]) {
+            out->data[plane]    += (s->size - 1) * out->linesize[plane];
+            out->linesize[plane] = -out->linesize[plane];
+        }
+    }
+
     av_frame_free(&in);
     return ff_filter_frame(outlink, out);
 }
diff --git a/tests/ref/fate/filter-vectorscope_color b/tests/ref/fate/filter-vectorscope_color
index 3d184f6..780c330 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, 0x1890aa30
-0,          1,          1,        1,   196608, 0xa490acf9
-0,          2,          2,        1,   196608, 0x404a775d
+0,          0,          0,        1,   196608, 0xf6e3aa30
+0,          1,          1,        1,   196608, 0x5584acf9
+0,          2,          2,        1,   196608, 0xa862775d
diff --git a/tests/ref/fate/filter-vectorscope_color2 b/tests/ref/fate/filter-vectorscope_color2
index be69443..417c3e0 100644
--- a/tests/ref/fate/filter-vectorscope_color2
+++ b/tests/ref/fate/filter-vectorscope_color2
@@ -1,4 +1,4 @@
 #tb 0: 1/25
-0,          0,          0,        1,   196608, 0x9bfcfae5
-0,          1,          1,        1,   196608, 0x1ac6fcbf
-0,          2,          2,        1,   196608, 0x31cb1088
+0,          0,          0,        1,   196608, 0x5e62fae5
+0,          1,          1,        1,   196608, 0x4c27fcbf
+0,          2,          2,        1,   196608, 0xb7531088
diff --git a/tests/ref/fate/filter-vectorscope_color3 b/tests/ref/fate/filter-vectorscope_color3
index f297efd..26831cf 100644
--- a/tests/ref/fate/filter-vectorscope_color3
+++ b/tests/ref/fate/filter-vectorscope_color3
@@ -1,4 +1,4 @@
 #tb 0: 1/25
-0,          0,          0,        1,   196608, 0x6e698770
-0,          1,          1,        1,   196608, 0x374d74a7
-0,          2,          2,        1,   196608, 0x3d817143
+0,          0,          0,        1,   196608, 0x83df8770
+0,          1,          1,        1,   196608, 0xa6a674a7
+0,          2,          2,        1,   196608, 0x11757143
diff --git a/tests/ref/fate/filter-vectorscope_color4 b/tests/ref/fate/filter-vectorscope_color4
index 5ede41f..6bdfd5f 100644
--- a/tests/ref/fate/filter-vectorscope_color4
+++ b/tests/ref/fate/filter-vectorscope_color4
@@ -1,4 +1,4 @@
 #tb 0: 1/25
-0,          0,          0,        1,   196608, 0x4d2e53c4
-0,          1,          1,        1,   196608, 0x795e1dcc
-0,          2,          2,        1,   196608, 0xe4268800
+0,          0,          0,        1,   196608, 0x326953c4
+0,          1,          1,        1,   196608, 0x870e1dcc
+0,          2,          2,        1,   196608, 0x87cb8800
diff --git a/tests/ref/fate/filter-vectorscope_gray b/tests/ref/fate/filter-vectorscope_gray
index ed41cc0..f09a9c7 100644
--- a/tests/ref/fate/filter-vectorscope_gray
+++ b/tests/ref/fate/filter-vectorscope_gray
@@ -1,4 +1,4 @@
 #tb 0: 1/25
-0,          0,          0,        1,   196608, 0x8e4171e2
-0,          1,          1,        1,   196608, 0xf3d371e2
-0,          2,          2,        1,   196608, 0xb9cb71e2
+0,          0,          0,        1,   196608, 0x79ba71e2
+0,          1,          1,        1,   196608, 0x909271e2
+0,          2,          2,        1,   196608, 0x143971e2
diff --git a/tests/ref/fate/filter-vectorscope_xy b/tests/ref/fate/filter-vectorscope_xy
index 6a4b8f8..76987ef 100644
--- a/tests/ref/fate/filter-vectorscope_xy
+++ b/tests/ref/fate/filter-vectorscope_xy
@@ -1,4 +1,4 @@
 #tb 0: 1/25
-0,          0,          0,        1,   196608, 0xa0939af1
-0,          1,          1,        1,   196608, 0x43699af1
-0,          2,          2,        1,   196608, 0x69a19af1
+0,          0,          0,        1,   196608, 0xa2899af1
+0,          1,          1,        1,   196608, 0x26409af1
+0,          2,          2,        1,   196608, 0xf5209af1



More information about the ffmpeg-cvslog mailing list