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.

PROCESSOR-SDK-DRA8X-TDA4X: YUYV422 to YUV420SP conversion

Part Number: PROCESSOR-SDK-DRA8X-TDA4X

Hi,

I want to convert the YUYV422 image coming from camera to YUV420SP (NV12) format. Is it possible through VPAC module ?

We observed that LDC has following option:

Our aim is only to do the format conversion and nothing else.

Please suggest what to do. 

  • Hi Anshuman,

    Yes, LDC can convert from 422 to NV12.

    Please refer to section "1.5.3.11 LDC YUV422 to YUV420 Conversion" in TRM.

    You shall set register field VPAC_LDC_CTRL.OP_DATAMODE to 1 to turn on 422 to 420 conversion.

    Best,

    Gang

  • Hi Gang,

    IN the LDC Node there are multiple parameters,

    VX_API_ENTRY vx_node VX_API_CALL tivxVpacLdcNode(vx_graph graph,
                                          vx_user_data_object  configuration,
                                          vx_matrix            warp_matrix,
                                          vx_user_data_object  region_prms,
                                          vx_user_data_object  mesh_prms,
                                          vx_image             mesh_img,
                                          vx_user_data_object  dcc_db,
                                          vx_image             in_img,
                                          vx_image             out0_img,
                                          vx_image             out1_img)

    Since, my purpose is only to convert the YUV422 toYUV420SP, i will only set the image formats. 

    Can i set all the other parameters to NULL, to fulfil my objective.?

    One more thing, where can i set the register field VPAC_LDC_CTRL.OP_DATAMODE to 1 to turn on 422 to 420 conversion in the SDK. I am unable to find the same.

  • Hi Anshuman,

    The conversion is supported by CSL driver in "csl_ldc.c".

            /* Enable YUV422 to YUV420 conversion */
            if ((cfg->inFmt.dataFormat == FVID2_DF_YUV422I_UYVY) &&
                (cfg->outFmt[0].dataFormat == FVID2_DF_YUV420SP_UV))
            {
                CSL_REG32_FINS(&coreRegs->CTRL, LDC_CORE_CTRL_OP_DATAMODE, 1u);
            }
            else
            {
                CSL_REG32_FINS(&coreRegs->CTRL, LDC_CORE_CTRL_OP_DATAMODE, 0u);
            }
    

    I suppose setting the image formats properly shall work for you.
    Of course, you will need to set the image size correctly.

    You may refer to "vx_vpac_ldc_target.c" if you have any issues in configuring LDC.
    The "create" function there sets many LDC parameters to default values if you provide NULL as input.

    Best,

    Gang