public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean-Francois Moine <moinejf@free.fr>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: "Linux Media" <linux-media@vger.kernel.org>
Subject: Re: Questions about VIDIOC_G_JPEGCOMP / VIDIOC_S_JPEGCOMP
Date: Fri, 20 Feb 2009 12:04:00 +0100	[thread overview]
Message-ID: <20090220120400.3d797cc4@free.fr> (raw)
In-Reply-To: <200902200929.36974.hverkuil@xs4all.nl>

On Fri, 20 Feb 2009 09:29:36 +0100
Hans Verkuil <hverkuil@xs4all.nl> wrote:

> > Support for these ioctls should be added to v4l2-ctl.cpp. It's the
> > right place for that.
> >
> > But more important is to document these ioctls in the v4l2 spec. As
> > far as I can tell these ioctls came from the zoran driver where
> > basically a private ioctl was elevated to a public ioctl, but with
> > little or no review.
> >
> > Do you know enough about these ioctls to update the v4l2 spec? That
> > would be a great help. 
> 
> I'm working on the zoran driver anyway, so I'll document this and add 
> support to v4l2-ctl. I now understand what this is about. The COM and
> APP markers are either obsolete or are meant as a read-only property.
> And while it is possible theoretically to set multiple APP segments,
> it is impossible with the current API to ever read more than one
> back. Sigh.

Hi Hans,

I see three parts in these ioctls:
- quality,
- definition of the APP and COM markers,
- presence / absence of some JPEG fields (quantization, Huffman..)

Looking at the video tree, the quality is treated by 5 drivers:
- in cpia2, the quality is not settable and defaults to 80 (%),
- in zc0301, the quality may be only set to 0,
- in et61x251 and sn9c102, the quality may be set to 0 or 1,
- in zoran, the quality may be set from 5% to 100%, but it is used only
  to compute the max size of the images!

I don't see the usage of APP or COM markers. Such fields may be added
by the applications. Actually, only the zoran and cpia2 drivers treat
them.

About the presence / absence of the JPEG fields, it is simpler to have
all the required fields in the JPEG image. If some field is lacking, it
should be added at conversion time by the v4l library or added by the
driver if video output. The fact the ioctl permits the control of these
fields obliges the drivers (input) or the applications (output) to know
how to add (or remove) the fields. It seems a complex treatment for a
small benefit: reduce the size of images by 100 or 200 bytes. Actually,
only the zoran and cpia2 drivers treat these controls.

So, I propose to remove these ioctls, and to add two controls: one to
set the JPEG quality (range 15..95 %) and the other to set a webcam
quality which might be a boolean or any value depending on some
associated webcam parameter.

What do you think of it?

Regards.

-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

  reply	other threads:[~2009-02-20 11:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-19 14:02 Questions about VIDIOC_G_JPEGCOMP / VIDIOC_S_JPEGCOMP Hans Verkuil
2009-02-20  8:29 ` Hans Verkuil
2009-02-20 11:04   ` Jean-Francois Moine [this message]
2009-02-20 18:43     ` Hans Verkuil
2009-02-20 21:52     ` Trent Piepho
  -- strict thread matches above, loose matches on Subject: below --
2009-02-19 12:17 Jean-Francois Moine

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=20090220120400.3d797cc4@free.fr \
    --to=moinejf@free.fr \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@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