System and method for decoding variable-length codes. A variable-length
decoder includes an address generator and a local memory unit. The local
memory stores a variable-length code look-up table. The local memory can
be programmed to include a look-up table supporting substantially any
decoding algorithm. In one embodiment, a decoder memory unit and a system
memory unit are employed together with the local memory to store a
codeword look-up table. The shortest codes are stored in local memory,
the next shortest in decoder memory, and the longest codes are stored in
system memory. A multistage search algorithm is employed to search for
the longest codes. The address generator generates the address of the
code table to be searched by adding the value of the bits to be searched
to a base address.