1).I copy a 320*256 image to DDR2,and processing it with a image binary function,and I found this procesing takes 12ms
while(1)
{
in = MEM_alloc(DDR2,320*256,4);
/*here I use CCS to load data to DDR2*/
TIME_DECODE = 0;
preTime=CLK_getltime();
/*image binary processing,thi is threshold*/
test_binary_image(in,320*256,thi);
curTime=CLK_getltime();
TIME_DECODE=curTime-preTime;
}
2).I copy the same image to L2 SRAM,and procesing it with the same function,it also takes 12ms.
while(1)
{
in = MEM_alloc(IRAM,320*256,4);
/*here I use CCS to load image data to IRAM*/
TIME_DECODE = 0;
preTime=CLK_getltime();
/*image binary processing,thi is threshold*/
test_binary_image(in,320*256,thi);
curTime=CLK_getltime();
TIME_DECODE=curTime-preTime;
}
I suppose the (2) method that data in L2 could take much less time,but actually it's not so.
I use 6431(297MHZ),it takes 12ms in processing a 320*256 image,I can't accept this result.
Do I have some mistake or ignore some details?
/*test_binary_image()function code*/
void test_binary_image(Uint8 *restrict pimg,short w,short h,Uint8 th)
{
int w_h = w * h;
while(w_h--)
{
if(*pimg > th)
*pimg = 0xff;
else
*pimg = 0;
pimg++;
}
}
thx
teddy