This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA2P-ACD: UYVY 10bit support in csi2CalMultiCam_View usecase

Part Number: TDA2P-ACD


Hi,

I'm currently using 2MP camera sensor for csi2CalMultiCam_View usecase (in VisionSDK3.2).

The YUV stream format from the sensor is like below - each components have 10 bits:

To support this stream, I changed inCsi2DataFormat to VPS_ISS_CAL_CSI2_YUV422_10B (0x1F) and extract type to VPS_ISS_CAL_PIX_EXRCT_B10_MIPI but I'm not getting correct image (all greeny image).

Do I need to change other things to get the correct image from the stream above?

When we change the camera sensor to use 8 bits (instead of 10 bits) we can see the image correctly.

Regards,

James

  • Hi James,

    Please note that when you capture 10bit yuv output, it will be stored in the 16bit container. CAL cannot convert 10bit to 8bit output and stored it as YUV422 8b. So can you please first check if the captured image is correct by looking into pixel values in some hex viewer? it should have exactly 10bits per component.

    Regards,

    Brijesh

  • Hi Brijesh,

    Thanks for the input. 

    I'm attaching a frame dump file.

    It is captured right before sending the frame to QNX screen (we are using InfoADAS2.6).

    I assume:

    Byte0: 0x01 -> CB1[9:2]

    Byte1: 0x80 -> Y1[9:2]

    Byte2: 0x01 -> CR2[9:2]

    Byte3: 0x80 -> Y2[9:2]

    Byte4: 0x11 -> LSB (CB1[1:0], Y1[1:0], CR2[1:0], Y2[1:0])

    Do you see any issues in displaying this format?

    Regards,

    James

  • Hi James,

    If the Pixel extract module is enabled, output from the CAL is not stored in this format. The extract module will extract pixel data from MIPI format and convert into linear format. So the output should be stored in

    Cb[15:0] with lower 10bits valid and upper 6 bits 0

    Y[15:0] with lower 10bits valid and upper 6 bits 0

    Cr[15:0] with lower 10bits valid and upper 6 bits 0

    Y[15:0] with lower 10bits valid and upper 6 bits 0

    If this is not how output you are getting, either extract module is not enabled or input is not in 10bit MIPI format. Can you share the CAL register to check? I am interested in register CAL_PIX_PROC_i (0x5201 20C0 + (0x4 * i)).

    This is where we enable pixel extract module.

    Regards,

    Brijesh

  • Hi Brijesh,

    Here's the register dump for CAL_PIX_PROC_i when we capture the video frame.

    I think the extract module is enabled and extract in 10 bit MIPI (0x4), pack in 16 bit (0x5).

    Regards,

    James

  • Hi James,

    From the register,

    Pixel Processing Context0 = 1
    CPortID = 1
    Packing = 16bit
    Extract Bits[4:1] = 16-bit (little endian) = bypass

    It looks like extract is not enabled for MIPI 10 bit. Can you please try changing this register.

    Regards,
    Brijesh
  • Hi Brijesh,

    After changing extract to 10 bit MIPI (Extract Bits[4:1] = 0x4) we got frame dump as below:

    It seems it's an 8 bit container (not 16 bit)?

    Byte 0: 0x0F  -> U

    Byte 1: 0x02  -> Y

    Byte 2: 0xD1  -> V

    Byte 3: 0x01  -> Y

    And the image is not shown correctly still.

    Any ideas on it?

    Regards,

    James

  • Hi James,

    This seems like a 16 bit container. I believe the source is 10 bit and as you can see the data Byte even & Byte odd dosen't exceed 10 bits.
    To confirm if the video is received correctly, view the dumped image in PC YUV viewer.

    The issue is we cannot display 10 bit YUV. you will have to convert from 10 b to 8 bit.

    Regards,
    Sujith
  • Hi James,

    It looks like capture data is correct. every odd byte value does not exceed 0x3, so it looks like it is capturing 10bit data in 16bit container. But how are you viewing it? I think there is no viewer to view this 10bit YUV422 data. Also Display supports 8bit yuv data, it cannot display this format. You need to convert it into 8bit in order to display this frame.

    To confirm if the received data is correct, can you enable some internal test pattern in the sensor and check the received data? If this matches, CAL is able to receive data correctly. 

    Rgds,

    Brijesh

  • Hi Sujith, Brijesh,

    Then, does it mean it's the limitation of our Display subsystem - 10 bits YUV422 stream can be received by CAL correctly but no ways to display it?
    I could not find a PC viewer to display this format correctly neither. Then what's the reason we use 10 bits YUV422 format?

    And could you let me know how to convert it to 8 bit in VisionSDK (any reference codes or use cases)?
    Does it mean we will sacrifice image quality by converting 10 bit data to 8 bit?

    Regards,
    James
  • Hi James,

    Please provide the image, i can check. 8 bit is a limitation of DSS.
    Currently there are no algo available for this conversion, let me check if we have any DSP/EVE based kernels for same.

    Regards,
    Sujith
  • Hi Sujith,

    The image was sent through separate mail.

    If it's the limitation of DSS itself, do you know the reason we cannot find a PC tool to display the 10bit YUV422 image?
    Is it just because 10bit YUV422 is not a commonly used format?

    Regards,
    James
  • Hi James,

    I converted your image into 8bit and checked it. It looked fine, may be out of focus slightly and width is 960 instead of 1920. So can you please check your sensor configuration? If it is configured correctly for 1920 width, please check CAL write DMA configuration to see if width is setup correctly.

    Rgds,
    Brijesh
  • Hi Brijesh,

    I'll check the  width setting and let you know.

    In the meantime, could you give answers for my previous questions - can we convert this 10 bit format to 8 bit in  VisionSDK?

    Even though we could convert it to  8bit, it will give image quality degradation and if it's the case we don't have valid reason to use 10 bit format.

    Regards,

    James

  • Hi James,

    Its really depends on the your usecase. You get the 10bit YUV data that you can process on EVE/DSP. Since bitdepth is higher, the algorithm might get better results. But just before getting it to the display, we need to convert into the 8bit, since display supports only 8bit per component.

    As far as i know, VSDK does not support any algo to convert 10bit to 8bit.

    Regards,
    Brijesh
  • Hi James,

    Let us know if we can close this thread..

    Regards,
    Brijesh
  • Hi Brijesh,

    Since there are no explicit needs for 10 bit YUV we decided to move to 8 bit.

    Let's close the thread.

    Thanks for your help.

    Regards,

    James