we use an i.Mx35 and have to display a video from a camera without wasting cpu cycles. There are two examples provided in freescales BSP CAMAPP and TVIN. Both use DirectDraw and overlay to show the picture. But they still use a memcpy() to copy every line seperate into the overlay buffer.
from CameraWindow.cpp line 671 in CAMAPP example:
// If height in bmiHeader is negative, the image is top-up, we just copy it.
// Or esle the captured image should be bottom-up, so we vertically flip the image.
if(pCamWin->m_PreviewDataFormat.VideoInfoHeader.bmiHeader.biHeight < 0)
for (height = 0; height < displayHeight; height++)
memcpy(pbyDstBuffer,pbySrcBuffer,(displayWidth * pCamWin->m_ibiBitCount) / 8);
pbySrcBuffer += (pCamWin->m_DisplayInfo.imageWidth * pCamWin->m_ibiBitCount) / 8;
pbyDstBuffer += (displayWidth * pCamWin->m_ibiBitCount) / 8;
can anyone tell me if it is possible to do this using dma or another cpu cycles saving technique ? An example would be great..
I am afraid the using memcpy() function is most suitable approach, assuming
that memcpy() is highly optimized.
Next, I do not think that SDMA using provides improvements in comparison
with standard memcpy() function, which applies ARM instructions LDM/STM.
And SDMA-based design will require additional efforts.
So as the IPU has an own DMA controller... is there no chance to simply configure the IPU to do the job without occupying the cpu ? ATM we use WinCE 6 (with an ARM4 compiler). So a memcpy will not use the latest arm instructions.