Just want to let you know that your Hu-Tucker algorithm implementation produces wrong optimal code lengths. For example, for input array [7 3 4 1 3 2 4 3 5 3 6], your algorithm produces [3 4 4 4 4 4 4 3 3 3 3], which is incorrect. The correct results are [3 4 4 5 5 4 3 3 3 3 3].
BTW, your paper is very helpful. Cheers.