diff options
author | Philipp Zabel <[email protected]> | 2020-03-18 19:35:31 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <[email protected]> | 2020-04-14 11:46:03 +0200 |
commit | dbe939814cfa0154421ab1643f48b7cdd379d522 (patch) | |
tree | fb02a16ebe3bb77924b6e1d771fa44dfe9f68173 | |
parent | 58d4c14ed89ca51c782cab7ae6bf2c5215109204 (diff) |
media: coda: round up decoded buffer size for all codecs
The BIT decoders always write 16x16 macroblocks. Align stride and height to
avoid spilling luma data into the top of the chroma planes.
Signed-off-by: Philipp Zabel <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r-- | drivers/media/platform/coda/coda-common.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index d0d093dd8f7c..46163e524c1e 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c @@ -637,8 +637,8 @@ static int coda_try_fmt_vid_cap(struct file *file, void *priv, if (ret < 0) return ret; - /* The h.264 decoder only returns complete 16x16 macroblocks */ - if (codec && codec->src_fourcc == V4L2_PIX_FMT_H264) { + /* The decoders always write complete macroblocks */ + if (ctx->inst_type == CODA_INST_DECODER) { f->fmt.pix.height = round_up(f->fmt.pix.height, 16); f->fmt.pix.bytesperline = round_up(f->fmt.pix.width, 16); f->fmt.pix.sizeimage = f->fmt.pix.bytesperline * |