[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d92689dfb92dfa0812f19cc5ed04ec308b9efde3.camel@pengutronix.de>
Date: Wed, 02 Dec 2020 16:30:36 +0100
From: Philipp Zabel <p.zabel@...gutronix.de>
To: Hans Verkuil <hverkuil-cisco@...all.nl>,
"Mirela Rabulea (OSS)" <mirela.rabulea@....nxp.com>,
mchehab@...nel.org, shawnguo@...nel.org, robh+dt@...nel.org
Cc: paul.kocialkowski@...tlin.com, linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-imx@....com,
s.hauer@...gutronix.de, aisheng.dong@....com,
daniel.baluta@....com, robert.chiras@....com,
laurentiu.palcu@....com, mark.rutland@....com,
devicetree@...r.kernel.org, ezequiel@...labora.com,
laurent.pinchart+renesas@...asonboard.com,
niklas.soderlund+renesas@...natech.se,
dafna.hirschfeld@...labora.com,
Mirela Rabulea <mirela.rabulea@....com>
Subject: Re: [PATCH v5 09/10] media: Avoid parsing quantization and huffman
tables
On Wed, 2020-12-02 at 13:12 +0100, Hans Verkuil wrote:
> On 12/11/2020 04:05, Mirela Rabulea (OSS) wrote:
> > From: Mirela Rabulea <mirela.rabulea@....com>
> >
> > These are optional in struct v4l2_jpeg_header, so do not parse if
> > not requested, save some time.
> >
> > Signed-off-by: Mirela Rabulea <mirela.rabulea@....com>
> > ---
> > drivers/media/v4l2-core/v4l2-jpeg.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/media/v4l2-core/v4l2-jpeg.c b/drivers/media/v4l2-core/v4l2-jpeg.c
> > index d77e04083d57..7576cd0ce6b9 100644
> > --- a/drivers/media/v4l2-core/v4l2-jpeg.c
> > +++ b/drivers/media/v4l2-core/v4l2-jpeg.c
> > @@ -307,6 +307,9 @@ static int jpeg_parse_quantization_tables(struct jpeg_stream *stream,
> > {
> > int len = jpeg_get_word_be(stream);
> >
> > + if (!tables)
> > + return 0;
> > +
>
> It feels more natural to check for a non-NULL out->quantization_tables
> or non-NULL out->huffman_tables pointer in v4l2_jpeg_parse_header()
> rather than in these low-level functions. It's weird to have this check here.
Ah, now I get it.
Yes, if you want to skip the entire DQT for performance reasons, it is
probably better to just call jpeg_skip_segment() instead of
jpeg_parse_quantization_table(). Otherwise the next jpeg_next_marker has
to scan the whole quantization table for segment markers.
regards
Philipp
Powered by blists - more mailing lists