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.

TIDL Input and Output buffer questions

Part Number: tda2x

hi,

I am reading the tidlLink_algPlugin.c file in D:\PROCESSOR_SDK_VISION_03_07_00_00\vision_sdk\apps\src\rtos\alg_plugins\tidl directory,  in this file there are two functions confusing me,

static Int32 tidlIsInDataBuff(
                    sTIDL_Network_t *pTIDLNetStructure,
                    Int32 dataId,
                    Int32 layersGroupId)
{
    Int32 i, j;

    for(i = 0 ; i < pTIDLNetStructure->numLayers; i++)
    {
        for(j = 0; j < pTIDLNetStructure->TIDLLayers[i].numInBufs; j++)
        {
            if((pTIDLNetStructure->TIDLLayers[i].layersGroupId == layersGroupId) &&
               (pTIDLNetStructure->TIDLLayers[i].inData[j].dataId == dataId))
            {
                return 1;
            }
        }
    }

    return 0;
}

static Int32 tidlIsOutDataBuff(
                        sTIDL_Network_t *pTIDLNetStructure,
                        Int32 dataId,
                        Int32 layersGroupId)
{
    Int32 i,j;

    for(i = 0 ; i < pTIDLNetStructure->numLayers; i++)
    {
        for(j = 0; j < pTIDLNetStructure->TIDLLayers[i].numInBufs; j++)
        {
            if((pTIDLNetStructure->TIDLLayers[i].layersGroupId != layersGroupId) &&
               (pTIDLNetStructure->TIDLLayers[i].inData[j].dataId == dataId))
            {
                return 1;
            }
        }
    }

    return 0;
}

In those two funcions I don't kwnow the roles TIDLLayers[i].layersGroupId and layersGroupId played in finding

the input and output buffers, and in tidlIsOutDataBuff() function why TIDLLayers[i].inData[j].dataId is used

instead of TIDLLayers[i].outData[j].dataId ?

Could you explain it in detail?

Thanks

  • Hi,

    The main idea of these functions to find whether the current layer is input (first) data layer or output (last) data layer, if so TIDL will not allocate the buffers for these layers and expect the application to allocate buffers for these layers, so these functions will be helpful here.

    The condition for layersGroupId is because of this vaule is zero for both input and output data buffers, and is non zero for other intermediate layers, please refer to TIDL user guide FAQ 21 and 22 for more details about this parameter. 

    >>  In tidlIsOutDataBuff() function why TIDLLayers[i].inData[j].dataId is used instead of TIDLLayers[i].outData[j].dataId ?

    This  function will check the current buffer is the final output data buffer or not, that means we have to check is this buffer is used as input to any layer or not, so if it is used means it is not the final output data buffer and if it is not used then this will be final output data buffer. So, we have to check the curr output buff dataID against the input data Id of other layers.   

    Hope this clarifies.

    Thanks,

    Praveen