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.

RTOS/TDA2PXEVM: Change dataformat to RGB888

Part Number: TDA2PXEVM

Tool/software: TI-RTOS

Hi,

I'm using VisionSDK 3.5 and TDA2PX EVM.

I have created usecase network_rx->decode->Alg_plugin->display. But dataformat needed for my Alg_plugin is RGB888 as it processes each channel separately.

Is there any way change dataformat of video to RGB888 using VPE or something?

If so, can you please help me with the changes needed to be done to change dataformat to RGB888?

  • Hi,

    Yes, you could definitely use VPE link to convert from YUV to RGB format, but please note that RGB is in interleaved format. You need to convert them into planar..

    Rgds,
    Brijesh
  • Hi Brijesh,
    Thanks for the quick reply.

    Can you please tell me what should be modified to change interleaved format to planar?

    Can you suggest any existing usecase for reference ?
  • Megha,

    In Vision SDK, there is no existing code/module, which can convert interleaved to planar format.. You will have to add it. I think you could use EDMA for the same.

    Rgds,
    Brijesh
  • Hi Megha,

    Since there is no further update on this thread, i am closing it. Please reopen it if you further help.

    Rgds,
    Brijesh
  • Hi,

    When I changed data format such as chPrms->outParams[outId].dataFormat = SYSTEM_DF_RGB24_888 in setVPE params I got following assertion:

    15.166748 s: Chains: Using TCP/IP
    [IPU1-0]     15.170804 s:
    [IPU1-0]  **** displayWidth and DisplayHeight : 1920 1080
    [IPU1-0]     15.172146 s:  IPC_IN_0   : Create in progress !!!
    [IPU1-0]     15.173153 s:  IPC_IN_0   : Create Done !!!
    [IPU1-0]     15.173336 s:  DECODE: Create in progress ... !!!
    [IPU1-0]     15.210974 s:  DECODE: Creating CH0 of 640 x 480 [1] [0],target bitrate = 10000 Kbps ...
    [IPU1-0]     15.211797 s:  DECODE: All CH Create ... DONE !!!
    [IPU1-0]     15.213749 s:  DECODE: Create ... DONE !!!
    [IPU1-0]     15.214115 s:  VPE: Create in progress !!!
    [IPU1-0]     15.326907 s:  VPE: Loading Down-scaling Co-effs
    [IPU1-0]     15.327121 s:  VPE: Co-effs Loading ... DONE !!!
    [IPU1-0]     15.327334 s:  VPE: Create Done !!!
    [IPU1-0]     15.327700 s:  DISPLAY: Create in progress !!!
    [IPU1-0]     15.328036 s: hal/src/vpshal_dssDispcVid.c @ Line 1023:
    [IPU1-0]     15.328127 s: Invalid Data format
    [IPU1-0]     15.328249 s: dispdrv/src/vpsdrv_displayCore.c @ Line 304:
    [IPU1-0]     15.328341 s: Set DSS parameter failed
    [IPU1-0]     15.328402 s:  Assertion @ Line: 463 in displayLink_drv.c: status==SYSTEM_LINK_STATUS_SOK : failed !!!
    [IPU1-0]     15.328890 s:  Assertion @ Line: 463 in displayLink_drv.c: status==SYSTEM_LINK_STATUS_SOK : failed !!!
    [HOST  ]     15.171872 s:  NETWORK_RX: NETWORK_RX: Server listening (port=29171) !!!
    [HOST  ]     15.172024 s:  IPC_OUT_0   : Create in progress !!!
    [HOST  ]     15.172055 s:  IPC_OUT_0   : Create Done !!!

    Do I need to do some other changes? Could you please tell me how to resolve it?

    Thanks ,

    Megha Ambekar

  • Hi Megha,

    It seems there is a format mismatch between VPE and display.  VPE supports RGB24 whereas display supports BGR.

    for the time being, can you change below in the display link?

    if(dssPrms->inFmt.dataFormat == SYSTEM_DF_ARGB32_8888)
    {
    /* Convert to equivalent Display format */
    dssPrms->inFmt.dataFormat = SYSTEM_DF_BGRA32_8888;
    }

    to 

    if(dssPrms->inFmt.dataFormat == SYSTEM_DF_ARGB32_8888)
    {
    /* Convert to equivalent Display format */
    dssPrms->inFmt.dataFormat = SYSTEM_DF_BGRA32_8888;
    }

    if(dssPrms->inFmt.dataFormat == SYSTEM_DF_RGB24_888)
    {
    /* Convert to equivalent Display format */
    dssPrms->inFmt.dataFormat = SYSTEM_DF_BGR24_888;
    }

    in the DisplayLink_drvDisplayCreate in the file vision_sdk\links_fw\src\rtos\links_ipu\display\displayLink_drv.c

    Rgds,

    Brijesh

    Rgds,

    Brijesh

  • Hi Brijesh,

    Thanks for the quick reply.

    After doing modifications suggested by you, the use-case worked without any assertion. Only problem is colors in output video are getting swapped means blue instead of red and vice-versa. I'm attaching original video screenshot and output screenshot.

    How should I proceed to get original video colors at output without getting blue and red colors swapped?

  • Megha,

    This was expected, since the output formats are incompatible between VPE and DSS.
    I think we can change CSC, either in DSS or in VPE to fix this issue.
    Let me get back to with the changes.

    Rgds,
    Brijesh
  • Megha,

    Can you try changing data type

    /* Even for YUV444 we need to use RGB888 data type */
    case FVID2_DF_YUV444I:
    case FVID2_DF_RGB24_888:
    /* Note: The R and B lines are connected to B and R ports of
    * VPDMA. Hence need to use BGR datatype to capture RGB data and
    * viceversa.
    * Same applies for YUV444 output as well - Y and V are
    * swapped. */
    chObj->vpdmaDataType[0U] = VPSHAL_VPDMA_CHANDT_BGR888;
    break;

    to

    /* Even for YUV444 we need to use RGB888 data type */
    case FVID2_DF_YUV444I:
    case FVID2_DF_RGB24_888:
    /* Note: The R and B lines are connected to B and R ports of
    * VPDMA. Hence need to use BGR datatype to capture RGB data and
    * viceversa.
    * Same applies for YUV444 output as well - Y and V are
    * swapped. */
    chObj->vpdmaDataType[0U] = VPSHAL_VPDMA_CHANDT_RGB888;
    break;

    in Vcore_vwbSetFormat API in the file ti_components\drivers\pdk_01_08_01_00\packages\ti\drv\vps\src\vpslib\vpecore\src\vpscore_vpeWb.c?

    Rgds,
    Brijesh
  • Hi Brijesh,

    I have done above modifications and it worked successfully. Now I'm getting exact colors in the output video same as original video.

    Thanks a lots for your help.

    Regards,
    Megha Ambekar.