linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@bootlin.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-arm-kernel@lists.infradead.org,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	acourbot@chromium.org, jonas@kwiboo.se, jenskuske@gmail.com,
	linux-sunxi@googlegroups.com, linux-kernel@vger.kernel.org,
	jernej.skrabec@gmail.com, tfiga@chromium.org,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Chen-Yu Tsai <wens@csie.org>,
	hans.verkuil@cisco.com,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	sakari.ailus@linux.intel.com, Guenter Roeck <groeck@chromium.org>,
	nicolas.dufresne@collabora.com, ezequiel@collabora.com,
	posciak@chromium.org, linux-media@vger.kernel.org
Subject: Re: [PATCH v6 1/2] media: uapi: Add H264 low-level decoder API compound controls.
Date: Wed, 3 Apr 2019 09:29:48 +0200	[thread overview]
Message-ID: <20190403072948.ixugqb2t4z3dcyd4@flea> (raw)
In-Reply-To: <4c70e58d-ce7b-c15d-4b1c-063cf9b67007@xs4all.nl>


[-- Attachment #1.1: Type: text/plain, Size: 2717 bytes --]

Hi Hans,

On Tue, Apr 02, 2019 at 01:39:21PM +0200, Hans Verkuil wrote:
> >> +struct v4l2_h264_dpb_entry {
> >> +	__u64 timestamp;
> >
> > As mentioned above, I suggest to rename this to 'reference_ts'.
> >
> > But see also the discussion below.
> >
> >> +	__u16 frame_num;
> >> +	__u16 pic_num;
> >> +	/* Note that field is indicated by v4l2_buffer.field */
> >> +	__s32 top_field_order_cnt;
> >> +	__s32 bottom_field_order_cnt;
> >> +	__u32 flags; /* V4L2_H264_DPB_ENTRY_FLAG_* */
> >> +};
> >> +
> >> +#define V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC	0x01
> >> +
> >> +struct v4l2_ctrl_h264_decode_param {
> >> +	__u32 num_slices;
> >> +	__u32 nal_ref_idc;
> >> +	__u8 ref_pic_list_p0[32];
> >> +	__u8 ref_pic_list_b0[32];
> >> +	__u8 ref_pic_list_b1[32];
> >> +	__s32 top_field_order_cnt;
> >> +	__s32 bottom_field_order_cnt;
> >> +	__u32 flags; /* V4L2_H264_DECODE_PARAM_FLAG_* */
> >> +	struct v4l2_h264_dpb_entry dpb[16];
> >
> > Should the reference timestamp be included in this control? Or be
> > separated into its own control?
> >
> > Reference frames do not apply to stateless encoders (the driver will
> > have to maintain the reference frames internally). Everything else
> > is equally valid for both stateless encoders and decoders, but only
> > stateless decoders need to provide the reference frames.
> >
> > So in this case we would need to create a new control:
> >
> > #define V4L2_CID_MPEG_VIDEO_H264_DECODE_REF_TS	(V4L2_CID_MPEG_BASE+1005)
> >
> > Which is a u64 array control (16 elements for H.264).
> >
> > You would need to do something similar for MPEG2.
>
> The question is if this is worth the extra effort. An alternative is
> to just specify that these reference timestamps are always to be zeroed
> by stateless encoders and are unused.
>
> I'm undecided on this.

I'll address your other comments, thanks!

For that part, I haven't really looked at the encoder parameters yet,
but I guess we should have other controls to be passed there as well
(like the target level of encoding). We can probably reuse the
existing controls for that though.

From the way it looks, our encoder needs to put some parameters (the
level and feature flags, mostly) and will output the entire
bitstream. I'm not really sure if it qualifies as a stateless encoder,
but that would require far less than what we have in those controls
already.

Either way, maybe the good way forward here would be to way for an
H264 / MPEG2 stateless encoder to come up, either ours or some other,
to see what should we do about this. How does that sound?

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-04-03  7:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19 15:29 [PATCH v6 0/2] media: cedrus: Add H264 decoding support Maxime Ripard
2019-03-19 15:29 ` [PATCH v6 1/2] media: uapi: Add H264 low-level decoder API compound controls Maxime Ripard
2019-03-20  2:59   ` Tomasz Figa
2019-04-02 11:32   ` Hans Verkuil
2019-04-02 11:39     ` Hans Verkuil
2019-04-03  7:29       ` Maxime Ripard [this message]
2019-04-03  9:32         ` Hans Verkuil
2019-03-19 15:29 ` [PATCH v6 2/2] media: cedrus: Add H264 decoding support Maxime Ripard
  -- strict thread matches above, loose matches on Subject: below --
2019-04-04 12:23 [PATCH v6 0/2] " Maxime Ripard
2019-04-04 12:23 ` [PATCH v6 1/2] media: uapi: Add H264 low-level decoder API compound controls Maxime Ripard

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=20190403072948.ixugqb2t4z3dcyd4@flea \
    --to=maxime.ripard@bootlin.com \
    --cc=acourbot@chromium.org \
    --cc=ezequiel@collabora.com \
    --cc=groeck@chromium.org \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jenskuske@gmail.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=nicolas.dufresne@collabora.com \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=posciak@chromium.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tfiga@chromium.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wens@csie.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;
as well as URLs for NNTP newsgroup(s).