Commit d5598c09 authored by Paul B Mahol's avatar Paul B Mahol

lavfi/drawutils: set subsampling for rgb too

Otherwise it is incorrectly set to 1.
Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent ed448efe
...@@ -180,10 +180,8 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags) ...@@ -180,10 +180,8 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
draw->format = format; draw->format = format;
draw->nb_planes = nb_planes; draw->nb_planes = nb_planes;
memcpy(draw->pixelstep, pixelstep, sizeof(draw->pixelstep)); memcpy(draw->pixelstep, pixelstep, sizeof(draw->pixelstep));
if (nb_planes >= 3 && !(desc->flags & AV_PIX_FMT_FLAG_RGB)) {
draw->hsub[1] = draw->hsub[2] = draw->hsub_max = desc->log2_chroma_w; draw->hsub[1] = draw->hsub[2] = draw->hsub_max = desc->log2_chroma_w;
draw->vsub[1] = draw->vsub[2] = draw->vsub_max = desc->log2_chroma_h; draw->vsub[1] = draw->vsub[2] = draw->vsub_max = desc->log2_chroma_h;
}
for (i = 0; i < ((desc->nb_components - 1) | 1); i++) for (i = 0; i < ((desc->nb_components - 1) | 1); i++)
draw->comp_mask[desc->comp[i].plane] |= draw->comp_mask[desc->comp[i].plane] |=
1 << (desc->comp[i].offset_plus1 - 1); 1 << (desc->comp[i].offset_plus1 - 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment