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.

How to decrease cache miss on dm8168 dsp

Hi all:

I develop on dm8168, i write a image rotation alg on dsp side,
the alg in follow steps:
1. for each pixel in one line calculate the new position in frame,
2. for each line get pixel val from input image,
as the pixel is not one after another pixel,miss cache or cache conflict often happens,the alg is poor efficiency,
how to decrease cache miss cache?  

or how to improve alg efficiency

rotation and shift 

void RotImgProgress(
unsigned char * restrict pFrm0,
unsigned char * restrict pOut,
int i_width, int i_height, int stride,
float s_cos0, float s_sin0, float dx0, float dy0,
unsigned char *pInnerBuf,
STB_DMAObj *dmaHandle
)
{

...

for (y = 0; y < i_height; y++)
{
sx = n * y + p - m;
sy = m * y + q + n;

//get new pixels position for current line
GetWrapAddr_asm(OrgAddr, OrgIdx, sx, sy, m, n, (8 << 16) | (i_width - 8), (4 << 16) | (i_height - 4), i_width, i_width);

//generate new line
imgWrap_asm(pFrm0, pBuf[pp], OrgAddr, 0, i_width);

OrgIdx += i_width;
pOut+=i_width;

if(y > 0)
{
Dwait(dmaHandle);
}

//DMA out new line 

STB_TI_DMA_FastStart(dmaHandle, STB_DMA_CH_IN_A);

pp ^= 1;
}
}

best regards