From patchwork Fri Mar 23 19:19:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jean-Francois Moine X-Patchwork-Id: 10465 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1SBDnq-0002eZ-LS for patchwork@linuxtv.org; Sat, 24 Mar 2012 00:21:50 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtp for id 1SBDnp-0000mQ-J2; Sat, 24 Mar 2012 00:21:50 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759570Ab2CWTTa (ORCPT ); Fri, 23 Mar 2012 15:19:30 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:34683 "EHLO smtp1-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757313Ab2CWTT3 convert rfc822-to-8bit (ORCPT ); Fri, 23 Mar 2012 15:19:29 -0400 Received: from tele (unknown [IPv6:2a01:e35:2f5c:9de0:212:bfff:fe1e:9ce4]) by smtp1-g21.free.fr (Postfix) with ESMTP id 55BBF940147; Fri, 23 Mar 2012 20:19:20 +0100 (CET) Date: Fri, 23 Mar 2012 20:19:45 +0100 From: Jean-Francois Moine To: Hans de Goede Cc: linux-media@vger.kernel.org Subject: [PATCH] tinyjpeg: Better luminance quantization table for Pixart JPEG Message-ID: <20120323201945.39f26d98@tele> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.3.23.231215 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, MIME_LOWER_CASE 0.05, MSGID_ADDED_BY_MTA 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1700_1799 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, CT_TEXT_PLAIN_UTF8_CAPS 0, INVALID_MSGID_NO_FQDN 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_POSSIBLE_EXPLOIT_SUBJ 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __INT_PROD_QUALITY 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS ' 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 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,