diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2014-10-02 14:08:34 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-10-28 15:39:01 -0200 |
commit | 619165628d8f0e296c66a2f37bcea50769b7873d (patch) | |
tree | 724854f19cc86b6268d38380765ab7c0339b4853 /drivers/media/platform/coda | |
parent | 5269aed0f82e703533b7831a49ab76b955b01b6b (diff) | |
download | blackbird-op-linux-619165628d8f0e296c66a2f37bcea50769b7873d.tar.gz blackbird-op-linux-619165628d8f0e296c66a2f37bcea50769b7873d.zip |
[media] coda: try to only queue a single JPEG into the bitstream
With bitstream padding, it is possible to decode a single JPEG in the bitstream
immediately. This allows us to only ever queue a single JPEG into the bitstream
buffer, except to increase payload over 512 bytes or to back out of hold state.
This is a measure to decrease JPEG decoder latency.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/coda')
-rw-r--r-- | drivers/media/platform/coda/coda-bit.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c index 27e0764e3ac5..2a6810e47a5c 100644 --- a/drivers/media/platform/coda/coda-bit.c +++ b/drivers/media/platform/coda/coda-bit.c @@ -221,6 +221,14 @@ void coda_fill_bitstream(struct coda_ctx *ctx) u32 start; while (v4l2_m2m_num_src_bufs_ready(ctx->fh.m2m_ctx) > 0) { + /* + * Only queue a single JPEG into the bitstream buffer, except + * to increase payload over 512 bytes or if in hold state. + */ + if (ctx->codec->src_fourcc == V4L2_PIX_FMT_JPEG && + (coda_get_bitstream_payload(ctx) >= 512) && !ctx->hold) + break; + src_buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx); /* Buffer start position */ |