From: Tomasz Figa <tfiga@chromium.org>
To: Philipp Zabel <p.zabel@pengutronix.de>,
Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
Alexandre Courbot <acourbot@chromium.org>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
Hans Verkuil <hverkuil@xs4all.nl>,
Ezequiel Garcia <ezequiel@collabora.com>,
Boris Brezillon <boris.brezillon@collabora.com>,
Sasha Hauer <kernel@pengutronix.de>
Subject: Re: [PATCH] media: uapi: h264: clarify num_ref_idx_l[01]_(default_)active fields
Date: Fri, 25 Oct 2019 15:24:34 +0900 [thread overview]
Message-ID: <CAAFQd5CfYyc8CmVix-N6XCgOJ5nTi=9VONN0WMv8iu--u=XA4g@mail.gmail.com> (raw)
In-Reply-To: <a020830817e4be787067aa82d56331979d80f53e.camel@pengutronix.de>
On Thu, Oct 17, 2019 at 12:08 AM Philipp Zabel <p.zabel@pengutronix.de> wrote:
>
> On Wed, 2019-10-16 at 15:37 +0200, Paul Kocialkowski wrote:
> [...]
> > > > The bottomline is that we have use cases for each of the two set of fields
> > > > independently, so I feel like this is reason enough to avoid mixing them
> > > > together.
> > >
> > > What do you mean by mixing together? Hardware parsing the slices
> > > always uses num_ref_idx_l[01]_default_active_minus1 from the PPS.
> > > Hardware not parsing the slices always sets override to 1 and uses
> > > num_ref_idx_l[01]_active_minus1 from the slice header struct.
> >
> > To summarize, what I don't understand is why it's worth re-purposing
> > the slice header's num_ref_idx_l[01]_active_minus1 to contain
> > num_ref_idx_l[01]_default_active_minus1 when the flag is not set in the initial
> > bitstream instead of exposing the flag.
> >
> > There's hardware (like cedrus) which takes both fields and the flag directly
> > in-registers, so it's really not a simplification here. And even in cases where
> > the hardware only takes one field, I believe that the downside of re-purposing
> > the field of the control is much greater than the benefit of the supposed
> > simplification.
> >
> > I know this sounds quite futile, but I thought there was an implicit agreement
> > that controls must stick as close as possible to the bitstream. This is an
> > occurence where we are diverging for no particularly strong reason.
>
> FWIW, I agree with Paul on this. That drivers for codecs which do not
> parse the slice headers always completely ignore the
> num_ref_idx_l[01]_default_active_minus1 fields, but instead expect the
> num_ref_idx_l[01]_active_minus1 field to be repurposed to contain the
> default values if the corresponding fields do not exist in the slice
> header (that is, when the num_ref_idx_active_override_flag is not set),
> confused me at first [1].
>
> This seems to follow what libva does [2], and it does simplify drivers a
> tiny bit, but I'd still prefer to explicitly have the
> num_ref_idx_active_override_flag contained in the API, and to have the
> num_ref_idx_l[01]_active_minus1 fields only be used for
> num_ref_idx_l[01]_active_minus1, and not have them sometimes contain the
> values of another field.
>
> [1] https://patchwork.linuxtv.org/patch/58580/
> [2] https://github.com/intel/libva/blob/95eb8cf469367b532b391042fa0e77ca513ac94e/va/va.h#L3138
>
> > Expecting that userspace does this pre-processing of fields feels quite
> > counter-intuitive and confusing for people wishing to use the API, too.
> > One would certainly naively expect that the fields in the controls carry the
> > same meaning as in the bitstream when they have the same name.
>
> I certainly naively did.
>
Okay, I think you convinced me. :)
+Alexandre Courbot to be aware of the upcoming UAPI change.
Best regards,
Tomasz
prev parent reply other threads:[~2019-10-25 6:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-05 11:42 [PATCH] media: uapi: h264: clarify num_ref_idx_l[01]_(default_)active fields Philipp Zabel
2019-09-09 12:09 ` Hans Verkuil
2019-09-09 12:27 ` Philipp Zabel
2019-09-09 12:43 ` Hans Verkuil
2019-09-09 13:36 ` Philipp Zabel
2019-09-09 14:00 ` Hans Verkuil
2019-10-03 21:12 ` Paul Kocialkowski
2019-10-05 8:22 ` Tomasz Figa
2019-10-05 13:39 ` Paul Kocialkowski
2019-10-05 13:54 ` Tomasz Figa
2019-10-05 14:12 ` Paul Kocialkowski
2019-10-05 14:21 ` Tomasz Figa
2019-10-05 15:42 ` Paul Kocialkowski
2019-10-16 13:37 ` Paul Kocialkowski
2019-10-16 15:08 ` Philipp Zabel
2019-10-25 6:24 ` Tomasz Figa [this message]
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='CAAFQd5CfYyc8CmVix-N6XCgOJ5nTi=9VONN0WMv8iu--u=XA4g@mail.gmail.com' \
--to=tfiga@chromium.org \
--cc=acourbot@chromium.org \
--cc=boris.brezillon@collabora.com \
--cc=ezequiel@collabora.com \
--cc=hverkuil@xs4all.nl \
--cc=kernel@pengutronix.de \
--cc=linux-media@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=paul.kocialkowski@bootlin.com \
/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).