From: Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org>
To: Tomasz Figa <tfiga-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: "Mark Rutland" <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"Nicolas Dufresne"
<nicolas.dufresne-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>,
"Heiko Stübner" <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>,
"Shunqian Zheng"
<zhengsq-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
"open list:ARM/Rockchip SoC..."
<linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
"Rob Herring" <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"Hans Verkuil"
<hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
myy-tmjzNUIc0P1+EYZtW95mkQ@public.gmane.org,
kernel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org,
"Ezequiel Garcia"
<ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>,
"Linux Media Mailing List"
<linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v5 5/6] media: Add controls for JPEG quantization tables
Date: Fri, 12 Oct 2018 22:00:37 +0200 [thread overview]
Message-ID: <2878c8fa36f6e775079f53ba79518a53e1ea6bc5.camel@paulk.fr> (raw)
In-Reply-To: <CAAFQd5Bir0uMsaJPHdgQDvcYHpxZ4sUSn10OPpRXcnn-THUx2A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 4957 bytes --]
Hi,
Le mercredi 19 septembre 2018 à 13:28 +0900, Tomasz Figa a écrit :
> On Thu, Sep 13, 2018 at 9:15 PM Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.org> wrote:
> > Hi,
> >
> > On Wed, 2018-09-05 at 19:00 -0300, Ezequiel Garcia wrote:
> > > From: Shunqian Zheng <zhengsq-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> > >
> > > Add V4L2_CID_JPEG_QUANTIZATION compound control to allow userspace
> > > configure the JPEG quantization tables.
> > >
> > > Signed-off-by: Shunqian Zheng <zhengsq-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> > > Signed-off-by: Ezequiel Garcia <ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
> > > ---
> > > .../media/uapi/v4l/extended-controls.rst | 31 +++++++++++++++++++
> > > .../media/videodev2.h.rst.exceptions | 1 +
> > > drivers/media/v4l2-core/v4l2-ctrls.c | 10 ++++++
> > > include/uapi/linux/v4l2-controls.h | 12 +++++++
> > > include/uapi/linux/videodev2.h | 1 +
> > > 5 files changed, 55 insertions(+)
> > >
> > > diff --git a/Documentation/media/uapi/v4l/extended-controls.rst b/Documentation/media/uapi/v4l/extended-controls.rst
> > > index 9f7312bf3365..1335d27d30f3 100644
> > > --- a/Documentation/media/uapi/v4l/extended-controls.rst
> > > +++ b/Documentation/media/uapi/v4l/extended-controls.rst
> > > @@ -3354,7 +3354,38 @@ JPEG Control IDs
> > > Specify which JPEG markers are included in compressed stream. This
> > > control is valid only for encoders.
> > >
> > > +.. _jpeg-quant-tables-control:
> >
> > I just had a look at how the Allwinner VPU handles JPEG decoding and it
> > seems to require the following information (in addition to
> > quantization):
>
> I assume the hardware doesn't have the ability to parse those from the
> stream and so they need to be parsed by user space and given to the
> driver?
That's correct, we are also dealing with a stateless decoder here. It's
actually the same hardware engine that's used for MPEG2 decoding, only
configured differently.
So we will need to introduce a pixfmt for compressed JPEG data without
headers, reuse JPEG controls that apply and perhaps introduce new ones
too if needed.
I am also wondering about how MJPEG support should fit into this. As
far as I understood, it shouldn't be very different from JPEG so we
might want to have common controls for both.
> > * Horizontal and vertical sampling factors for each Y/U/V component:
> >
> > The number of components and sampling factors are coded separately in
> > the bitstream, but it's probably easier to use the already-existing
> > V4L2_CID_JPEG_CHROMA_SUBSAMPLING control for specifying that.
> >
> > However, this is potentially very much related to the destination
> > format. If we decide that this format should match the format resulting
> > from decompression, we don't need to specify it through an external
> > control. On the other hand, it's possible that the VPU has format
> > conversion block integrated in its pipeline so it would also make sense
> > to consider the destination format as independent.
>
> +1 for keeping it separate.
Just like for the stateless decoding API, it would make sense to expect
userspace to set those before enumerating CAPTURE formats in order to
determine what the hardware can output.
> > * Custom Huffman tables (DC and AC), both for luma and chroma
> >
> > It seems that there is a default table when no Huffman table is provided
> > in the bitstream (I'm not too sure how standard that is, just started
> > learning about JPEG). We probably need a specific control for that.
>
> What happens if there is one in the bitstream? Would the hardware pick
> it automatically?
In our case, this part of the bitstream wouldn't be sent to the
hardware anyway.
> I think it might make sense to just have a general control for Huffman
> table, which would be always provided by the user space, regardless of
> whether it's parsed from the stream or default, so that drivers don't
> have to care and could just always use it.
For MPEG-2 support (and probably also H.265), we have considered the
quantization tables optional and kept a default value in the driver.
That's because said tables are not supported in all profiles, so they
are de-facto optional. I think it's fair to consider that userspace
does not need to implement more than what is needed for decoding. This
makes our interface closer to the data obtained from the bitstream.
However, having one copy of the default table per driver is far from
optimal. I would suggest moving it to common v4l2 functions instead,
but keeping it in kernel space.
What do you think?
Cheers,
Paul
--
Developer of free digital technology and hardware support.
Website: https://www.paulk.fr/
Coding blog: https://code.paulk.fr/
Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 200 bytes --]
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2018-10-12 20:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-05 22:00 [PATCH v5 0/6] Add Rockchip VPU JPEG encoder Ezequiel Garcia
[not found] ` <20180905220011.16612-1-ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2018-09-05 22:00 ` [PATCH v5 1/6] dt-bindings: Document the Rockchip VPU bindings Ezequiel Garcia
2018-09-05 22:00 ` [PATCH v5 2/6] ARM: dts: rockchip: add VPU device node for RK3288 Ezequiel Garcia
2018-09-05 22:00 ` [PATCH v5 3/6] arm64: dts: rockchip: add VPU device node for RK3399 Ezequiel Garcia
2018-09-05 22:00 ` [PATCH v5 4/6] media: Add JPEG_RAW format Ezequiel Garcia
2018-09-05 22:00 ` [PATCH v5 5/6] media: Add controls for JPEG quantization tables Ezequiel Garcia
[not found] ` <20180905220011.16612-6-ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2018-09-10 12:42 ` Hans Verkuil
[not found] ` <718d8a73-008a-a610-d090-91cc54a992ad-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>
2018-09-10 13:25 ` Ezequiel Garcia
[not found] ` <710d4e77de63b46e6ffd440c9c98ca9af133117f.camel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2018-09-15 16:48 ` Paul Kocialkowski
[not found] ` <928a021c1e402f99eadd20e00aa5ec0cc218edbd.camel-W9ppeneeCTY@public.gmane.org>
2018-09-19 4:21 ` Tomasz Figa
2018-09-13 12:14 ` Paul Kocialkowski
[not found] ` <e7126e89d8984eb93216ec75c83ce1fc5afc437d.camel-W9ppeneeCTY@public.gmane.org>
2018-09-13 19:40 ` Paul Kocialkowski
2018-09-19 4:28 ` Tomasz Figa
[not found] ` <CAAFQd5Bir0uMsaJPHdgQDvcYHpxZ4sUSn10OPpRXcnn-THUx2A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-10-12 20:00 ` Paul Kocialkowski [this message]
[not found] ` <2878c8fa36f6e775079f53ba79518a53e1ea6bc5.camel-W9ppeneeCTY@public.gmane.org>
2018-10-15 16:07 ` Ezequiel Garcia
2018-09-05 22:00 ` [PATCH v5 6/6] media: add Rockchip VPU JPEG encoder driver Ezequiel Garcia
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=2878c8fa36f6e775079f53ba79518a53e1ea6bc5.camel@paulk.fr \
--to=contact-w9ppeneecty@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
--cc=hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
--cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
--cc=kernel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
--cc=linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=myy-tmjzNUIc0P1+EYZtW95mkQ@public.gmane.org \
--cc=nicolas.dufresne-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=tfiga-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=zhengsq-TNX95d0MmH7DzftRWevZcw@public.gmane.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).