diff options
author | Paul B Mahol <onemda@gmail.com> | 2020-09-19 16:34:55 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-09-19 16:38:21 +0200 |
commit | cdc4c268e2fb9daccdb7004a2e5036bf4ce33d13 (patch) | |
tree | 48f1b4551564a888112fbbf724b56cce23f13992 /libavfilter | |
parent | 52d362c6e0bc80ca191817cfac61f26d23d9cff3 (diff) | |
download | ffmpeg-cdc4c268e2fb9daccdb7004a2e5036bf4ce33d13.tar.gz |
avfilter/vf_datascope: fix oscilloscope with gray>8 depth
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_datascope.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavfilter/vf_datascope.c b/libavfilter/vf_datascope.c index 35f60aa2f6..16fafd5732 100644 --- a/libavfilter/vf_datascope.c +++ b/libavfilter/vf_datascope.c @@ -791,7 +791,7 @@ static void draw_line(FFDrawContext *draw, int x0, int y0, int x1, int y1, for (p = 0; p < draw->nb_planes; p++) { if (draw->desc->comp[p].depth == 8) { if (draw->nb_planes == 1) { - for (i = 0; i < 4; i++) { + for (i = 0; i < draw->desc->nb_components; i++) { out->data[0][y0 * out->linesize[0] + x0 * draw->pixelstep[0] + i] = color->comp[0].u8[i]; } } else { @@ -799,8 +799,8 @@ static void draw_line(FFDrawContext *draw, int x0, int y0, int x1, int y1, } } else { if (draw->nb_planes == 1) { - for (i = 0; i < 4; i++) { - AV_WN16(out->data[0] + y0 * out->linesize[0] + 2 * (x0 * draw->pixelstep[0] + i), color->comp[0].u16[i]); + for (i = 0; i < draw->desc->nb_components; i++) { + AV_WN16(out->data[0] + y0 * out->linesize[0] + (x0 * draw->pixelstep[0] + i), color->comp[0].u16[i]); } } else { AV_WN16(out->data[p] + out->linesize[p] * (y0 >> draw->vsub[p]) + (x0 >> draw->hsub[p]) * 2, color->comp[p].u16[0]); @@ -965,7 +965,7 @@ static void draw_scope(OscilloscopeContext *s, int x0, int y0, int x1, int y1, if (s->draw.nb_planes == 1) { int i; - for (i = 0; i < s->draw.pixelstep[0]; i++) + for (i = 0; i < s->nb_comps; i++) out->data[0][out->linesize[0] * y0 + x0 * s->draw.pixelstep[0] + i] = 255 * ((s->nb_values + state) & 1); } else { out->data[0][out->linesize[0] * y0 + x0] = 255 * ((s->nb_values + state) & 1); @@ -974,8 +974,8 @@ static void draw_scope(OscilloscopeContext *s, int x0, int y0, int x1, int y1, if (s->draw.nb_planes == 1) { int i; - for (i = 0; i < s->draw.pixelstep[0]; i++) - AV_WN16(out->data[0] + out->linesize[0] * y0 + 2 * x0 * (s->draw.pixelstep[0] + i), (s->max - 1) * ((s->nb_values + state) & 1)); + for (i = 0; i < s->nb_comps; i++) + AV_WN16(out->data[0] + out->linesize[0] * y0 + x0 * s->draw.pixelstep[0] + i, (s->max - 1) * ((s->nb_values + state) & 1)); } else { AV_WN16(out->data[0] + out->linesize[0] * y0 + 2 * x0, (s->max - 1) * ((s->nb_values + state) & 1)); } |