* [PATCH] tinyjpeg: Better luminance quantization table for Pixart JPEG
@ 2012-03-23 19:19 Jean-Francois Moine
2012-04-07 15:01 ` Hans de Goede
0 siblings, 1 reply; 2+ messages in thread
From: Jean-Francois Moine @ 2012-03-23 19:19 UTC (permalink / raw)
To: Hans de Goede; +Cc: linux-media
An other luminance quantization table gives a better quality to the
Pixart images created by the webcams handled by the gspca drivers
pac7302 and pac7311 (pixel format 'PJPG').
Tests have been done with 5 different pac7302 webcams. The marker was
always 0x44.
Signed-off-by: Jean-François Moine <moinejf@free.fr>
diff --git a/lib/libv4lconvert/tinyjpeg.c b/lib/libv4lconvert/tinyjpeg.c
index e308f63..687e69c 100644
--- a/lib/libv4lconvert/tinyjpeg.c
+++ b/lib/libv4lconvert/tinyjpeg.c
@@ -206,14 +206,14 @@ static const unsigned char val_ac_chrominance[] = {
};
const unsigned char pixart_quantization[][64] = { {
- 0x07, 0x07, 0x08, 0x0a, 0x09, 0x07, 0x0d, 0x0b,
- 0x0c, 0x0d, 0x11, 0x10, 0x0f, 0x12, 0x17, 0x27,
- 0x1a, 0x18, 0x16, 0x16, 0x18, 0x31, 0x23, 0x25,
- 0x1d, 0x28, 0x3a, 0x33, 0x3d, 0x3c, 0x39, 0x33,
- 0x38, 0x37, 0x40, 0x48, 0x5c, 0x4e, 0x40, 0x44,
- 0x57, 0x45, 0x37, 0x38, 0x50, 0x6d, 0x51, 0x57,
- 0x5f, 0x62, 0x67, 0x68, 0x67, 0x3e, 0x4d, 0x71,
- 0x79, 0x70, 0x64, 0x78, 0x5c, 0x65, 0x67, 0x63,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x10, 0x10,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+ 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x40,
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
},
{
0x11, 0x12, 0x12, 0x18, 0x15, 0x18, 0x2f, 0x1a,
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tinyjpeg: Better luminance quantization table for Pixart JPEG
2012-03-23 19:19 [PATCH] tinyjpeg: Better luminance quantization table for Pixart JPEG Jean-Francois Moine
@ 2012-04-07 15:01 ` Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2012-04-07 15:01 UTC (permalink / raw)
To: Jean-Francois Moine; +Cc: linux-media
Hi,
Thanks for the patch, I've pushed it to v4l-utils master and I will
cherry-pick it into the stable-0.8 branch after this mail.
I noticed while testing with a pac7302 camera, that under certain
circumstances the jpeg decompression still goes wrong. When you
point the camera at a high contrast picture in proper daylight,
it switches to a higher compression for certain areas of the picture,
and these areas become quite "blockey" when this happens the marker
changes to a different value. I think we should use a different
quant. table when this happens. It would be great if you can reproduce
this and find out a way to make the image less blocky in these
cases.
Thanks & Regards,
Hans
On 03/23/2012 08:19 PM, Jean-Francois Moine wrote:
> An other luminance quantization table gives a better quality to the
> Pixart images created by the webcams handled by the gspca drivers
> pac7302 and pac7311 (pixel format 'PJPG').
>
> Tests have been done with 5 different pac7302 webcams. The marker was
> always 0x44.
>
> Signed-off-by: Jean-François Moine<moinejf@free.fr>
>
> diff --git a/lib/libv4lconvert/tinyjpeg.c b/lib/libv4lconvert/tinyjpeg.c
> index e308f63..687e69c 100644
> --- a/lib/libv4lconvert/tinyjpeg.c
> +++ b/lib/libv4lconvert/tinyjpeg.c
> @@ -206,14 +206,14 @@ static const unsigned char val_ac_chrominance[] = {
> };
>
> const unsigned char pixart_quantization[][64] = { {
> - 0x07, 0x07, 0x08, 0x0a, 0x09, 0x07, 0x0d, 0x0b,
> - 0x0c, 0x0d, 0x11, 0x10, 0x0f, 0x12, 0x17, 0x27,
> - 0x1a, 0x18, 0x16, 0x16, 0x18, 0x31, 0x23, 0x25,
> - 0x1d, 0x28, 0x3a, 0x33, 0x3d, 0x3c, 0x39, 0x33,
> - 0x38, 0x37, 0x40, 0x48, 0x5c, 0x4e, 0x40, 0x44,
> - 0x57, 0x45, 0x37, 0x38, 0x50, 0x6d, 0x51, 0x57,
> - 0x5f, 0x62, 0x67, 0x68, 0x67, 0x3e, 0x4d, 0x71,
> - 0x79, 0x70, 0x64, 0x78, 0x5c, 0x65, 0x67, 0x63,
> + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x10, 0x10,
> + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
> + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
> + 0x10, 0x10, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20,
> + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
> + 0x20, 0x20, 0x20, 0x40, 0x40, 0x40, 0x40, 0x40,
> + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
> + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
> },
> {
> 0x11, 0x12, 0x12, 0x18, 0x15, 0x18, 0x2f, 0x1a,
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-07 14:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-23 19:19 [PATCH] tinyjpeg: Better luminance quantization table for Pixart JPEG Jean-Francois Moine
2012-04-07 15:01 ` Hans de Goede
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.