Practical applications that employ entropy coding for large alphabets often partition the alphabet set into two or more layers and encode each symbol by using some suitable prefix coding for each layer. In this paper we formulate the problem of optimal alphabet partitioning for the design of a two layer semiadaptive code and give a solution based on dynamic programming. However, the complexity of the dynamic programming approach can be quite prohibitive for a large sequence and a very large alphabet size, Hence, we give a simple greedy heuristic algorithm that is linear in the number of symbols being encoded, irrespective of the underlying alphabet size. We give experimental results that demonstrate the fact that superior prefix coding schemes for large alphabets can be designed using our approach as opposed to the typically adhoc partitioning approach applied in the literature.
Dan Chen, Yi-Jen Chiang, Nasir D. Memon, Xiaolin W