stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Nicolas Dufresne <nicolas.dufresne@collabora.com>,
	Ezequiel Garcia <ezequiel@collabora.com>,
	linux-media@vger.kernel.org
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Robert Beckett <bob.beckett@collabora.com>,
	kernel@collabora.com, stable@vger.kernel.org
Subject: Re: [PATCH 2/2] media: coda: Add more H264 levels for CODA960
Date: Mon, 20 Jul 2020 10:31:01 +0200	[thread overview]
Message-ID: <dd59520cfcfd4c93ad9cb54116f0234a706a0bd5.camel@pengutronix.de> (raw)
In-Reply-To: <f409d4ddad0a352ca7ec84699c94a64e5dbf0407.camel@collabora.com>

Hi Nicolas,

On Fri, 2020-07-17 at 11:50 -0400, Nicolas Dufresne wrote:
> Le vendredi 17 juillet 2020 à 09:48 +0200, Philipp Zabel a écrit :
> > Hi Ezequiel, Nicolas,
> > 
> > On Fri, 2020-07-17 at 00:49 -0300, Ezequiel Garcia wrote:
> > > From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> > > 
> > > This add H264 level 4.1, 4.2 and 5.0 to the list of supported formats.
> > > While the hardware does not fully support these levels, it do support
> > > most of them.
> > 
> > Could you clarify this? As far as I understand the hardware supports
> > maximum frame size requirement for up to level 4.2 (8704 macroblocks),
> > but not 5.0, and at least the implementation on i.MX6 does not support
> > the max encoding speed requirements for levels 4.1 and higher.
> > 
> > I don't think the firmware ever produces any output with a level higher
> > than 4.0 either, so what is the purpose of pretending otherwise?

I didn't see the decoder change, ^ this was just referring to the
encoder level.

> The level is a combination of 3 contraints, frame size, raw bitrate and encoded
> bitrate. We have a streams here the decode just fine, that reaches 5.0 for the
> endoded bitrate, but is near 4.0 for everything else. This streams works just
> fine with the 960.

You are right that the decoder, depending on the individual stream, may
well be capable of playing back a higher level than officially
supported. It is just not guaranteed that any stream of that unsupported
level can play back smoothly.

I suppose on i.MX6 the bottleneck is more likely to be the macroblock
processing rate than the encoded bitrate, especially if the memory bus
is under load. I'm not sure we should increase the advertised level
unless we can reach required MB/s as well. That being said, there is a
kernel option in the i.MX6 vendor kernel that disables CPU and bus
frequency scaling, keeps the SoC voltage high, and overclocks the VPU to
352 MHz. So there might be some headroom left to actually support this.

> I think the risk with this patch is that it now allow a stream to
> underperform in raw bitrate, but that can be controlled otherwise by
> the frame interval, so there is no need to limit it through levels.
> I could be wrong.
>
> But in public domain [0], Chips&Media seems to claim 4.2 decode, 4.0 encode. So
> yes, claiming 5.0 is off track, we will reduce this to 4.2 in v2.
> 
> [0] https://www.chipsnmedia.com/fullhd

I'm not sure the CODA960 VPU on i.MX6 at 264 MHz is as capable as the
CODA966 mentioned on their website.

> Considering how buggy and inconcistent this is going to be in decoder drivers,
> I'm tempted to just drop that restriction in GStreamer v4l2 decoders (was added
> by Philippe Normand from Igalia). Specially the bitrate limits, since it is
> quite clear from testing that this limits is only related to real-time
> performance, and that offline decoding should still be possible. Meanwhile, the
> driver should still advertise 4.1 and 4.2 decoding. But we should check the
> decoding/encoding levels are actually not the same, that I haven't checked, the
> code is a bit ... kindly said ... hairy.

I think negotiation is important for sources that can provide multiple
levels, to choose the right level for the decoder. If there is a given
stream with a fixed level, it might indeed be better to not fail
negotiation (maybe have a warning instead) and just hope for the best,
as for some streams it might just work.

regards
Philipp

  reply	other threads:[~2020-07-20  8:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17  3:49 [PATCH 1/2] media: coda: Fix reported H264 profile Ezequiel Garcia
2020-07-17  3:49 ` [PATCH 2/2] media: coda: Add more H264 levels for CODA960 Ezequiel Garcia
2020-07-17  7:48   ` Philipp Zabel
2020-07-17 15:50     ` Nicolas Dufresne
2020-07-20  8:31       ` Philipp Zabel [this message]
2020-07-20 15:36         ` Nicolas Dufresne
2020-07-20 16:09     ` Nicolas Dufresne
2020-07-20 21:43       ` Nicolas Dufresne
2020-07-21  8:14       ` Philipp Zabel
2020-07-17  8:14 ` [PATCH 1/2] media: coda: Fix reported H264 profile Philipp Zabel
2020-07-17 15:56   ` Nicolas Dufresne
2020-07-20  8:40     ` Philipp Zabel
2020-07-20 16:20       ` Nicolas Dufresne
2020-07-20 16:13   ` Nicolas Dufresne

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=dd59520cfcfd4c93ad9cb54116f0234a706a0bd5.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=bob.beckett@collabora.com \
    --cc=ezequiel@collabora.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kernel@collabora.com \
    --cc=linux-media@vger.kernel.org \
    --cc=nicolas.dufresne@collabora.com \
    --cc=stable@vger.kernel.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).