I have this double for-loop, where I have both row-order and column-order array indexing, which should be bad for performance.
for (int row = 0; row < h
So you want to switch from something like:
0 1 2 3 4 5 6 7 8 9 10 11
to
0 3 6 9 1 4 7 10 2 5 8 11
?
Try
for (int i = 0; i < width; ++i) for (int j = 0; j < height; ++j) array_b[ i * height + j ] = array_a[ j * width + i ];