summaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_vectorscope.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2016-03-20 21:03:43 +0100
committerPaul B Mahol <onemda@gmail.com>2016-03-20 21:10:45 +0100
commit8f66a2da38094cf09f9b6f109bcde251e8ec7795 (patch)
treea50e349e513d8bd337c16e8cce18865f15939ade /libavfilter/vf_vectorscope.c
parent65efcaeb8467f5aff25eaf02b20dae43d5ca9dc7 (diff)
downloadffmpeg-streaming-8f66a2da38094cf09f9b6f109bcde251e8ec7795.zip
ffmpeg-streaming-8f66a2da38094cf09f9b6f109bcde251e8ec7795.tar.gz
avfilter/vf_vectorscope: always flip output vertically
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/vf_vectorscope.c')
-rw-r--r--libavfilter/vf_vectorscope.c12
1 files changed, 10 insertions, 2 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);
}
OpenPOWER on IntegriCloud