Return-path: Received: from mail-we0-f174.google.com ([74.125.82.174]:49447 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751661Ab2GaTnS (ORCPT ); Tue, 31 Jul 2012 15:43:18 -0400 Received: by weyx8 with SMTP id x8so4602944wey.19 for ; Tue, 31 Jul 2012 12:43:16 -0700 (PDT) From: Ilyes Gouta To: linux-media@vger.kernel.org Cc: Ilyes Gouta , Ilyes Gouta Subject: [RESEND,media] v4l2: define V4L2_PIX_FMT_NV16M and V4L2_PIX_FMT_NV24M pixel formats Date: Tue, 31 Jul 2012 20:40:38 +0100 Message-Id: <1343763638-7571-1-git-send-email-ilyes.gouta@gmail.com> Sender: linux-media-owner@vger.kernel.org List-ID: Define the two new V4L2_PIX_FMT_NV16M (4:2:2 two-buffers) and V4L2_PIX_FMT_NV24M (4:4:4 two-buffers) pixel formats, the non-contiguous variants of the existing V4L2_PIX_FMT_NV16 and V4L2_PIX_FMT_NV24 formats. Existing h/w IPs, such as decoders, operate on such separate luma and chroma buffers. Signed-off-by: Ilyes Gouta --- Documentation/DocBook/media/v4l/pixfmt-nv16m.xml | 166 +++++++++++++++++++++ Documentation/DocBook/media/v4l/pixfmt-nv24m.xml | 182 +++++++++++++++++++++++ Documentation/DocBook/media/v4l/pixfmt.xml | 2 + include/linux/videodev2.h | 2 + 4 files changed, 352 insertions(+) create mode 100644 Documentation/DocBook/media/v4l/pixfmt-nv16m.xml create mode 100644 Documentation/DocBook/media/v4l/pixfmt-nv24m.xml diff --git a/Documentation/DocBook/media/v4l/pixfmt-nv16m.xml b/Documentation/DocBook/media/v4l/pixfmt-nv16m.xml new file mode 100644 index 0000000..76e48bf --- /dev/null +++ b/Documentation/DocBook/media/v4l/pixfmt-nv16m.xml @@ -0,0 +1,166 @@ + + + V4L2_PIX_FMT_NV16M ('NM16') + &manvol; + + + V4L2_PIX_FMT_NV16M + Variation of V4L2_PIX_FMT_NV16 with planes + non contiguous in memory. + + + Description + + This is a multi-planar, two-plane version of the YUV 4:2:2 format. +The three components are separated into two sub-images or planes. +V4L2_PIX_FMT_NV16M differs from V4L2_PIX_FMT_NV16 + in that the two planes are non-contiguous in memory, i.e. the chroma +plane do not necessarily immediately follows the luma plane. +The luminance data occupies the first plane. The Y plane has one byte per pixel. +In the second plane there is a chrominance data with alternating chroma samples. +The CbCr plane has the same width and height, in bytes, as the Y plane (and of the image). +Each CbCr pair belongs to two pixels. For example, +Cb0/Cr0 belongs to +Y00, Y'01. + + V4L2_PIX_FMT_NV16M is intended to be +used only in drivers and applications that support the multi-planar API, +described in . + + If the Y plane has pad bytes after each row, then the +CbCr plane has as many pad bytes after its rows. + + + <constant>V4L2_PIX_FMT_NV16M</constant> 4 × 4 pixel image + + + Byte Order. + Each cell is one byte. + + + + + + start0 + 0: + Y'00 + Y'01 + Y'02 + Y'03 + + + start0 + 4: + Y'10 + Y'11 + Y'12 + Y'13 + + + start0 + 8: + Y'20 + Y'21 + Y'22 + Y'23 + + + start0 + 12: + Y'30 + Y'31 + Y'32 + Y'33 + + + + + + start1 + 0: + Cb00 + Cr00 + Cb01 + Cr01 + + + start1 + 4: + Cb10 + Cr10 + Cb11 + Cr11 + + + start1 + 8: + Cb20 + Cr20 + Cb21 + Cr21 + + + start1 + 12: + Cb30 + Cr30 + Cb31 + Cr31 + + + + + + + + + Color Sample Location. + + + + + + + 01 + 23 + + + 0 + YY + YY + + + + C + C + + + 1 + YY + YY + + + + C + C + + + 2 + YY + YY + + + + C + C + + + 3 + YY + YY + + + + C + C + + + + + + + + + diff --git a/Documentation/DocBook/media/v4l/pixfmt-nv24m.xml b/Documentation/DocBook/media/v4l/pixfmt-nv24m.xml new file mode 100644 index 0000000..51b06d1 --- /dev/null +++ b/Documentation/DocBook/media/v4l/pixfmt-nv24m.xml @@ -0,0 +1,182 @@ + + + V4L2_PIX_FMT_NV24M ('NM24') + &manvol; + + + V4L2_PIX_FMT_NV24M + Variation of V4L2_PIX_FMT_NV24 with planes + non contiguous in memory. + + + Description + + This is a multi-planar, two-plane version of the YUV 4:4:4 format. +The three components are separated into two sub-images or planes. +V4L2_PIX_FMT_NV24M differs from V4L2_PIX_FMT_NV24 + in that the two planes are non-contiguous in memory, i.e. the chroma +plane do not necessarily immediately follows the luma plane. +The luminance data occupies the first plane. The Y plane has one byte per pixel. +In the second plane there is a chrominance data with alternating chroma samples. +The CbCr plane has the double of the width (in bytes) and the same height of the +Y plane. Each CbCr pair belongs to one pixel. For example, +Cb0/Cr0 belongs to +Y'00. + + V4L2_PIX_FMT_NV24M is intended to be +used only in drivers and applications that support the multi-planar API, +described in . + + If the Y plane has pad bytes after each row, then the +CbCr plane has as many pad bytes after its rows. + + + <constant>V4L2_PIX_FMT_NV24M</constant> 4 × 4 pixel image + + + Byte Order. + Each cell is one byte. + + + + + + start0 + 0: + Y'00 + Y'01 + Y'02 + Y'03 + + + start0 + 4: + Y'10 + Y'11 + Y'12 + Y'13 + + + start0 + 8: + Y'20 + Y'21 + Y'22 + Y'23 + + + start0 + 12: + Y'30 + Y'31 + Y'32 + Y'33 + + + + + + start1 + 0: + Cb00 + Cr00 + Cb01 + Cr01 + Cb02 + Cr02 + Cb03 + Cr03 + + + start1 + 8: + Cb10 + Cr10 + Cb11 + Cr11 + Cb12 + Cr12 + Cb13 + Cr13 + + + start1 + 16: + Cb20 + Cr20 + Cb21 + Cr21 + Cb22 + Cr22 + Cb23 + Cr23 + + + start1 + 24: + Cb30 + Cr30 + Cb31 + Cr31 + Cb32 + Cr32 + Cb33 + Cr33 + + + + + + + + + Color Sample Location. + + + + + + + 01 + 23 + + + 0 + YY + YY + + + + CC + CC + + + 1 + YY + YY + + + + CC + CC + + + 2 + YY + YY + + + + CC + CC + + + 3 + YY + YY + + + + CC + CC + + + + + + + + + diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml index e58934c..24e33db 100644 --- a/Documentation/DocBook/media/v4l/pixfmt.xml +++ b/Documentation/DocBook/media/v4l/pixfmt.xml @@ -713,6 +713,8 @@ information. &sub-yuv411p; &sub-nv12; &sub-nv12m; + &sub-nv16m; + &sub-nv24m; &sub-nv12mt; &sub-nv16; &sub-nv24; diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 5d78910..618bf50 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -360,6 +360,8 @@ struct v4l2_pix_format { /* two non contiguous planes - one Y, one Cr + Cb interleaved */ #define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */ +#define V4L2_PIX_FMT_NV16M v4l2_fourcc('N', 'M', '1', '6') /* 16 Y/CbCr 4:2:2 */ +#define V4L2_PIX_FMT_NV24M v4l2_fourcc('N', 'M', '2', '4') /* 24 Y/CbCr 4:4:4 */ #define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */ /* three non contiguous planes - Y, Cb, Cr */ -- 1.7.11.2