Patent ID: 8306108

Claim:
An adaptive canonical Huffman decoder, comprising: a symbol index generator, for storing decoding information of a plurality of encoding tables and selecting a corresponding decoding information from the decoding information according to a content selection signal, and for receiving a bit stream and decoding the bit stream according to the corresponding decoding information to obtain a symbol index; a content selector, coupled to the symbol index generator, for outputting the content selection signal; and a symbol table buffer circuit, coupled to the symbol index generator and the content selector, for reading a corresponding symbol table among a plurality of symbol tables stored in an external memory according to the content selection signal, storing the corresponding symbol table, and obtaining an output symbol from the corresponding symbol table according to the symbol index, wherein the corresponding decoding information comprises N first codes having codeword lengths from 1 to N, N first code indexes, and N recognition signals, wherein the N recognition signals indicate whether the N first codes having the codeword lengths from 1 to N exist, and N is greater than or equal to 2, and wherein the symbol index generator comprises: a comparator circuit, having N comparators of 1 to N bits, for comparing the bit stream with the N first codes to generate N selection signals; a multiplexer, coupled to the comparator circuit, for selecting a first code having a codeword length of L among the N first codes and a first code index of the first code having a codeword length of L among the N first code indexes according to the N selection signals and the N recognition signals, wherein L is a natural number smaller than or equal to N; and a symbol index calculation circuit, coupled to the multiplexer, for calculating the symbol index according to the first code index of the first code having the codeword length of L, the first code having the codeword length of L, and a codeword constructed by L bits in the bit stream.