Jump to content

Variable-length code

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Calbaer (talk | contribs) at 02:43, 4 October 2006 (Creating since some links direct here). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

A variable length code is a data compression code in which the length of the output of the code is dependent not only on the length of the input of the code, but also the content of the input. This definition is somewhat ambiguous, however. It is usually taken to mean a fixed-to-variable length code such as a Huffman code, but it could also include other codes that have a variable length output per compression operation, such as the variable-to-variable length LZ77 and LZ78 codes. In its widest sense, it could also include variable-to-fixed length codes, which have fixed output per compression operation but variable output per input symbol. Taken in this sense, all codes achieving some form of lossless data compression are variable length codes.