3 #define abs(x) ((x)>0?(x):-(x)) 5 #pragma map call_hw VIRTEX5 0 8 satd(
unsigned char pix[32] ,
int* i_satd_result)
15 diff[0][0] = pix[0] - pix[16];
16 diff[0][1] = pix[1] - pix[17];
17 diff[0][2]= pix[2] - pix[18];
18 diff[0][3] = pix[3] - pix[19];
20 diff[1][0] = pix[4] - pix[20];
21 diff[1][1] = pix[5] - pix[21];
22 diff[1][2] = pix[6] - pix[22];
23 diff[1][3] = pix[7] - pix[23];
25 diff[2][0] = pix[8] - pix[24];
26 diff[2][1] = pix[9] - pix[25];
27 diff[2][2] = pix[10] - pix[26];
28 diff[2][3] = pix[11] - pix[27];
30 diff[3][0] = pix[12] - pix[28];
31 diff[3][1] = pix[13] - pix[29];
32 diff[3][2] = pix[14] - pix[30];
33 diff[3][3] = pix[15] - pix[31];
35 for( d = 0; d < 4; d++ )
40 s01 = diff[d][0] + diff[d][1]; s23 = diff[d][2] + diff[d][3];
41 d01 = diff[d][0] - diff[d][1]; d23 = diff[d][2] - diff[d][3];
43 tmp[d][0] = s01 + s23;
44 tmp[d][1] = s01 - s23;
45 tmp[d][2] = d01 - d23;
46 tmp[d][3] = d01 + d23;
49 for( d = 0; d < 4; d++ )
54 s01 = tmp[0][d] + tmp[1][d]; s23 = tmp[2][d] + tmp[3][d];
55 d01 = tmp[0][d] - tmp[1][d]; d23 = tmp[2][d] - tmp[3][d];
57 *i_satd_result +=
abs( s01 + s23 ) +
abs( s01 - s23 ) +
abs( d01 - d23 ) +
abs( d01 + d23 );
66 a=malloc(32*
sizeof(
char));
67 b=malloc(
sizeof(
int));
void __attribute__((noinline))