现在写了一个函数,是一个480*640的二重循环,处理图象的
按F10单部运行的时候经常跑飞掉,然后提示Illegal opcode (xxxxxxxx) at pc = yyyyyyyy,xxxxxxxx是yyyyyyyy地址处的操作码,用Mixed ASM/Source查看,发现此处的汇编语句变成了 .word xxxxxxxx
不知道这个语句是干什么的,总之到了这里就出错了
我的编译选项完全没有修改,保持了 -g ,没有选择 -oN(N=1,2,3)
=================================
该函数代码如下
void GaussianFilter3x3 ( WORD pR1[ ][IMAGEWIDTH], WORD pG1[ ][IMAGEWIDTH], WORD pB1[ ][IMAGEWIDTH], WORD WR1[ ][IMAGEWIDTH], WORD WG1[ ][IMAGEWIDTH], WORD WB1[ ][IMAGEWIDTH] ) { volatile int i,j; unsigned int temp;
for(j=1;j<479;j++) for(i=1;i<639;i++ ) { //if(pR1[j] == 0)// skip暗点 if(pR1[j] < MIN) { continue; } else { temp = pR1[j-1][i-1]*Table_Gau3x3[0][0] +pR1[j-1]*Table_Gau3x3[0][1] +pR1[j-1][i+1]*Table_Gau3x3[0][2] +pR1[j][i-1]*Table_Gau3x3[1][0] +pR1[j]*Table_Gau3x3[1][1] +pR1[j][i+1]*Table_Gau3x3[1][2] +pR1[j+1][i-1]*Table_Gau3x3[2][0] +pR1[j+1]*Table_Gau3x3[2][1] +pR1[j+1][i+1]*Table_Gau3x3[2][2];
WR1[j]=temp>>16; temp = pG1[j-1][i-1]*Table_Gau3x3[0][0] +pG1[j-1]*Table_Gau3x3[0][1] +pG1[j-1][i+1]*Table_Gau3x3[0][2] +pG1[j][i-1]*Table_Gau3x3[1][0] +pG1[j]*Table_Gau3x3[1][1] +pG1[j][i+1]*Table_Gau3x3[1][2] +pG1[j+1][i-1]*Table_Gau3x3[2][0] +pG1[j+1]*Table_Gau3x3[2][1] +pG1[j+1][i+1]*Table_Gau3x3[2][2];
WG1[j]=temp>>16;
temp = pB1[j-1][i-1]*Table_Gau3x3[0][0] +pB1[j-1]*Table_Gau3x3[0][1] +pB1[j-1][i+1]*Table_Gau3x3[0][2] +pB1[j][i-1]*Table_Gau3x3[1][0] +pB1[j]*Table_Gau3x3[1][1] +pB1[j][i+1]*Table_Gau3x3[1][2] +pB1[j+1][i-1]*Table_Gau3x3[2][0] +pB1[j+1]*Table_Gau3x3[2][1] +pB1[j+1][i+1]*Table_Gau3x3[2][2];
WB1[j]=temp>>16; } } } 就是一个3×3的Gaussian滤波器,请各位大侠帮助看一下吧,卡了好几天了啊 |