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.

Large CPU load

There is an example on Wikipedia (thanks a lot to  Bernie Thompson!) . If we use the sample code at EVM6437 then load the processor more than 90 percent. There is some way to a much reduced CPU load?
----------------------------------------------------------------------------------------------------------------------------

  while (!done && status == 0) {

    FVID_exchange(hGioVpfeCcdc, &frameBuffPtr);

    process_imagebw( (void*)(frameBuffPtr->frame.frameBufferPtr), 480, 720);

    BCACHE_wbInv((void*)(frameBuffPtr->frame.frameBufferPtr), 480*720*2, 1);

    FVID_exchange(hGioVpbeVid0, &frameBuffPtr);

  }

 

void process_imagebw( void* currentFrame,  int yRows, int xPixels)

{

  

int xx = 0; 

for( xx = 0; xx < (yRows * xPixels)*2; xx++ )//just operating on the chroma

    {

      *( ( (unsigned char*)currentFrame ) + xx ) = 0x80;

      xx++;      

      *( ( (unsigned char*)currentFrame ) + xx ) = 255 - *( ( (unsigned char*)currentFrame ) + xx ) ;

 

     }      

} // End process_imagebw()

 -------------------------------------------------------------------------------------------------------------

It would be very interesting to know how this examle will load 6446, 6467.

  • Igor said:
    There is some way to a much reduced CPU load?

    The first way to reduce CPU load would be to enable full optimization (-o3), I believe I left this disabled by default in the project on the wiki because it is easier to step through and debug without the optimization.

    The second way would be to optimize the memory mapping, this is a bit more complex to do but if you could put the processing code into internal memory (using pragmas) that would probably help to improve performance as well.

    To go even further would be to find a way to use some intrinsics to accelerate the processing loop.

    Igor said:
    It would be very interesting to know how this examle will load 6446, 6467.

    The example would load a DM6446 or DM6467 about the same because the they all use the same C64x+ core, it is just a matter of relative frequency and memory bandwidth. Of course keep in mind that the DM6446 and DM6467 are ARM based devices so there is no video driver for the C64x+ on them, thus the example would not be able to run properly directly on them.

  • Mr. Thompson, thanks a lot for replay. I foggot about full optimization (-o3). You are right!