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.

TDA2: VYUY format to YUYV or UYVY or YUV420SP Color Conversion

Part Number: TDA2

Hi,

We have used the VSDK 3.04.

I know converting YUYV to UYVY or YUV420SP, UYVY to YUYV or YUV420SP in VSDK.

But I don't know converting VYUY to UYVY or YUV420SP, VYUY to YUYV or YUV420SP in VSDK

The color format input from our Camera is VYUY.

So we want to convert VYUY color format to YUYV or UYVY or YUV420SP using VPE for display.

Please Let me know how to  convert VYUY color format to YUYV or UYVY or YUV420SP.

Regards,

JP Park

  • As far as I know this is not possible. Let me check this again once more if by using VPDMA we can swap these bytes.

  • Hi Sivaraj

    Thank you for your quick response.
    Please Let us know if you can use VPDMA to swap this byte or not.

    I have tried to test it after modifying as below.
    chains_common_vision.c
    : pInprms->dataFormat = SYSTEM_DF_YUV422I_VYUY;
    : pOutprms->dataFormat = SYSTEM_DF_YUV422I_YUYV;

    vpscore_vip.c
    if (FVID2_DF_YUV422I_VYUY == pathObj->srcColorSpace)
    {
    /* Special handling for 420SP and 422SP only for UV order.
    * Y and UV channel swap will be done in
    * VpsCore_vipPathCheck422SPOut() */
    if (FVID2_DF_YUV422I_YUYV == pathObj->dstColorSpace[strm])
    {
    pathObj->dstColorSpace[strm] = FVID2_DF_YUV422I_YVYU; -> FVID2_DF_YUV422I_YUYV : modify
    }
    However, it has not been converted to the normal color format.

    Regards,
    JP Park
  • Can you test once again without changing any driver and just by setting output data format to FVID2_DF_YUV422I_VYUY?
    VIP assumes 8-bit data to come in as U0 Y0 V1 Y1. When we select FVID2_DF_YUV422I_VYUY output format, we typically get V1 Y0 U0 Y1.
    Since your inout is U and V swapped (V0 Y0 U1 Y1), when you do this you should get U1 Y0 V0 Y1. That is 422I_UYVY.
  • Hi Sivaraj

    I have tried to set output data format to FVID2_DF_YUV422I_VYUY but occuerrd format error in display driver.
    So i tried as below.
    if (FVID2_DF_YUV422I_YUYV == pathObj->dstColorSpace[strm])
    {
    pathObj->dstColorSpace[strm] = FVID2_DF_YUV422I_YVYU; -> FVID2_DF_YUV422I_YUYV : modify
    }
    and
    i have tried to modify various format but failed.

    Please give me other infrom solving VYUY input format.
    e2e.ti.com/.../2629593
    Regards,
    JP Park.
  • Park,

    Display does not support this format. First can you check if are you able to capture correct data with the suggested format? Then we need to modify display link to change format accordingly.

    Rgds,
    Brijesh
  • Hi JP,

    I am closing thread due to inactivity. Please open it if you have further questions.

    Rgds,

    Brijesh

  • Hi Brijesh,
    I have tested it with the following modifications, but this problem has not been solved.

    - chains_common_vison.c
    pInstPrm->videoIfMode = SYSTEM_VIFM_SCH_DS_HSYNC_VSYNC;
    pInstPrm->videoIfWidth = SYSTEM_VIFW_8BIT;
    pInstPrm->bufCaptMode = SYSTEM_CAPT_BCM_FRM_DROP;
    pInstPrm->numStream = 1;

    pInprms = &pInstPrm->inParams;

    pInprms->width = captureInWidth;
    pInprms->height = captureInHeight;
    pInprms->dataFormat = SYSTEM_DF_YUV422P;
    pInprms->scanFormat = SYSTEM_SF_PROGRESSIVE;

    for (streamId = 0; streamId < CAPTURE_LINK_MAX_OUTPUT_PER_INST;
    streamId++)
    {
    pOutprms = &pInstPrm->outParams[streamId];
    pOutprms->width = pInprms->width;
    pOutprms->height = pInprms->height;
    pOutprms->dataFormat = SYSTEM_DF_YUV422I_VYUY; //modify
    pOutprms->maxWidth = pOutprms->width;
    pOutprms->maxHeight = pOutprms->height;
    pOutprms->scEnable = FALSE;

    - and modify displayLink_drv.c to avoid display format error
    dssPrms->inFmt.height = pInChInfo->height;
    dssPrms->inFmt.pitch[0u] = pInChInfo->pitch[0];
    dssPrms->inFmt.pitch[1u] = pInChInfo->pitch[1];
    dssPrms->inFmt.pitch[2u] = pInChInfo->pitch[2];
    dssPrms->inFmt.dataFormat = SYSTEM_DF_YUV422I_UYVY; //modify
    //System_Link_Ch_Info_Get_Flag_Data_Format(pInChInfo->flags);
    if(dssPrms->inFmt.dataFormat == SYSTEM_DF_ARGB32_8888)
    {
    /* Convert to equivalent Display format */
    dssPrms->inFmt.dataFormat = SYSTEM_DF_BGRA32_8888;
    }
    dssPrms->inFmt.fieldMerged[0] = FALSE;
    dssPrms->inFmt.scanFormat = FVID2_SF_PROGRESSIVE;
    if (pObj->createArgs.displayScanFormat == SYSTEM_SF_INTERLACED)
    {
    dssPrms->inFmt.fieldMerged[0] = (UInt32)TRUE;
    dssPrms->inFmt.scanFormat = FVID2_SF_INTERLACED;
    }

    Do you support the VYUY format ?

    Regards,
    JP Park.
  • Hi Park,

    It seems to be supported. Can you please dump one capture frame and share it across?

    Rgds,
    Brijesh