From: Ezequiel Garcia <ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
To: Tomasz Figa <tfiga-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
Hans Verkuil
<hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
kernel-ZGY8ohtN/8qB+jHODAdFcQ@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>,
Nicolas Dufresne
<nicolas.dufresne-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>,
Shunqian Zheng <zhengsq-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
Linux Media Mailing List
<linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v2 5/6] media: Add controls for jpeg quantization tables
Date: Sat, 18 Aug 2018 15:21:11 -0300 [thread overview]
Message-ID: <fe36727b86c1318b850e6d581b1bf337b0e3e15a.camel@collabora.com> (raw)
In-Reply-To: <CAAFQd5C4jTfdB5Zmk6LQwTOBB2hs14ensZ+J-ZdTcQzzBNKn0A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Fri, 2018-08-17 at 11:10 +0900, Tomasz Figa wrote:
> Hi Ezequiel,
>
> On Fri, Aug 3, 2018 at 5:00 AM Ezequiel Garcia <ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org> wrote:
> >
> > From: Shunqian Zheng <zhengsq-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> >
> > Add V4L2_CID_JPEG_LUMA/CHROMA_QUANTIZATION controls 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>
> > ---
> > Documentation/media/uapi/v4l/extended-controls.rst | 9 +++++++++
> > drivers/media/v4l2-core/v4l2-ctrls.c | 4 ++++
> > include/uapi/linux/v4l2-controls.h | 3 +++
> > 3 files changed, 16 insertions(+)
>
> Thanks for this series and sorry for being late with review. Please
> see my comments inline.
>
> >
> > diff --git a/Documentation/media/uapi/v4l/extended-controls.rst b/Documentation/media/uapi/v4l/extended-controls.rst
> > index 9f7312bf3365..80e26f81900b 100644
> > --- a/Documentation/media/uapi/v4l/extended-controls.rst
> > +++ b/Documentation/media/uapi/v4l/extended-controls.rst
> > @@ -3354,6 +3354,15 @@ JPEG Control IDs
> > Specify which JPEG markers are included in compressed stream. This
> > control is valid only for encoders.
> >
> > +.. _jpeg-quant-tables-control:
> > +
> > +``V4L2_CID_JPEG_LUMA_QUANTIZATION (__u8 matrix)``
> > + Sets the luma quantization table to be used for encoding
> > + or decoding a V4L2_PIX_FMT_JPEG_RAW format buffer. This table is
> > + expected to be in JPEG zigzag order, as per the JPEG specification.
>
> Should we also specify this to be 8x8?
>
Yes, could be.
> > +
> > +``V4L2_CID_JPEG_CHROMA_QUANTIZATION (__u8 matrix)``
> > + Sets the chroma quantization table.
> >
>
> nit: I guess we aff something like
>
> "See also V4L2_CID_JPEG_LUMA_QUANTIZATION for details."
>
> to avoid repeating the V4L2_PIX_FMT_JPEG_RAW and zigzag order bits? Or
> maybe just repeating is better?
>
In spec documentation I usually find it's clearer for readers to see
stuff repeated. Better to have an excess of clarity :-)
> >
> > .. flat-table::
> > diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
> > index 599c1cbff3b9..5c62c3101851 100644
> > --- a/drivers/media/v4l2-core/v4l2-ctrls.c
> > +++ b/drivers/media/v4l2-core/v4l2-ctrls.c
> > @@ -999,6 +999,8 @@ const char *v4l2_ctrl_get_name(u32 id)
> > case V4L2_CID_JPEG_RESTART_INTERVAL: return "Restart Interval";
> > case V4L2_CID_JPEG_COMPRESSION_QUALITY: return "Compression Quality";
> > case V4L2_CID_JPEG_ACTIVE_MARKER: return "Active Markers";
> > + case V4L2_CID_JPEG_LUMA_QUANTIZATION: return "Luminance Quantization Matrix";
> > + case V4L2_CID_JPEG_CHROMA_QUANTIZATION: return "Chrominance Quantization Matrix";
> >
> > /* Image source controls */
> > /* Keep the order of the 'case's the same as in v4l2-controls.h! */
> > @@ -1284,6 +1286,8 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
> > *flags |= V4L2_CTRL_FLAG_READ_ONLY;
> > break;
> > case V4L2_CID_DETECT_MD_REGION_GRID:
> > + case V4L2_CID_JPEG_LUMA_QUANTIZATION:
> > + case V4L2_CID_JPEG_CHROMA_QUANTIZATION:
>
> It looks like with this setup, the driver has to explicitly set dims
> to { 8, 8 } and min/max to 0/255.
>
> At least for min and max, we could set them here. For dims, i don't
> see it handled in generic code, so I guess we can leave it to the
> driver now and add move into generic code, if another driver shows up.
> Hans, what do you think?
>
Since Hans agrees to move this to the core, let's give it a try.
I'll address this in v3.
Thanks for the feedback!
Eze
next prev parent reply other threads:[~2018-08-18 18:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-02 20:00 [PATCH v2 0/6] Add Rockchip VPU JPEG encoder Ezequiel Garcia
[not found] ` <20180802200010.24365-1-ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2018-08-02 20:00 ` [PATCH v2 1/6] dt-bindings: Document the Rockchip VPU bindings Ezequiel Garcia
[not found] ` <20180802200010.24365-2-ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2018-08-13 17:50 ` Rob Herring
2018-08-02 20:00 ` [PATCH v2 2/6] ARM: dts: rockchip: add VPU device node for RK3288 Ezequiel Garcia
2018-08-02 20:00 ` [PATCH v2 3/6] arm64: dts: rockchip: add VPU device node for RK3399 Ezequiel Garcia
2018-08-02 20:00 ` [PATCH v2 4/6] media: Add JPEG_RAW format Ezequiel Garcia
2018-08-02 20:00 ` [PATCH v2 5/6] media: Add controls for jpeg quantization tables Ezequiel Garcia
[not found] ` <20180802200010.24365-6-ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2018-08-17 2:10 ` Tomasz Figa
[not found] ` <CAAFQd5C4jTfdB5Zmk6LQwTOBB2hs14ensZ+J-ZdTcQzzBNKn0A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-08-17 10:12 ` Hans Verkuil
2018-08-18 18:21 ` Ezequiel Garcia [this message]
2018-08-02 20:00 ` [PATCH v2 6/6] media: add Rockchip VPU driver Ezequiel Garcia
2018-08-18 21:02 ` [PATCH v2 0/6] Add Rockchip VPU JPEG encoder 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=fe36727b86c1318b850e6d581b1bf337b0e3e15a.camel@collabora.com \
--to=ezequiel-zgy8ohtn/8qb+jhodadfcq@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w@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=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).