That is only zigzag encoding, I first used delta encoding before that. Delta encoding is simply encoding an array as an array of consecutive difference values. For example if the array to be encoded is 10 12 14 13 11 10, the delta encoding is; 10 2 4 -1 -2 -1. Then we apply zigzag encoding to get rid of negative integers. This doesn't work if consecutive integers are too far apart. I can also code pure zigzag encoding, without the delta encoding if you want.