diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2017-12-07 09:59:51 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-12-18 15:00:16 -0500 |
commit | 645838b51962e457250569d0fbe435d13792b93f (patch) | |
tree | 840a8fb9325b988d5d5b358560b8304027017bdd /drivers/media/platform/coda | |
parent | 25141bc7ac6f4fa1fe54cec748d4d5458c370a7d (diff) |
media: coda: use correct offset for mpeg4 decoder mvcol buffer
The mvcol buffer needs to be placed behind the chroma plane(s) when
decoding MPEG-4, same as for the h.264 decoder. Use the real offset
with the required rounding.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/coda')
-rw-r--r-- | drivers/media/platform/coda/coda-bit.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c index 32db1227d025..9fe113cb901f 100644 --- a/drivers/media/platform/coda/coda-bit.c +++ b/drivers/media/platform/coda/coda-bit.c @@ -455,18 +455,16 @@ static int coda_alloc_framebuffers(struct coda_ctx *ctx, coda_parabuf_write(ctx, i * 3 + 1, cb); coda_parabuf_write(ctx, i * 3 + 2, cr); - /* mvcol buffer for h.264 */ - if (ctx->codec->src_fourcc == V4L2_PIX_FMT_H264 && - dev->devtype->product != CODA_DX6) + if (dev->devtype->product == CODA_DX6) + continue; + + /* mvcol buffer for h.264 and mpeg4 */ + if (ctx->codec->src_fourcc == V4L2_PIX_FMT_H264) coda_parabuf_write(ctx, 96 + i, mvcol); + if (ctx->codec->src_fourcc == V4L2_PIX_FMT_MPEG4 && i == 0) + coda_parabuf_write(ctx, 97, mvcol); } - /* mvcol buffer for mpeg4 */ - if ((dev->devtype->product != CODA_DX6) && - (ctx->codec->src_fourcc == V4L2_PIX_FMT_MPEG4)) - coda_parabuf_write(ctx, 97, ctx->internal_frames[0].paddr + - ysize + ysize/4 + ysize/4); - return 0; } |