The present invention relates to a code converter for converting, based on a predetermined coding system, a code into code data, to a variable length code decoder for decoding a bit-string made up of consecutive variable length codes into code data, and to associated methods.
Recently, with the digitization of recording medium and communication channel, data compression by means of entropy coding plays a very important role. In entropy coding, symbols that have a high probabilistic frequency of occurrence are assigned a short code so as to achieve a reduction of the average code length. Particularly, in the field of image processing, the use of variable length code on the basis of a predetermined coding system is proposed by the Moving Picture Expert Group (MPEG which is the international standard for image compression/expansion).
For example, in the event that decoding processing is carried out according to the MPEG standard in DVD apparatus, it requires a variable length code converter having the ability to perform variable length code conversion according to a coding system selected from among a plurality of coding systems. However, implementation of such a code converter produces some problems. One problem is that a plurality of circuits are required for corresponding coding systems. Another problem is that an organization is required for selectively having a circuit corresponding to a selected coding system operate. This further produces the problem that the entire size of the apparatus increases.
Generally, in the event of variable length code decoding, processing, in which the code length of a variable length code is found as decoding information in addition to finding code data corresponding to the variable length code and the code length found is used to obtain the position of a subsequent variable length code's leading bit, is repeatedly carried out. This produces the problem that, when an error occurs in a bit of a variable length code, neither code data corresponding to the error-containing variable length code nor the code length thereof can be obtained, which means that it is impossible to locate the position of a subsequent variable length code's leading bit. To sum up, in regard to variable length codes following an error-containing variable length code, these codes cannot be decoded at all, or even when they are decoded, the results of the decoding may be completely useless, since bit partition positions are unknown.
For the case of the variable length code decoding, if an error, such as "0"/"1" inversion, occurs in a bit-string for some reason, from then on, either it becomes impossible to perform decoding processing or completely inaccurate decoding is carried out.
With a view to solving the above-described drawback, there have been proposed various techniques. For example, one technique for detecting, by means of time interruption, a malfunction of the decoding processing caused by an error occurring in the bit-string, is known in the art. This technique, however, is problematic, for it is impossible to make restoration of decoding processing with accuracy because the decoding processing will not return to normal until a time interruption is made.
Japanese Patent Unexamined Application Laying Open Gazette No. 6-350458 shows a variable length code decoding method with a view to providing a solution to the foregoing problem. When the code length cannot be detected because a cut bit-string corresponds to none of prestored bit-patterns (variable length codes), bit shift information (bit-string cut position control information) is increased or decreased in search of a bit-string cut position that will not make detection of bit-patterns impossible, and the processing of decoding continues at the retrieved position.
The above-described technique, however, suffers the problem that there is the possibility that detection of the bit-patterns is made impossible immediately after the restoration of decoding processing because bit-string cut positions obtained by search may not be always adequate ones. There is produced another problem that the reliability of post-restoration code data is low. Additionally, in order to make decoding processing restoration, a new bit-string cut position is searched using trial-and-error techniques. As result, the search may not be completed timely in real-time decoding processing.