int i, j, k, l ; // just indexes

int old_matrix [512][512] ;

int new_matrix [64][64][8][8] ; // there will be 64x64 array of 8x8 matrices

// one possibility .... do it the hard way

for (i=0; i<64; i++)

for (j=0; j<64; j++)

for (k=0; k<8; k++)

for (l=0; l<8; l++)

new_matrix [i][j][k][l] = old_matrix [(i*8)+k][(j*8)+l] ; // you can replace the (i*8) by (i<<3) and same with j. should be little faster

// second possibility .. bit faster i think. but the indexes could be damaged. you have to check yourself

memcpy (new_matrix, old_matrix, 512*512*sizeof(int)) ;

S.