Forums - Improving Performance on aDSP

1 post / 0 new
Improving Performance on aDSP
Callum.Eldridge
Join Date: 21 Jul 14
Posts: 6
Posted: Fri, 2014-07-25 06:19

Hi,

I’m trying to unload some computations onto the aDSP from the main program but am experiencing a massive performance hit (in terms of time) when running computations on the aDSP  when compared to the main processor. I understand that this is because the aDSP trades off clock speed for better performance in other areas but I do not have the knowhow to take advantage of this. This is the code I’m running:

#include <stdio.h>
#include <HAP_farf.h>
#include <video.h>

int video_histogram(const unsigned char* frame,int arrayLength, unsigned int* histarray, int histarrayLength){

int ii;
unsigned short pixelmag;//stores pixel magnitude

for (ii=0; ii<(arrayLength/2); ii++){ //increment through all pixels to fill histarray
pixelmag= frame[2*ii] + (frame[2*ii+1]*256); //convert 2 bytes to unsigned short
histarray[pixelmag]++;
}
return 0;
}

If anyone can give me some tips or even just point me in the direction of some documentation on the subject It would be very much appreciated!

  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.