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.

Algorithm Wrapper Design Question

Currently, I am trying to finalize an algorithm wrapper for one of my company's clients, and I am not completely certain on which approach would be ideal. So, I am posting this question with the hope that someone who is knowledgeable about the IUNIVERSAL API will give me some additional insight.
One of our algorithms needs to obtain camera sensor images and process those images (one at a time). I had originally wrote the algorithm wrapper to receive the image data via a memory table element. However, now I suspect that, that might not be ideal. So, now I am now considering just passing image data in via an XDM1_BufDesc pointer parameter of the process() method (often named inBufs in T.I.'s code). Is this new (later) approach superior?
It seems that if I use the later approach, I do not need to worry about memory getting moved around (e.g., dealing with image data getting moved in calls to algMoved(), etc.), correct?
Am I missing something?
Is my question clear?

  • For all buffer transfers, I would suggest using buffer descriptors as per XDM1_BufDesc structure . This would allow the codec engine framework to take care of all cache coherence on DSP side. The other arguments InArgs and OutArgs passed to the process call should be used to pass any other arguments (non-pointers). If there are any intermediate buffers you need from your algorithm, you should use the control call that has _Status structure that can contain a buffer descriptor element as part of its structure.

    Prateek

      

  • Prateek,

     

    So, you would recommend using the InBufs and OutBufs arguments of the IUNIVERSAL process() method, instead of using MemTab? (Our image data matrices are rather large.)

     

    Have a great day!

     

    Take care,

    Darwin

  • Hi,

    A rule of thumb:

    1) Any buffers that are shared between ARM and DSP should be transferred using Buffer Descriptor calls. This generally means that ARM is getting these buffers from/to the drivers running on ARM/Linux and sending it to DSP for processing.  Based on what you mentioned, these image buffer is received from sensor talking to Video capture port (VPFE) of DM6446 and then has to send over the DSP for algorithm processing. This would imply this buffer needs to be shared between ARM and DSP and as such should use buffer descriptors InBuf argument. Note, the buffer size should not impact the communication time between ARM and DSP as all the shared buffers are located in DDR2 memory that is visible to both ARM and DSP and the communication is primarily a pointer passing rather than copying of the buffers.

    2) memTab used in XDAIS algorithm is primarily for algorithm's persistent and scratch memory that would be used locally by the algorithm and not shared with the ARM side. If you are not going to share the buffer with ARM side, I would suggest using memTab to allocate the buffer. Note, the realy buffer allocation is done by the Codec Engine framework on the DSP side for all memTab structures. The algorithm communicates its memory requirement to the CE framework using these memTab structures. More information on XDAIS can be found at

    http://tiexpressdsp.com/wiki/index.php?title=XDAIS_Documentation

    Prateek