From: "Jernej Škrabec" <jernej.skrabec@siol.net>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: linux-media@vger.kernel.org,
Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
mripard@kernel.org, tfiga@chromium.org, jonas@kwiboo.se,
Ezequiel Garcia <ezequiel@collabora.com>
Subject: Re: [PATCHv3 7/8] media: cedrus: h264: Support multiple slices per frame
Date: Fri, 11 Oct 2019 11:11:02 +0200 [thread overview]
Message-ID: <9696944.LNMW5gGE19@jernej-laptop> (raw)
In-Reply-To: <20191010131152.68984-8-hverkuil-cisco@xs4all.nl>
Dne četrtek, 10. oktober 2019 ob 15:11:51 CEST je Hans Verkuil napisal(a):
> From: Jernej Skrabec <jernej.skrabec@siol.net>
>
> With recent changes, support for decoding multi-slice frames can be
> easily added now.
>
> Signal VPU if current slice is first in frame or not and add information
> about first macroblock coordinates.
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> ---
> drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c
> b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c index
> d6a782703c9b..3ffb5494cff6 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c
> @@ -301,6 +301,8 @@ static void cedrus_set_params(struct cedrus_ctx *ctx,
> dma_addr_t src_buf_addr;
> u32 offset = slice->header_bit_size;
> u32 len = (slice->size * 8) - offset;
> + unsigned int pic_width_in_mbs;
> + bool mbaff_pic;
> u32 reg;
>
> cedrus_write(dev, VE_H264_VLD_LEN, len);
> @@ -370,12 +372,20 @@ static void cedrus_set_params(struct cedrus_ctx *ctx,
> reg |= VE_H264_SPS_DIRECT_8X8_INFERENCE;
> cedrus_write(dev, VE_H264_SPS, reg);
>
> + mbaff_pic = !(slice->flags & V4L2_H264_SLICE_FLAG_FIELD_PIC) &&
> + (sps->flags &
V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD);
> + pic_width_in_mbs = sps->pic_width_in_mbs_minus1 + 1;
> +
> // slice parameters
> reg = 0;
> + reg |= ((slice->first_mb_in_slice % pic_width_in_mbs) & 0xff) << 24;
> + reg |= (((slice->first_mb_in_slice / pic_width_in_mbs) *
> + (mbaff_pic + 1)) & 0xff) << 16;
> reg |= decode->nal_ref_idc ? BIT(12) : 0;
> reg |= (slice->slice_type & 0xf) << 8;
> reg |= slice->cabac_init_idc & 0x3;
> - reg |= VE_H264_SHS_FIRST_SLICE_IN_PIC;
> + if (run->first_slice)
Now that first_slice (ctx->fh.m2m_ctx->new_frame) flag depends on
subsystem_flags, I think patch 7 and 8 should be merged, otherwise this patch
won't work on it's own.
Best regards,
Jernej
> + reg |= VE_H264_SHS_FIRST_SLICE_IN_PIC;
> if (slice->flags & V4L2_H264_SLICE_FLAG_FIELD_PIC)
> reg |= VE_H264_SHS_FIELD_PIC;
> if (slice->flags & V4L2_H264_SLICE_FLAG_BOTTOM_FIELD)
next prev parent reply other threads:[~2019-10-11 9:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-10 13:11 [PATCHv3 0/8] media: cedrus: h264: Support multi-slice frames Hans Verkuil
2019-10-10 13:11 ` [PATCHv3 1/8] vb2: add V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF Hans Verkuil
2019-10-10 13:11 ` [PATCHv3 2/8] v4l2-mem2mem: support held capture buffers Hans Verkuil
2019-10-10 13:11 ` [PATCHv3 3/8] videodev2.h: add V4L2_DEC_CMD_FLUSH Hans Verkuil
2019-10-10 13:11 ` [PATCHv3 4/8] media: v4l2-mem2mem: add stateless_(try_)decoder_cmd ioctl helpers Hans Verkuil
2019-10-10 13:11 ` [PATCHv3 5/8] v4l2-mem2mem: add new_frame detection Hans Verkuil
2019-10-10 13:11 ` [PATCHv3 6/8] media: cedrus: Detect first slice of a frame Hans Verkuil
2019-10-11 8:49 ` Jernej Škrabec
2019-10-11 8:50 ` Hans Verkuil
2019-10-10 13:11 ` [PATCHv3 7/8] media: cedrus: h264: Support multiple slices per frame Hans Verkuil
2019-10-11 9:11 ` Jernej Škrabec [this message]
2019-10-10 13:11 ` [PATCHv3 8/8] media: cedrus: Add support for holding capture buffer Hans Verkuil
2019-10-11 9:12 ` Jernej Škrabec
2019-10-11 7:07 ` [PATCHv3 0/8] media: cedrus: h264: Support multi-slice frames Jernej Škrabec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9696944.LNMW5gGE19@jernej-laptop \
--to=jernej.skrabec@siol.net \
--cc=ezequiel@collabora.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=jonas@kwiboo.se \
--cc=linux-media@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=paul.kocialkowski@bootlin.com \
--cc=tfiga@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox