Huffman encoder and decoder