In the Tegra K1 TRM (TegraK1_TRM_DP06905001_public_v03p.pdf) section 28.2.4, it is mentioned that the VI unit has support for converting YUV422 to YUV planar/semiplanar formats.
But we are unable to achieve this. We have added support in VI_CSI_0_CSI_IMAGE_DT_0 as well as in VI_CSI_0_IMAGE_DEF_0 registers for processing YUV422 (YUV422_8) to YUV semi planar (T_Y8__U8V8_N422). But the output we get is not satisfactory. Are we missing something? Can somebody point us in the right direction?
We are able to capture NV16 (16bits per pixel semi planar) format successfully now. Your inputs were valuable in understanding more about how the VI unit works. However I have a few more doubts. Our camera can support both YUV420 8 bit (legacy) as well as YUV422 8 bit over MIPI. Which one would you recommend to be used to obtain the following formats to memory.
NV12/NV21 (12bits per pixel semi planar)
I420 (12bits per pixel fully planar)
The following configuration does not seem to work:
format = TEGRA_IMAGE_FORMAT_T_Y8__U8V8_N420;
data_type = TEGRA_IMAGE_DT_YUV422_8;
VI unit doesn’t do any chroma-decimation in horizontal or vertical direction.
So we should use the same output YUV format as we are getting from the CSI.
We can get YUV422 on CSI and write out 420 memory format.
Please follow the table below (from IAS) to select the CSI format/pixel format combination
that is supported.
There are two formats captured YUV422 and YUV420. Since the YUV420 formats are not being used in current products or are they anticipated to be used in the future, a de-featuring of the planarization support for YUV420 has been proposed. In this proposal, YUV420 data would be captured and stored to memory without planarization.
Just so we are clear about the formats we are discussing about. This is the convention we are using:
UYVY - YUV422 16bpp format (packed)
NV16 - YUV422 16bpp format (semi planar)
NV12 - YUV420 12bpp format (semi planar)
I420 - YUV420 12bpp format (full planar)
The above statements are confusing. Do you mean to say that we can get YUV422 from CSI and write it to memory in planar format. Which means that it will be NV16 format (422) and not NV12 format (420).
If these are the ONLY formats supported, then it is NOT possible to write NV12 directly to memory. Am I correct? Please give us a clear cut answer.
Is T_Y8_U8V8_N420 etc not supported by hardware or not exposed to users? We would like to test and implement NV12 support if the hardware supports it.
I beg to differ. From what I have observed, the video encoder plugins (or any gstreamer plugin from nvidia) uses NV12 or I420 format. List of some of the plugins that use NV12:
It would be immensely helpful to be able to capture NV12 directly to memory as this would reduce a lot of additional overhead required to convert YUV422 to YUV420 in userspace. Not just for me, but for any TK1 user interfacing a CSI camera which can output YUV422.
Of course, if the VI hardware does not have the functionality to write NV12 directly to memory, then there would be no other choice but to convert YUV422 to YUV420 in userspace using nvvidconv. The TRM is a bit confusing and gave us the opinion that the hardware was capable. Kindly clarify this confusion.