From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pb0-f46.google.com ([209.85.160.46]:51173 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753581Ab2GaV7m (ORCPT ); Tue, 31 Jul 2012 17:59:42 -0400 Received: by pbbrp8 with SMTP id rp8so6748pbb.19 for ; Tue, 31 Jul 2012 14:59:42 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <5018396F.90103@redhat.com> References: <1343763638-7571-1-git-send-email-ilyes.gouta@gmail.com> <5018396F.90103@redhat.com> From: Ilyes Gouta Date: Tue, 31 Jul 2012 22:59:22 +0100 Message-ID: Subject: Re: [RESEND,media] v4l2: define V4L2_PIX_FMT_NV16M and V4L2_PIX_FMT_NV24M pixel formats To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, Ilyes Gouta Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-media-owner@vger.kernel.org List-ID: Hi Mauro, >> 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. > > We only add new stuff at API when a driver is using, in order to avoid overriding the > Kernel with unused stuff. So, please submit this patch when you're ready to submit > the driver that is using it. Alright, thanks for explaining that. > Also, in the particular case of newer pixel formats, it may make sense to submit > a patch to v4l-utils, if the new format(s) is(are) the only one(s) available for > userspace to retrieve the data. Yes indeed, that would be a second goal, as we'd need to also update the v4l-utils libs to also recognize such formats. Regards, -Ilyes > Thanks, > Mauro > >> >> 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 */ >> > From mboxrd@z Thu Jan 1 00:00:00 1970 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 S1751661Ab2GaTnT (ORCPT ); Tue, 31 Jul 2012 15:43:19 -0400 Received: by mail-we0-f174.google.com with SMTP id x8so4602944wey.19 for ; Tue, 31 Jul 2012 12:43:19 -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:23:36 +0100 Message-Id: <1343762616-7295-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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx1.redhat.com ([209.132.183.28]:53202 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752271Ab2GaUA7 (ORCPT ); Tue, 31 Jul 2012 16:00:59 -0400 Message-ID: <5018396F.90103@redhat.com> Date: Tue, 31 Jul 2012 17:00:47 -0300 From: Mauro Carvalho Chehab MIME-Version: 1.0 To: Ilyes Gouta CC: linux-media@vger.kernel.org, Ilyes Gouta Subject: Re: [RESEND,media] v4l2: define V4L2_PIX_FMT_NV16M and V4L2_PIX_FMT_NV24M pixel formats References: <1343763638-7571-1-git-send-email-ilyes.gouta@gmail.com> In-Reply-To: <1343763638-7571-1-git-send-email-ilyes.gouta@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org List-ID: Hi Ilyes, Em 31-07-2012 16:40, Ilyes Gouta escreveu: > 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. We only add new stuff at API when a driver is using, in order to avoid overriding the Kernel with unused stuff. So, please submit this patch when you're ready to submit the driver that is using it. Also, in the particular case of newer pixel formats, it may make sense to submit a patch to v4l-utils, if the new format(s) is(are) the only one(s) available for userspace to retrieve the data. Thanks, Mauro > > 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 */ > From mboxrd@z Thu Jan 1 00:00:00 1970 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