This doesn't work efficiently for non-square arrays.
E.g. if you have a 128x32 then you don't want to interleave the y bits once they are exhausted (only need 5 bits of y, but 7 bits of x to fully address this).
The posted implementation would produce
y6,x6,y5,x5,y4,x4,y3,x3,y2,x2,y1,x1,y0,x0
but really we want: x6,x5,y4,x4,y3,x3,y2,x2,y1,x1,y0,x0