PIXEL_FMT_P016 decoding

How to decode the image frame with PIXEL_FMT_P016 format?
I do something like this:
_iEGLStreamSettings->setPixelFormat(Argus::PIXEL_FMT_P016);
EGLStream::IFrame *iFrame = Argus::interface_castEGLStream::IFrame(frame);
EGLStream::Image *image = iFrame->getImage();

EGLStream::IImage *img = Argus::interface_castEGLStream::IImage(image);

Data in img looks like a structured noise. I guess the image stored in memory in native GPU format like z-ordered blocks, but I didn’t found libargus-related information about it. Only this https://www.kernel.org/doc/html/v4.13/media/uapi/v4l/pixfmt-nv12mt.html.

Hi,
Please share what your source format is. In general the format after ISP engine is YUV420 and if your source is not 16-bit content, it may not be required to set to PIXEL_FMT_P016.

Thanks for your answer.
I don’t really know what’s a format after ISP.
I use the LI-IMX265-MIPI-M12 camera module. It works with PIXEL_FMT_YCbCr_420_888 as it should, with PIXEL_FMT_RAW16 works without libargus postprocessing? but a can grab a frame and process int via NPP. With PIXEL_FMT_P016 it works (no errors, without libargus) but I can’t decode it (as I do with PIXEL_FMT_RAW16). I expect PIXEL_FMT_P016 will give me a YUV image, 16 (12 provided by sensor) bits per channel.
I want to have a 16-bit color image, but I don’t want to process PIXEL_FMT_RAW16 by NPP because it’s pretty slow (CFA + CCM takes about 50 ms). Libargus can’t process PIXEL_FMT_RAW16 and PIXEL_FMT_P016.

I think argus only support PIXEL_FMT_YCbCr_420_888 and PIXEL_FMT_RAW16, and the PIXEL_FMT_RAW16 is bayer raw format. I don’t think it could be support PIXEL_FMT_P016.

Yes, libargus does not support PIXEL_FMT_P016, but ISP probably do, at least I can grab a frame without errors. As I understand libargus can convert raw nvidia ISP frame (NVMM ?) into the usual CPU buffer. But without libargus i don’t know how to convert ISP frame into conventional CPU buffer.
PIXEL_FMT_P016 ISP frame in pseudocolors looks like this:


It’s a dark circle on a white background.
PIXEL_FMT_YCbCr_420_888 looks like this too, but after libargus processing looks as the image should.

Argus output is output from ISP. ISP only support PIXEL_FMT_YCbCr_420_888 and PIXEL_FMT_RAW16 that why we tell argus support these two format.

So, I can’t get a 12-bit YUV image? When can I expect support 12-bit YUV images in libargus?

Hi,
The case is not supported by hardware ISP engine. A possible solution is to do raw capture through v4l2 and implement de-bayering algorithm via CUDA. You may start with the sample:

/usr/src/jetson_multimedia_api/samples/v4l2cuda/