]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/vf_vectorscope: always flip output vertically
authorPaul B Mahol <onemda@gmail.com>
Sun, 20 Mar 2016 20:03:43 +0000 (21:03 +0100)
committerPaul B Mahol <onemda@gmail.com>
Sun, 20 Mar 2016 20:10:45 +0000 (21:10 +0100)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavfilter/vf_vectorscope.c
tests/ref/fate/filter-vectorscope_color
tests/ref/fate/filter-vectorscope_color2
tests/ref/fate/filter-vectorscope_color3
tests/ref/fate/filter-vectorscope_color4
tests/ref/fate/filter-vectorscope_gray
tests/ref/fate/filter-vectorscope_xy

index 7d2123b7a8607208850b943048a8cca78143398d..987bc66bd49a04a20e1fb52c497ae779283927fd 100644 (file)
@@ -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);
 }
index 3d184f6ca1e39ab70faf55c916866581efea8c34..780c330caf490cda74a6621fb261517f7c3792e9 100644 (file)
@@ -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
index be69443e763f827366b6f34c0a578b5ddb8f6142..417c3e05b7e833433555eed08a91f0e4b2b09982 100644 (file)
@@ -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
index f297efd994dc7bd37832477f9becc715a317da84..26831cfdedfff954856fafe72feb429dc1464517 100644 (file)
@@ -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
index 5ede41f508fad116bf4984daa30b6467d86a2760..6bdfd5fa944095123c4549e5f860607f9c514fa3 100644 (file)
@@ -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
index ed41cc0637dbec448d5355b56a762a2485c0c8be..f09a9c745057ec8725eef3c98f07ce3a32777201 100644 (file)
@@ -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
index 6a4b8f8502e56c924fcb5a2b4c562ee565605576..76987ef38dfb3be28371d9786bc238349a65b401 100644 (file)
@@ -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