I think using the same algorithm but swizzling the pixels might help (process them in Z curve order).
It may help to a limited extent with compression, but the window size is so small it is hardly worth it. I imagine a huge part of the speed of the algorithm is how cache friendly it is. Worse is better sometimes.