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.

Multiple H264 codec best practices



Is the DSP able to execute multiple codec processing calls concurrently?  Am I better off with 4 threads compressing 4 channels of video or a single thread doing them serially?

  • I gave it a shot both ways.  I set up 4 threads, each waiting on a fifo queue (dmai), and filled those queues from another thread.

    In the multi-threaded version, occasionally I would see data from another camera.  This tells me that either Dmai's Fifo implementation is not thread safe or the codec / codec engine is not thread safe.

    Considering that if the fifo was broken that I'd crash and burn hard, I'm guessing that it is the codec / engine itself.  :-/ 

  • I just went through the Dmai fifo code.  It's using pipe(), in which, according to limits.h, reads and writes up to 4096 bytes are guaranteed to be atomic.  Since the fifo implementation is writing 4 byte memory addresses, this is in the clear.

    I guess the codec can't handle this.  :-/