Definition at line 1065 of file KfrMotionExtractor.h. References GetMotionError16(), and MAX_DISP. 01066 { 01067 int minerror; 01068 int curX, curY; 01069 int error, oX, oY; 01070 int sx, sy; 01071 01072 int i, j; 01073 unsigned char * block; 01074 block = desframe + * cy * framewidth + * cx; 01075 01076 // first 01077 oX = curX = * cx; 01078 oY = curY = * cy; 01079 if (curX < 0 || curX > framewidth - 16|| curY < 0 || curY > frameheight - 16) 01080 { 01081 * cx = * cy = 0; 01082 return -1; 01083 } 01084 minerror = GetMotionError16(refframe, block, framewidth, curX, curY); 01085 01086 for (i = 1; i <= MAX_DISP; i ++) 01087 { 01088 sx = sy = -i; 01089 for (j = 0; j < 8 * i; j ++) 01090 { 01091 curX = oX + sx; 01092 curY = oY + sy; 01093 01094 if (!(curX < 0 || curX > framewidth - 16|| curY < 0 || curY > frameheight - 16)) 01095 { 01096 error = GetMotionError16(refframe, block, framewidth, curX, curY); 01097 if (error < minerror) 01098 { 01099 minerror = error; 01100 * cx = curX; 01101 * cy = curY; 01102 } 01103 } 01104 01105 if (j < 2 * i) sx++; 01106 else if (j < 4 * i) sy++; 01107 else if (j < 6 * i) sx--; 01108 else sy--; 01109 } 01110 } 01111 01112 return minerror; 01113 01114 }
Here is the call graph for this function:
|