Patent ID: 6980138

Claim:
A method for decoding codewords of variable length from a bit stream, in which minimum and maximum lengths are defined for the codewords, in which method the bit stream to be decoded is processed in parts, each part of the bit stream is subjected to a search for codewords, and found codewords are decoded, wherein in the method, at least partly overlapping fields are extracted from the part of the bit stream to be processed in such a way that the starting point of at least two fields is a possible starting point for a codeword in said bit stream part, a codeword end is searched from at least one field, and data related to the codeword is determined on the basis of the end point of the codeword, and the data related to at least one codeword is used to determine the occurrence of the codeword to be decoded in the field, and the found codeword is decoded.