From patchwork Tue Feb 1 12:52:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 5770 Return-path: Envelope-to: mchehab@pedra Delivery-date: Tue, 01 Feb 2011 10:54:17 -0200 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1PkFkO-0006O7-Vl for mchehab@pedra; Tue, 01 Feb 2011 10:54:17 -0200 Received: from casper.infradead.org [85.118.1.10] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Tue, 01 Feb 2011 10:54:16 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PkFkA-0007Je-HS; Tue, 01 Feb 2011 12:54:02 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756771Ab1BAMxg (ORCPT + 1 other); Tue, 1 Feb 2011 07:53:36 -0500 Received: from smtp204.alice.it ([82.57.200.100]:44229 "EHLO smtp204.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751640Ab1BAMxf (ORCPT ); Tue, 1 Feb 2011 07:53:35 -0500 X-Greylist: delayed 3944 seconds by postgrey-1.27 at vger.kernel.org; Tue, 01 Feb 2011 07:53:35 EST Received: from jcn (82.61.82.22) by smtp204.alice.it (8.5.124.08) id 4C88E33B0BE2F956; Tue, 1 Feb 2011 13:53:02 +0100 Received: from ao2 by jcn with local (Exim 4.72) (envelope-from ) id 1PkFj9-0003yO-Hs; Tue, 01 Feb 2011 13:52:59 +0100 From: Antonio Ospite To: linux-media@vger.kernel.org Cc: Antonio Ospite , openkinect@googlegroups.com, Steven Toth , Randy Dunlap , Mauro Carvalho Chehab , Guennadi Liakhovetski , Sakari Ailus , Hans Verkuil , Laurent Pinchart , Xiaolin Zhang , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] Add a 10 bpp packed greyscale format. Date: Tue, 1 Feb 2011 13:52:52 +0100 Message-Id: <1296564773-15245-1-git-send-email-ospite@studenti.unina.it> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1295038598-8548-1-git-send-email-ospite@studenti.unina.it> References: <1295038598-8548-1-git-send-email-ospite@studenti.unina.it> X-Face: z*RaLf`X<@C75u6Ig9}{oW$H; 1_\2t5)({*|jhM/Vb; ]yA5\I~93>J<_`<4)A{':UrE Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Add a 10 bits per pixel greyscale format in a packed array representation, naming it Y10P. Such pixel format is supplied for instance by the Kinect sensor device. Signed-off-by: Antonio Ospite --- Hi, Changes since v1: * Fixed a trailing space, I forgot to run ./scripts/checkpatch.pl on v1 I also added maintainers from ./scripts/get_maintainer.pl to CC, this should increase the chance for the patch to be noticed. Please comment on that, so I can send the final version if needed and start adding support for the format to libv4l. Thanks, Antonio Ospite http://ao2.it Documentation/DocBook/media-entities.tmpl | 1 + Documentation/DocBook/v4l/pixfmt-y10p.xml | 43 +++++++++++++++++++++++++++++ Documentation/DocBook/v4l/pixfmt.xml | 1 + Documentation/DocBook/v4l/videodev2.h.xml | 1 + include/linux/videodev2.h | 1 + 5 files changed, 47 insertions(+), 0 deletions(-) create mode 100644 Documentation/DocBook/v4l/pixfmt-y10p.xml diff --git a/Documentation/DocBook/media-entities.tmpl b/Documentation/DocBook/media-entities.tmpl index be34dcb..2b18de5 100644 --- a/Documentation/DocBook/media-entities.tmpl +++ b/Documentation/DocBook/media-entities.tmpl @@ -253,6 +253,7 @@ + diff --git a/Documentation/DocBook/v4l/pixfmt-y10p.xml b/Documentation/DocBook/v4l/pixfmt-y10p.xml new file mode 100644 index 0000000..5323ffe --- /dev/null +++ b/Documentation/DocBook/v4l/pixfmt-y10p.xml @@ -0,0 +1,43 @@ + + + V4L2_PIX_FMT_Y10P ('Y10P') + &manvol; + + + V4L2_PIX_FMT_Y10P + Grey-scale image as a packed array + + + Description + + This is a packed grey-scale image format with a depth of 10 bits per + pixel. Pixels are stored in a packed array of 10bit bits per pixel, with + no padding between them and with the most significant bits coming first + from the left. + + + <constant>V4L2_PIX_FMT_Y10P</constant> 4 pixel data stream taking 5 bytes + + + Packed representation + pixels cross the byte boundary and have a ratio of 5 bytes for each 4 + pixels. + + + + + + Y'00[9:2] + Y'00[1:0]Y'01[9:4] + Y'01[3:0]Y'02[9:6] + Y'02[5:0]Y'03[9:8] + Y'03[7:0] + + + + + + + + + diff --git a/Documentation/DocBook/v4l/pixfmt.xml b/Documentation/DocBook/v4l/pixfmt.xml index d7c4671..3682701 100644 --- a/Documentation/DocBook/v4l/pixfmt.xml +++ b/Documentation/DocBook/v4l/pixfmt.xml @@ -592,6 +592,7 @@ information. &sub-packed-yuv; &sub-grey; &sub-y10; + &sub-y10p; &sub-y16; &sub-yuyv; &sub-uyvy; diff --git a/Documentation/DocBook/v4l/videodev2.h.xml b/Documentation/DocBook/v4l/videodev2.h.xml index 325b23b..eb39f6b 100644 --- a/Documentation/DocBook/v4l/videodev2.h.xml +++ b/Documentation/DocBook/v4l/videodev2.h.xml @@ -289,6 +289,7 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */ #define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */ #define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */ +#define V4L2_PIX_FMT_Y10P v4l2_fourcc('Y', '1', '0', 'P') /* 10 Greyscale as a packed array */ #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ /* Palette formats */ diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 5f6f470..7682581 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -288,6 +288,7 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */ #define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */ #define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */ +#define V4L2_PIX_FMT_Y10P v4l2_fourcc('Y', '1', '0', 'P') /* 10 Greyscale as a packed array */ #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ /* Palette formats */