public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: maxime.ripard@bootlin.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/9] media: cedrus: Add H264 decoding support
Date: Thu, 14 Jun 2018 18:37:17 +0200	[thread overview]
Message-ID: <20180614163717.hqxeiwn63vvnk5xg@flea> (raw)
In-Reply-To: <CAAFQd5A-GMBnNnRCfm0-51R9rn_pWw+UC3r-JX-_BE3cdznqig@mail.gmail.com>

Hi Tomasz,

On Thu, Jun 14, 2018 at 10:00:43PM +0900, Tomasz Figa wrote:
> Hi Maxime,
> 
> On Wed, Jun 13, 2018 at 11:07 PM Maxime Ripard
> <maxime.ripard@bootlin.com> wrote:
> >
> > Hi,
> >
> > Here is a preliminary version of the H264 decoding support in the
> > cedrus driver.
> 
> Thanks for the series! Let me reply inline to some of the points raised here.
> 
> > As you might already know, the cedrus driver relies on the Request
> > API, and is a reverse engineered driver for the video decoding engine
> > found on the Allwinner SoCs.
> >
> > This work has been possible thanks to the work done by the people
> > behind libvdpau-sunxi found here:
> > https://github.com/linux-sunxi/libvdpau-sunxi/
> >
> > This driver is based on the last version of the cedrus driver sent by
> > Paul, based on Request API v13 sent by Hans:
> > https://lkml.org/lkml/2018/5/7/316
> 
> Just FYI, there is v15 already. :)

Yeah, we know, Paul is currently working on rebasing to that version :)

> > This driver has been tested only with baseline profile videos, and is
> > missing a few key features to decode videos with higher profiles.
> > This has been tested using our cedrus-frame-test tool, which should be
> > a quite generic v4l2-to-drm decoder using the request API to
> > demonstrate the video decoding:
> > https://github.com/free-electrons/cedrus-frame-test/, branch h264
> >
> > However, sending this preliminary version, I'd really like to start a
> > discussion and get some feedback on the user-space API for the H264
> > controls exposed through the request API.
> >
> > I've been using the controls currently integrated into ChromeOS that
> > have a working version of this particular setup. However, these
> > controls have a number of shortcomings and inconsistencies with other
> > decoding API. I've worked with libva so far, but I've noticed already
> > that:
> 
> Note that these controls are supposed to be defined exactly like the
> bitstream headers deserialized into C structs in memory. I believe
> Pawel (on CC) defined them based on the actual H264 specification.
> 
> >   - The kernel UAPI expects to have the nal_ref_idc variable, while
> >     libva only exposes whether that frame is a reference frame or
> >     not. I've looked at the rockchip driver in the ChromeOS tree, and
> >     our own driver, and they both need only the information about
> >     whether the frame is a reference one or not, so maybe we should
> >     change this?
> 
> The fact that 2 drivers only need partial information doesn't mean
> that we should ignore the data being already in the bitstream. IMHO
> this API should to provide all the metadata available in the stream to
> the kernel driver, as a replacement for bitstream parsing in firmware
> (or in kernel... yuck).

The point is more that libva will only pass the result of (nal_ref_idc
!= 0). So in the libva plugin, you won't be able to fill the proper
value to the kernel, since you don't have access to it.

> >   - The H264 bitstream exposes the picture default reference list (for
> >     both list 0 and list 1), the slice reference list and an override
> >     flag. The libva will only pass the reference list to be used (so
> >     either the picture default's or the slice's) depending on the
> >     override flag. The kernel UAPI wants the picture default reference
> >     list and the slice reference list, but doesn't expose the override
> >     flag, which prevents us from configuring properly the
> >     hardware. Our video decoding engine needs the three information,
> >     but we can easily adapt to having only one. However, having two
> >     doesn't really work for us.
> 
> Where does the override flag come from? If it's in the bitstream, then
> I guess it was just missed when creating the structures.

It's in the bitstream yeah. I'll add it then.

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

      reply	other threads:[~2018-06-14 16:37 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-13 14:07 [PATCH 0/9] media: cedrus: Add H264 decoding support Maxime Ripard
2018-06-13 14:07 ` [PATCH 1/9] CHROMIUM: v4l: Add H264 low-level decoder API compound controls Maxime Ripard
2018-06-15 11:59   ` Hans Verkuil
2018-06-15 13:01     ` Guenter Roeck
2018-07-12 16:38     ` Maxime Ripard
2018-07-12 16:47       ` Andrew Lunn
2018-06-21  8:58   ` Paul Kocialkowski
2018-08-21 16:58   ` Ezequiel Garcia
2018-08-21 17:07     ` Nicolas Dufresne
2018-08-22 13:07       ` Paul Kocialkowski
2018-08-22 13:38         ` Tomasz Figa
2018-08-22 13:52           ` Nicolas Dufresne
2018-08-22 14:45           ` Paul Kocialkowski
2018-08-28  8:11             ` Tomasz Figa
2018-09-07  7:54               ` Tomasz Figa
2018-08-22  9:15     ` Maxime Ripard
2018-08-22  9:54       ` Tomasz Figa
2018-08-22 13:03         ` Paul Kocialkowski
2018-08-22 13:24           ` Tomasz Figa
2018-08-22 14:03             ` Nicolas Dufresne
2018-08-22 14:30             ` Paul Kocialkowski
2018-06-13 14:07 ` [PATCH 2/9] media: cedrus: Add wrappers around container_of for our buffers Maxime Ripard
2018-06-21  9:03   ` Paul Kocialkowski
2018-06-13 14:07 ` [PATCH 3/9] media: cedrus: Add a macro to check for the validity of a control Maxime Ripard
2018-06-21  9:13   ` Paul Kocialkowski
2018-06-13 14:07 ` [PATCH 4/9] media: cedrus: make engine type more generic Maxime Ripard
2018-06-21  9:33   ` Paul Kocialkowski
2018-06-13 14:07 ` [PATCH 5/9] media: cedrus: Remove MPEG1 support Maxime Ripard
2018-06-13 14:07 ` [PATCH 6/9] media: cedrus: Add ops structure Maxime Ripard
2018-06-21  9:49   ` Paul Kocialkowski
2018-06-25 13:29     ` Maxime Ripard
2018-06-25 13:48       ` Paul Kocialkowski
2018-06-13 14:07 ` [PATCH 7/9] media: cedrus: Move IRQ maintainance to cedrus_dec_ops Maxime Ripard
2018-06-21 15:35   ` Paul Kocialkowski
2018-06-25 14:18     ` Paul Kocialkowski
2018-06-25 16:15       ` Maxime Ripard
2018-06-25 15:38   ` Paul Kocialkowski
2018-06-25 15:49     ` Paul Kocialkowski
2018-06-25 19:01       ` Maxime Ripard
2018-06-27 17:58       ` Maxime Ripard
2018-06-13 14:07 ` [PATCH 8/9] media: cedrus: Add start and stop decoder operations Maxime Ripard
2018-06-21 15:38   ` Paul Kocialkowski
2018-06-25 13:32     ` Maxime Ripard
2018-06-25 13:42       ` Paul Kocialkowski
2018-06-13 14:07 ` [PATCH 9/9] media: cedrus: Add H264 decoding support Maxime Ripard
2018-07-27 13:56   ` Paul Kocialkowski
2018-07-27 14:01     ` Chen-Yu Tsai
2018-07-27 14:03       ` Paul Kocialkowski
2018-07-30 12:54   ` Paul Kocialkowski
2018-06-14 13:00 ` [PATCH 0/9] " Tomasz Figa
2018-06-14 16:37   ` Maxime Ripard [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=20180614163717.hqxeiwn63vvnk5xg@flea \
    --to=maxime.ripard@bootlin.com \
    --cc=linux-arm-kernel@lists.infradead.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