linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Francois Moine <moinejf@free.fr>
To: Anders Blomdell <anders.blomdell@control.lth.se>
Cc: Thomas Champagne <lafeuil@gmail.com>,
	Linux Media <linux-media@vger.kernel.org>,
	Thomas Kaiser <v4l@kaiser-linux.li>
Subject: Re: Topro 6800 driver
Date: Sun, 1 Mar 2009 08:26:35 +0100	[thread overview]
Message-ID: <20090301082635.0905afea@free.fr> (raw)
In-Reply-To: <49A95428.1090306@control.lth.se>

On Sat, 28 Feb 2009 16:11:36 +0100
Anders Blomdell <anders.blomdell@control.lth.se> wrote:

> Jean-Francois Moine wrote:
> > Thomas Champagne (See To:) was also writing a driver for this
> > webcam. Maybe you may merge your codes...
> Thomas, if you have DQT/Huffman tables for this camera, please drop
> me a note.
> 
> > About the JPEG images, the Huffman table is always the same 
> Does this mean that it's the same for all JPEG images or only for one 
> camera?
> 
> If it's the same for all images, it should mean that I have a way to 
> determine how much I have to chop off after the 0xfffe tag (no
> illegal huffman codes -> possibly chop at the correct position).
> 
> Comments anyone?

I already explained it:

- when a packet starts with '55 ff d8', it is the first part of the
  image. This one should start at the offset 8 of the packet.
                                      ~~~~~~~~

>  > and the
> > quantization tables depend on the compression quality.
> > 
> > From the USB trace I had from Thomas, I saw that:
> > 
> > - when a packet starts with '55 ff d8', it is the first part of the
> >   image. This one should start at the offset 8 of the packet.
> > 
> > - when a packet starts with 'cc', it is the next part of the image.
> This is even in the docs, and is implemented in the driver.
> 
> > In the function pkt_scan, when finding the image start, you must add
> > the JPEG header: 'ff d8', DQT, huffman table, SOF0 and SOS.
> OK, will see if I can find the DQT (and possibly the Huffman table)
> in the windows driver (as suggested by Thomas Kaiser).

See below.

> > As we don't know the quality used by the webcam, in my test
> > repository, I added a control for that: the JPEG header is created
> > at streamon time, and the quantization tables may be modified by
> > the control on the fly (have a look at stk014.c for an example).
> > 
> > This solution is not the right one: the JPEG quality must be set by
> > the VIDIOC_S_JPEGCOMP ioctl instead of VIDIOC_S_CTRL. I think I
> > will update the concerned subdrivers next week.
> I'll look into that monday.

In gspca, the file "jpeg.h" contains all the material to build a
complete JPEG header. With the new mechanism of my test repository, you
must:

- at streamon time (function sd_start):
	- allocate a buffer for the JPEG header,
	- set the resolution and number of samplesY (0x22 or 0x21) by
		the function jpeg_define,
	- set the quantization tables by the function jpeg_set_qual,
	  the quality being in percent (15..95).

- when getting the start of a new image in sd_pkt_scan, add the JPEG
  header as the first packet.

- at streamoff time (function sd_stop0), free the JPEG header.

- on VIDIOC_S_JPEGCOMP (function sd_set_jcomp which you must create),
  redefine the quantization tables by jpeg_set_qual.

Cheers.

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

  parent reply	other threads:[~2009-03-01  7:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-27 22:15 Topro 6800 driver Anders Blomdell
2009-02-28 10:31 ` Jean-Francois Moine
2009-02-28 15:11   ` Anders Blomdell
2009-02-28 15:54     ` Thomas Kaiser
2009-03-01  7:26     ` Jean-Francois Moine [this message]
2009-03-01 16:33     ` Thomas Champagne
2009-03-02 13:20       ` Jean-Francois Moine
2009-03-02 16:58         ` Anders Blomdell
2009-02-28 11:54 ` Thomas Kaiser
     [not found] ` <49B194A7.4030808@kaiser-linux.li>
2009-03-09 12:10   ` Anders Blomdell
     [not found]     ` <49B50E16.8080703@kaiser-linux.li>
2009-03-09 14:06       ` Anders Blomdell
2009-03-09 18:51       ` Anders Blomdell
2009-03-09 20:10         ` Thomas Kaiser
2009-03-09 20:29           ` Anders Blomdell
2009-03-09 20:43             ` Thomas Kaiser
     [not found]               ` <49B62023.2090206@control.lth.se>
     [not found]                 ` <49B65BA7.6070700@kaiser-linux.li>
     [not found]                   ` <49B68F34.60802@control.lth.se>
     [not found]                     ` <49B6A495.9060204@kaiser-linux.li>
2009-03-11 15:09                       ` Anders Blomdell
2009-03-11 19:11                         ` Thomas Kaiser
2009-03-17 20:13                         ` Topro 6800 driver [JPEG decoding solved] Thomas Kaiser
2009-03-18 20:10                           ` Thomas Kaiser
2009-03-18 21:42                             ` Thomas Champagne
2009-03-25 17:10                             ` Anders Blomdell
     [not found]         ` <49B5786D.4060102@kaiser-linux.li>
     [not found]           ` <49B57CB6.8000402@control.lth.se>
2009-03-09 20:38             ` Mail list, Is WIKI up to date? Thomas Kaiser
  -- strict thread matches above, loose matches on Subject: below --
2009-03-27 18:06 topro 6800 driver Andy Shevchenko
     [not found] ` <49CD2868.9080502@kaiser-linux.li>
     [not found]   ` <5ec8ebd50903311144h316c7e3bmd30ce2c3d5a268ee@mail.gmail.com>
     [not found]     ` <49D4EAB2.4090206@control.lth.se>
2009-04-03 20:07       ` Anders Blomdell
2009-04-03 20:54         ` Erik Andrén
2009-04-04 11:29           ` Anders Blomdell
2009-04-05 17:36             ` Jean-Francois Moine
2009-04-20 15:37               ` Thomas Champagne

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=20090301082635.0905afea@free.fr \
    --to=moinejf@free.fr \
    --cc=anders.blomdell@control.lth.se \
    --cc=lafeuil@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=v4l@kaiser-linux.li \
    /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).