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.

H.264 HP/BP encoder for C66x memory usage

Other Parts Discussed in Thread: TMS320C6678

Hi,

I am using latest H.264 HP/BP encoder for C66x platform. Independently of configuration each instance of HP or BP encoder requires more than 0x35800 bytes of  Dual access on-chip data memory (IALG_DARAM0) that should be allocated while ALG_create call. As I know it is L2 memory.

Each core of TMS320C6678 DSP has only 0x80000 bytes (512KiB) of L2 memory. It means that I can create not more then 2 instances of encoders per core.

According to http://www.ti.com/lit/ml/sprt598a/sprt598a.pdf it should be possible to run 4 x H.264 encoder+decoder pairs per core that as I see is not reachable because of L2 memory limit.

Am I right? What solutions can you recommend to run more encoders on single core?

Regards,

Andrey Lisnevich

  • Hi Andrey,

    L2 memory is scratch for each process call. So you can allocate same memory for multiple instances. 

    But please make sure to call activate and deactivate functions appropriately while switching b/w instances.

    Regards

    Rama

  • Hi Rama,

    Is all memory tabs allocated in ALG_create call are scratches thus do not require save/restore operations between calls?

    Is this L2 scratch used only in process call or in other calls (i.e. control) too?

    Regards,

    Andrey Lisnevich

  • Andrey,

    In memTab, codec populates the fileds: 

    * memTab->space which is either IALG_EXTERNAL or INTERNAL

    * memTab->attrs: IALG_SCRATCH or PERSISTANT.

    Both of these have to be used to determine the buffer allocation/placement in the framework. What Rama tried to explain is that when the space is set to INTERNAL, the attrs are always of type: SCRATCH. This means that there will not be any persistant L2 memory that codec would need.

    algActivate() and algDeactivate() calls from codec would take care of restoring and storing the context data for a particular channel.

    You can refer to dsp\siu\video\siuVigdkCodecMgr.c to get an understanding of memory management.

    Regards,

    Vivek

  • Hi Vivek,

    Thanks for explanation. No I see that due to limitations more then two H.264 encoders always share L2 memory blocks (scratch) thus I can't execute their "process" calls simultaneously (i.e. when running in separate tasks on single core). They should go one by one.

    Regards,

    Andrey Lisnevich

  • Hi Andrey,

    Encode Process call is blocking call, Encoder does not support call back functions where we can pause one process and do another frame processing.

    Regards

    Rama