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.

TDA2PXEVM: HDR 16/20bit companded sensors can be supported in current Vision SDK?

Part Number: TDA2PXEVM

Hi,

I'm evaluating Onsemi HDR sensor which has output of HDR 20bit companded data.
But I am not sure it can be supported in current vision sdk v3.4.

The iss configuration was
pUcObj->IssM2mIspPrm.channelParams[0].operatingMode = ISSM2MISP_LINK_OPMODE_1PASS_WDR;
pUcObj->IssM2mIspPrm.channelParams[0].inBpp = SYSTEM_BPP_BITS12;
pUcObj->IssM2mIspPrm.channelParams[0].decmpBpp = SYSTEM_BPP_BITS20;


The "decmpBpp" was defined as below in issM2mIspLink.h.
I assume "decmpBpp" is the de-companded output resolution and iss input resolution as well.  But it was not used at any source codes including vision sdk and TI driver.

System_BitsPerPixel decmpBpp;
/**< Input Bits per pixel after decompaning
* - Only valid in 16-bit WDR and 20-bit WDR mode
* - Ignored in 12-bit linear mode
*/

Can you confirm that vision sdk can support HDR 20bit companded to 12bit sensors?
If it can support one, please let me know how to setup parameters.

Regards,
HJ Kim

  • Vision SDK supports 12->20 decompanding. Please refer to some of the sensors supported in SDK. A couple of examples are OV10640 and AR0143.

  • Hi Kim,

    You may take a look at this folder: "vision_sdk\apps\src\rtos\iss\src\sensor\ov10640\dcc_xml\OnePassWdr" and refer to the TDA3 ISS TRM.
    The ISS parameters are controlled by files under this folder.
  • Hi Gang,

    I have gone through related source codes including dcc xml files of OV10640 and AR0143, but I'm not sure Vision SDK can support 16/20bit de-companding.

    1.
    There are 12-16/20bit de-companding LUT/PWL of OV10640/AR0143 for 2PassWdr.
    But they are only dcc_xml files, and no real header files. Only 1PassWdr and linear mode header files exist.
    If 2PassWdr is selected, linear mode will be finally selected at sensor driver codes.

    2.
    For 1PassWdr mode of OV10640/AR0143,
    the resolution of LUT/ PWL is not 12-16/20bit but only 12-12bit.
    If it can support 12-16/20bit decompanding, their output of decompanding LUT/PWL should have 16/20bit but they aren't.
    Please refer to the following graph made from vision_sdk\apps\src\rtos\iss\src\sensor\ov10640\dcc_xml\OnePassWdr\OV10640_ipipeif_split_dcc.xml


    3.
    The "decmpBpp" may be used for selecting 16 or 20bit of decompanding output resolution.
    But "decmpBpp" is not used at any source codes. So there are no ways to select the output resolution of decompanding.
    If decompanding output is always 20bit as TDA2Px TRM, decompanding LUT/PWL output should have 20bit resolution but there are only 12bit in vision sdk as commented 2.

    I have tested isp 1/2PassWdr LUT/PWL with sensor of AR0323 20-12bit companded, but only 1PassWdr with 12-12bit LUT or PWL decompanding is working. If its value is greater than 12bit (4095), output data is saturated.

    Please review your current vision sdk can support 12-16/20bit decompanding.

  • Hi Kim,

    For both TwoPassWdr mode and the OnePassWdr mode, the xml files in those folders shall be converted to C header files by running the "generate_dcc.bat" file.
    Please take a look at this batch file to see the command line parameter required.

    For OnePassWdr mode, the decompanding IPIPEIF LUT shall be a 12-bit to 12-bit mapping which includes sensor decompanding (12-bit to 20-bit), black level, and 20-bit to 12-bit re-compression with a gamma (power) law.
    This is required for using the 12-bit NSF3 and LSC on the 12-bit re-compressed WDR raw image.
    At a later stage of ISP, you will need to invert the re-compression gamma law (completely or partially) in IPIPE (after WDR local tone mapping).

    Vision SDK supports user's programming of the IPIPEIF LUT as well as other ISP parameters such as NSF3, LSC, IPIPE gamma,etc.
    Users may change those ISP parameters by editing the corresponding xml files and running "generate_dcc.bat" to get a C header file.
    Then, Vision SDK shall be re-compiled to include the change in the new header file.

    Best,
    Gang

  • Hi Gang,

    I understand that xml files can be converted to C header files.
    My concern is not about it but that current vision sdk can support only 12bit not 16/20bit for 1PassWDR and 2PassWDR is not working.

    I think that 12bit is not sufficient for the input of WDR/GLBCE and at least 16bit is required for one.
    And ISP main imaging pipeline and WDR/GLBCE can support 16bit in ISP6.5.

    In case of 1PassWDR, pixel resolution is set to 12bit. Only 12bit sensor input may be working for 1PassWDR.
    Please refer the related codes in vision_sdk\links_fw\src\rtos\links_ipu\iss_m2misp\issM2mIspLink_drv_create_delete.c

        /* Saturation configuration needed only in case of WDR */
        {
            System_BitsPerPixel inBpp;
            UInt32 sat = 0U;
    
            pPassCfg->satCfg.vportSatCfg.enable = (UInt32)TRUE;
            pPassCfg->satCfg.vportSatCfg.dcClmp = 0;
    
            inBpp = pCreatePrms->channelParams[chId].inBpp;
    
            /* by default assume 12-bits */
            if ((inBpp==SYSTEM_BPP_BITS12) ||
                (inBpp==SYSTEM_BPP_BITS12_PACKED_MIPI))
            {
                sat = (UInt32)0xFFFU;
            }
            else if(inBpp==SYSTEM_BPP_BITS10)
            {
                sat = (UInt32)0x3FFU;
            }
            else if(inBpp==SYSTEM_BPP_BITS14)
            {
                sat = (UInt32)0x3FFFU;
            }
            else
            {
                UTILS_assert((Bool)0U);
            }
    
            if(operatingMode == ISSM2MISP_LINK_OPMODE_2PASS_WDR)
            {
                if (passId == ISSM2MISP_LINK_FIRST_PASS)
                {
                    pPassCfg->satCfg.vportSatCfg.sat = sat * pChObj->expRatio;
                    pPassCfg->satCfg.vportSatCfg.dsf = pChObj->evRatio;
                }
                else
                {
                    pPassCfg->satCfg.vportSatCfg.sat = (UInt32)sat;
                    pPassCfg->satCfg.vportSatCfg.dsf = (UInt32)0U;
                }
            }
            else if(operatingMode == ISSM2MISP_LINK_OPMODE_1PASS_WDR)
            {
                pPassCfg->satCfg.vportSatCfg.sat = (UInt32)0xFFFU;
                pPassCfg->satCfg.vportSatCfg.dsf = (UInt32)0U;
                pPassCfg->satCfg.vportSatCfg.enable = (UInt32)TRUE;
            }
            else if((operatingMode == ISSM2MISP_LINK_OPMODE_12BIT_LINEAR) ||
                    (operatingMode ==
                        ISSM2MISP_LINK_OPMODE_2PASS_WDR_LINE_INTERLEAVED) ||
                    (operatingMode == ISSM2MISP_LINK_OPMODE_12BIT_MONOCHROME))
            {
                /* Saturation need to be disabled for 12bit linear mode or
                    monochrome mode,
                    No need to enable Saturation even for 20bit wdr line
                    interleaved since input image contains short and long
                    independent channels */
                pPassCfg->satCfg.vportSatCfg.enable = (UInt32)FALSE;
                pPassCfg->satCfg.vportSatCfg.sat = (UInt32)sat;
                pPassCfg->satCfg.vportSatCfg.dsf = (UInt32)0;
            }
            else
            {
                UTILS_assert((Bool)0U);
            }
        }


    Regards,
    HJ Kim

  • Hi Kim,

    For 1PassWdr mode, the 12-bit sensor input we recommend to re-compressed to 12-bit with gamma power curve so that 12-bit NSF3 and LSC can work on it in a single pass.
    TI's imaging 3rd parties and customers have already used that re-compression with 12-bit companded sensor raw image (with 20b dynamic range) or even without the re-compression (i.e., working directly on sensor companded 12-bit raw image) when sensor supports LSC inside.
    The basic idea is that the sensor input is already compressed down to 12-bit with very limited loss in quality and ISP noise filter, LSC, DPC, ... can work directly on the same 12-bit image with very limited loss in quality.
    Then, GLBCE is able to apply local tone mapping effectively on companded/compressed 12-bit image and achieve the same quality as decompanding to 16-bit first and then use GLBCE (because the raw input is already compressed down to 12-bit by sensor).

    There may be some difficulty in tuning the noise filter, global/local tone mapping and TI's 3rd imaging parties have done that successfully for automotive customers in case you need any help.

    For 2PassWdr mode, it should work in SDK and may eventually give slightly better image quality and a little bit easier to control or tune for high-end applications.
    The difficulty is that the ISP throughput is halved and more DDR traffic is required.
    Therefore, it is mostly used for high-end applications with higher requirements on control/quality and higher system performance.

    I am not sure what you mean by "2PassWDR is not working".
    As far as I know, vision SDK S/W supports the 2-pass data flow and only ISP tuning needs to be done for any particular sensor.

    Best,
    Gang

    2PassWDR is not working

  • Hi Gang,

    Thank you for your detailed description.

    Will this scheme, 12-12bit decompanding for 1PassWDR, be same or changed to 12-20bit in TDA4?
    Our main concern may be for TDA4.

    Regards,
    HJ Kim
  • Hi Kim,

    TDA4 is more flexible and programmable.
    It supports 16-bit raw image processing.
    Detailed information is under NDA and cannot be disclosed in public forum.

    Best,
    Gang