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.

一个异常诡异的问题



dm8168的dsp上 进行图像融合  每两个数据帧  运行下面代码

for(icount = 0;icount < totalSize ;icount++)
{

g_dmaTempFastFillBufdsp[icount] =
 g_dmaTempFastFillBuf2dsp[icount] * a  +  g_dmaTempFastFillBufdsp[icount]*(1-a);


}

其中

g_dmaTempFastFillBufdsp和g_dmaTempFastFillBufdsp定义如下

UInt8 g_dmaTempFastFillBuf2dsp[1920*1080  ]= {0};
UInt8 g_dmaTempFastFillBufdsp[1920*1080]= {0};

a在0.01---0.99之间变化

这段代码 dsp做了o2的优化,结果发现,图像的顶部和底部有花瓶  

然后在顶部和底部加入 几万次的多余处理(做运算,但不是实际数据的运算),结果就是正常的。

感觉dsp在优化的时候,在循环的开头几十万次和结尾的几万次 都会发生取值异常