* [PATCH 0/2] [media] Confidence pixel-format for Intel RealSense cameras @ 2018-09-06 7:51 dorodnic 2018-09-06 7:51 ` [PATCH 1/2] CNF4 fourcc for 4 bit-per-pixel packed confidence information dorodnic 2018-09-06 7:51 ` [PATCH 2/2] CNF4 pixel format for media subsystem dorodnic 0 siblings, 2 replies; 6+ messages in thread From: dorodnic @ 2018-09-06 7:51 UTC (permalink / raw) To: linux-media; +Cc: laurent.pinchart, evgeni.raikhel, Sergey Dorodnicov From: Sergey Dorodnicov <sergey.dorodnicov@intel.com> Define new fourcc describing depth sensor confidence data used in Intel RealSense cameras. Confidence information is stored as packed 4 bits per pixel single-plane image. The patches were tested on 4.18-rc2 and merged with media_tree/master. Sergey Dorodnicov (2): CNF4 fourcc for 4 bit-per-pixel packed confidence information CNF4 pixel format for media subsystem Documentation/media/uapi/v4l/depth-formats.rst | 1 + Documentation/media/uapi/v4l/pixfmt-cnf4.rst | 30 ++++++++++++++++++++++++++ drivers/media/usb/uvc/uvc_driver.c | 5 +++++ drivers/media/usb/uvc/uvcvideo.h | 3 +++ drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h | 1 + 6 files changed, 41 insertions(+) create mode 100644 Documentation/media/uapi/v4l/pixfmt-cnf4.rst -- 2.7.4 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] CNF4 fourcc for 4 bit-per-pixel packed confidence information 2018-09-06 7:51 [PATCH 0/2] [media] Confidence pixel-format for Intel RealSense cameras dorodnic @ 2018-09-06 7:51 ` dorodnic 2018-09-06 9:36 ` Hans Verkuil 2018-09-06 7:51 ` [PATCH 2/2] CNF4 pixel format for media subsystem dorodnic 1 sibling, 1 reply; 6+ messages in thread From: dorodnic @ 2018-09-06 7:51 UTC (permalink / raw) To: linux-media; +Cc: laurent.pinchart, evgeni.raikhel, Sergey Dorodnicov From: Sergey Dorodnicov <sergey.dorodnicov@intel.com> Adding new fourcc CNF4 for 4 bit-per-pixel packed confidence information provided by Intel RealSense depth cameras. Every two consecutive pixels are packed into a single byte (little-endian). Signed-off-by: Sergey Dorodnicov <sergey.dorodnicov@intel.com> Signed-off-by: Evgeni Raikhel <evgeni.raikhel@intel.com> --- Documentation/media/uapi/v4l/depth-formats.rst | 1 + Documentation/media/uapi/v4l/pixfmt-cnf4.rst | 30 ++++++++++++++++++++++++++ drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h | 1 + 4 files changed, 33 insertions(+) create mode 100644 Documentation/media/uapi/v4l/pixfmt-cnf4.rst diff --git a/Documentation/media/uapi/v4l/depth-formats.rst b/Documentation/media/uapi/v4l/depth-formats.rst index d1641e9..9533348 100644 --- a/Documentation/media/uapi/v4l/depth-formats.rst +++ b/Documentation/media/uapi/v4l/depth-formats.rst @@ -14,3 +14,4 @@ Depth data provides distance to points, mapped onto the image plane pixfmt-inzi pixfmt-z16 + pixfmt-cnf4 diff --git a/Documentation/media/uapi/v4l/pixfmt-cnf4.rst b/Documentation/media/uapi/v4l/pixfmt-cnf4.rst new file mode 100644 index 0000000..d24fc1a --- /dev/null +++ b/Documentation/media/uapi/v4l/pixfmt-cnf4.rst @@ -0,0 +1,30 @@ +.. -*- coding: utf-8; mode: rst -*- + +.. _V4L2-PIX-FMT-CNF4: + +****************************** +V4L2_PIX_FMT_CNF4 ('CNF4') +****************************** + +Sensor confidence information as a 4 bits per pixel packed array + +Description +=========== + +Proprietary format used by Intel RealSense Depth cameras containing sensor +confidence information in range 0-15 with 0 indicating that the sensor was +unable to resolve any signal and 15 indicating maximum level of confidence for +the specific sensor (actual error margins might change from sensor to sensor). + +Every two consecutive pixels are packed into a single byte (bit order is +little-endian). + +**Bit-packed representation.** + +.. flat-table:: + :header-rows: 0 + :stub-columns: 0 + :widths: 64 64 + + * - Y'\ :sub:`01[3:0]`\ (bits 3--0) Y'\ :sub:`00[3:0]`\ (bits 7--4) + - Y'\ :sub:`03[3:0]`\ (bits 3--0) Y'\ :sub:`02[3:0]`\ (bits 7--4) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 54afc9c..eff296d 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1189,6 +1189,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_Y12I: descr = "Interleaved 12-bit Greyscale"; break; case V4L2_PIX_FMT_Z16: descr = "16-bit Depth"; break; case V4L2_PIX_FMT_INZI: descr = "Planar 10:16 Greyscale Depth"; break; + case V4L2_PIX_FMT_CNF4: descr = "4-bit Confidence (Packed)"; break; case V4L2_PIX_FMT_PAL8: descr = "8-bit Palette"; break; case V4L2_PIX_FMT_UV8: descr = "8-bit Chrominance UV 4-4"; break; case V4L2_PIX_FMT_YVU410: descr = "Planar YVU 4:1:0"; break; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 5d1a368..a47f603 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -676,6 +676,7 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */ #define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */ #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */ +#define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed confidence information */ /* 10bit raw bayer packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */ #define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */ -- 2.7.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] CNF4 fourcc for 4 bit-per-pixel packed confidence information 2018-09-06 7:51 ` [PATCH 1/2] CNF4 fourcc for 4 bit-per-pixel packed confidence information dorodnic @ 2018-09-06 9:36 ` Hans Verkuil 0 siblings, 0 replies; 6+ messages in thread From: Hans Verkuil @ 2018-09-06 9:36 UTC (permalink / raw) To: dorodnic, linux-media; +Cc: laurent.pinchart, evgeni.raikhel, Sergey Dorodnicov Hi Sergey, Some review comments: On 09/06/18 09:51, dorodnic@gmail.com wrote: > From: Sergey Dorodnicov <sergey.dorodnicov@intel.com> > > Adding new fourcc CNF4 for 4 bit-per-pixel packed confidence information > provided by Intel RealSense depth cameras. Every two consecutive pixels > are packed into a single byte (little-endian). > > Signed-off-by: Sergey Dorodnicov <sergey.dorodnicov@intel.com> > Signed-off-by: Evgeni Raikhel <evgeni.raikhel@intel.com> > --- > Documentation/media/uapi/v4l/depth-formats.rst | 1 + > Documentation/media/uapi/v4l/pixfmt-cnf4.rst | 30 ++++++++++++++++++++++++++ > drivers/media/v4l2-core/v4l2-ioctl.c | 1 + > include/uapi/linux/videodev2.h | 1 + > 4 files changed, 33 insertions(+) > create mode 100644 Documentation/media/uapi/v4l/pixfmt-cnf4.rst > > diff --git a/Documentation/media/uapi/v4l/depth-formats.rst b/Documentation/media/uapi/v4l/depth-formats.rst > index d1641e9..9533348 100644 > --- a/Documentation/media/uapi/v4l/depth-formats.rst > +++ b/Documentation/media/uapi/v4l/depth-formats.rst > @@ -14,3 +14,4 @@ Depth data provides distance to points, mapped onto the image plane > > pixfmt-inzi > pixfmt-z16 > + pixfmt-cnf4 > diff --git a/Documentation/media/uapi/v4l/pixfmt-cnf4.rst b/Documentation/media/uapi/v4l/pixfmt-cnf4.rst > new file mode 100644 > index 0000000..d24fc1a > --- /dev/null > +++ b/Documentation/media/uapi/v4l/pixfmt-cnf4.rst > @@ -0,0 +1,30 @@ > +.. -*- coding: utf-8; mode: rst -*- > + > +.. _V4L2-PIX-FMT-CNF4: > + > +****************************** > +V4L2_PIX_FMT_CNF4 ('CNF4') > +****************************** > + > +Sensor confidence information as a 4 bits per pixel packed array Confidence in what? I'll take a wild guess and say that it is about depth confidence, but I don't think you actually say this anywhere :-) > + > +Description > +=========== > + > +Proprietary format used by Intel RealSense Depth cameras containing sensor > +confidence information in range 0-15 with 0 indicating that the sensor was > +unable to resolve any signal and 15 indicating maximum level of confidence for > +the specific sensor (actual error margins might change from sensor to sensor). > + > +Every two consecutive pixels are packed into a single byte (bit order is > +little-endian). Luckily, the bit order is always little-endian, so that doesn't help. It's better to be specific here: bits 0-3 refer to the confidence value for the pixel at position X, bits 407 refer to the pixel at position X+1, where X is even. > + > +**Bit-packed representation.** > + > +.. flat-table:: > + :header-rows: 0 > + :stub-columns: 0 > + :widths: 64 64 > + > + * - Y'\ :sub:`01[3:0]`\ (bits 3--0) Y'\ :sub:`00[3:0]`\ (bits 7--4) > + - Y'\ :sub:`03[3:0]`\ (bits 3--0) Y'\ :sub:`02[3:0]`\ (bits 7--4) > diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c > index 54afc9c..eff296d 100644 > --- a/drivers/media/v4l2-core/v4l2-ioctl.c > +++ b/drivers/media/v4l2-core/v4l2-ioctl.c > @@ -1189,6 +1189,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) > case V4L2_PIX_FMT_Y12I: descr = "Interleaved 12-bit Greyscale"; break; > case V4L2_PIX_FMT_Z16: descr = "16-bit Depth"; break; > case V4L2_PIX_FMT_INZI: descr = "Planar 10:16 Greyscale Depth"; break; > + case V4L2_PIX_FMT_CNF4: descr = "4-bit Confidence (Packed)"; break; This should probably become "4-bit Depth Confidence (Packed)". > case V4L2_PIX_FMT_PAL8: descr = "8-bit Palette"; break; > case V4L2_PIX_FMT_UV8: descr = "8-bit Chrominance UV 4-4"; break; > case V4L2_PIX_FMT_YVU410: descr = "Planar YVU 4:1:0"; break; > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h > index 5d1a368..a47f603 100644 > --- a/include/uapi/linux/videodev2.h > +++ b/include/uapi/linux/videodev2.h > @@ -676,6 +676,7 @@ struct v4l2_pix_format { > #define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */ > #define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */ > #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */ > +#define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed confidence information */ again, be explicit: "depth confidence" > > /* 10bit raw bayer packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */ > #define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */ > Regards, Hans ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] CNF4 pixel format for media subsystem 2018-09-06 7:51 [PATCH 0/2] [media] Confidence pixel-format for Intel RealSense cameras dorodnic 2018-09-06 7:51 ` [PATCH 1/2] CNF4 fourcc for 4 bit-per-pixel packed confidence information dorodnic @ 2018-09-06 7:51 ` dorodnic 2018-09-06 9:37 ` Hans Verkuil 1 sibling, 1 reply; 6+ messages in thread From: dorodnic @ 2018-09-06 7:51 UTC (permalink / raw) To: linux-media; +Cc: laurent.pinchart, evgeni.raikhel, Sergey Dorodnicov From: Sergey Dorodnicov <sergey.dorodnicov@intel.com> Registering new GUID used by Intel RealSense depth cameras with fourcc CNF4, encoding sensor confidence information for every pixel. Signed-off-by: Sergey Dorodnicov <sergey.dorodnicov@intel.com> Signed-off-by: Evgeni Raikhel <evgeni.raikhel@intel.com> --- drivers/media/usb/uvc/uvc_driver.c | 5 +++++ drivers/media/usb/uvc/uvcvideo.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index d46dc43..c8d40a4 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -214,6 +214,11 @@ static struct uvc_format_desc uvc_fmts[] = { .guid = UVC_GUID_FORMAT_INZI, .fcc = V4L2_PIX_FMT_INZI, }, + { + .name = "Confidence 4-bit Packed (CNF4)", + .guid = UVC_GUID_FORMAT_CNF4, + .fcc = V4L2_PIX_FMT_CNF4, + }, }; /* ------------------------------------------------------------------------ diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h index e5f5d84..779bab2 100644 --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h @@ -154,6 +154,9 @@ #define UVC_GUID_FORMAT_INVI \ { 'I', 'N', 'V', 'I', 0xdb, 0x57, 0x49, 0x5e, \ 0x8e, 0x3f, 0xf4, 0x79, 0x53, 0x2b, 0x94, 0x6f} +#define UVC_GUID_FORMAT_CNF4 \ + { 'C', ' ', ' ', ' ', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} #define UVC_GUID_FORMAT_D3DFMT_L8 \ {0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, \ -- 2.7.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] CNF4 pixel format for media subsystem 2018-09-06 7:51 ` [PATCH 2/2] CNF4 pixel format for media subsystem dorodnic @ 2018-09-06 9:37 ` Hans Verkuil 2018-09-06 10:05 ` Laurent Pinchart 0 siblings, 1 reply; 6+ messages in thread From: Hans Verkuil @ 2018-09-06 9:37 UTC (permalink / raw) To: dorodnic, linux-media; +Cc: laurent.pinchart, evgeni.raikhel, Sergey Dorodnicov On 09/06/18 09:51, dorodnic@gmail.com wrote: > From: Sergey Dorodnicov <sergey.dorodnicov@intel.com> > > Registering new GUID used by Intel RealSense depth cameras with fourcc > CNF4, encoding sensor confidence information for every pixel. > > Signed-off-by: Sergey Dorodnicov <sergey.dorodnicov@intel.com> > Signed-off-by: Evgeni Raikhel <evgeni.raikhel@intel.com> > --- > drivers/media/usb/uvc/uvc_driver.c | 5 +++++ > drivers/media/usb/uvc/uvcvideo.h | 3 +++ > 2 files changed, 8 insertions(+) > > diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c > index d46dc43..c8d40a4 100644 > --- a/drivers/media/usb/uvc/uvc_driver.c > +++ b/drivers/media/usb/uvc/uvc_driver.c > @@ -214,6 +214,11 @@ static struct uvc_format_desc uvc_fmts[] = { > .guid = UVC_GUID_FORMAT_INZI, > .fcc = V4L2_PIX_FMT_INZI, > }, > + { > + .name = "Confidence 4-bit Packed (CNF4)", The name should correspond to what is set in v4l2-ioctl.c. Regards, Hans > + .guid = UVC_GUID_FORMAT_CNF4, > + .fcc = V4L2_PIX_FMT_CNF4, > + }, > }; > > /* ------------------------------------------------------------------------ > diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h > index e5f5d84..779bab2 100644 > --- a/drivers/media/usb/uvc/uvcvideo.h > +++ b/drivers/media/usb/uvc/uvcvideo.h > @@ -154,6 +154,9 @@ > #define UVC_GUID_FORMAT_INVI \ > { 'I', 'N', 'V', 'I', 0xdb, 0x57, 0x49, 0x5e, \ > 0x8e, 0x3f, 0xf4, 0x79, 0x53, 0x2b, 0x94, 0x6f} > +#define UVC_GUID_FORMAT_CNF4 \ > + { 'C', ' ', ' ', ' ', 0x00, 0x00, 0x10, 0x00, \ > + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} > > #define UVC_GUID_FORMAT_D3DFMT_L8 \ > {0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, \ > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] CNF4 pixel format for media subsystem 2018-09-06 9:37 ` Hans Verkuil @ 2018-09-06 10:05 ` Laurent Pinchart 0 siblings, 0 replies; 6+ messages in thread From: Laurent Pinchart @ 2018-09-06 10:05 UTC (permalink / raw) To: Hans Verkuil; +Cc: dorodnic, linux-media, evgeni.raikhel, Sergey Dorodnicov Hello Sergey, On Thursday, 6 September 2018 12:37:36 EEST Hans Verkuil wrote: > On 09/06/18 09:51, dorodnic@gmail.com wrote: > > From: Sergey Dorodnicov <sergey.dorodnicov@intel.com> > > > > Registering new GUID used by Intel RealSense depth cameras with fourcc > > CNF4, encoding sensor confidence information for every pixel. s/confidence/depth confidence/ > > > > Signed-off-by: Sergey Dorodnicov <sergey.dorodnicov@intel.com> > > Signed-off-by: Evgeni Raikhel <evgeni.raikhel@intel.com> Could you please send me the output of lsusb -v (ideally run as root, or through sudo) for a camera that uses this format ? > > --- > > > > drivers/media/usb/uvc/uvc_driver.c | 5 +++++ > > drivers/media/usb/uvc/uvcvideo.h | 3 +++ > > 2 files changed, 8 insertions(+) > > > > diff --git a/drivers/media/usb/uvc/uvc_driver.c > > b/drivers/media/usb/uvc/uvc_driver.c index d46dc43..c8d40a4 100644 > > --- a/drivers/media/usb/uvc/uvc_driver.c > > +++ b/drivers/media/usb/uvc/uvc_driver.c > > @@ -214,6 +214,11 @@ static struct uvc_format_desc uvc_fmts[] = { > > .guid = UVC_GUID_FORMAT_INZI, > > .fcc = V4L2_PIX_FMT_INZI, > > }, > > + { > > + .name = "Confidence 4-bit Packed (CNF4)", > > The name should correspond to what is set in v4l2-ioctl.c. And should even be removed as it duplicates the names in v4l2-ioctl.c. I have a half-baked patch to do so, I'll try to resurrect it. This isn't a blocking issue, I'll rebase my patch on top of this one. > > + .guid = UVC_GUID_FORMAT_CNF4, > > + .fcc = V4L2_PIX_FMT_CNF4, > > + }, > > }; > > > > /* ---------------------------------------------------------------------- > > diff --git a/drivers/media/usb/uvc/uvcvideo.h > > b/drivers/media/usb/uvc/uvcvideo.h index e5f5d84..779bab2 100644 > > --- a/drivers/media/usb/uvc/uvcvideo.h > > +++ b/drivers/media/usb/uvc/uvcvideo.h > > @@ -154,6 +154,9 @@ > > #define UVC_GUID_FORMAT_INVI \ > > { 'I', 'N', 'V', 'I', 0xdb, 0x57, 0x49, 0x5e, \ > > 0x8e, 0x3f, 0xf4, 0x79, 0x53, 0x2b, 0x94, 0x6f} > > +#define UVC_GUID_FORMAT_CNF4 \ > > + { 'C', ' ', ' ', ' ', 0x00, 0x00, 0x10, 0x00, \ > > + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} > > > > #define UVC_GUID_FORMAT_D3DFMT_L8 \ > > {0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, \ -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-09-06 14:40 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-09-06 7:51 [PATCH 0/2] [media] Confidence pixel-format for Intel RealSense cameras dorodnic 2018-09-06 7:51 ` [PATCH 1/2] CNF4 fourcc for 4 bit-per-pixel packed confidence information dorodnic 2018-09-06 9:36 ` Hans Verkuil 2018-09-06 7:51 ` [PATCH 2/2] CNF4 pixel format for media subsystem dorodnic 2018-09-06 9:37 ` Hans Verkuil 2018-09-06 10:05 ` Laurent Pinchart
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.