Abstract:
In a variable length code demodulating apparatus, a bit length of the variable length code is examined to determine if it is longer than a specified bit length. The most significant bits equal in number to the specified bit length is selected from variable length codes which have a bit length exceeding the specified bit length. The most significant bits of the variable length code are converted to a conversion code which replaces the most significant lists. The conversion code has a bit length less than the specified bit length. An addressing to a conversion table in which each fixed length code is stored corresponding to each variable length code is performed on the basis of the least significant lists and the conversion code substituting for the most significant lists.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates, in general, to a variable length code demodulating apparatus. In particular it relates to a variable length code demodulating apparatus suited for image data compression. 
     2. Description of the Related Art 
     Recently, some remarkable progress has been made in image data compression techniques. In such image data compression techniques, in order to raise the efficiency of digital transmission and recording etc., the image data is encoded with a smaller bit rate. Examples of this technique are the predictive coding technique and transform coding technique, etc. These techniques are described in detail in &#34;Multidimensional Processing of TV Pictures&#34;, by T. Fukinuki, published by Nikkan Kogyo Shinbunsha, Jun. 25, 1984, incorporated herein by reference. In addition, a further image data compression can be achieved by performing variable length encoding on the code compressed by such encoding processes. The variable length encoding consists in varying the encoded bit width in accordance with the frequency of occurrence of the code. By this means, a smaller bit rate can be obtained than with fixed length coding. 
     Next, as an example of variable length coding, a description will be given with reference to FIGS. 3a and 3b of a method of generating Huffman codes. Let us know assume that t fixed length codes S 1 , S 1 , . . . S t  are converted into Huffman codes. FIGS. 3a and 3b show an example for the case where t=6. First of all, these codes S 1  to S 6  are arranged in order of the magnitude of the frequency of their occurrence (the probability of occurrence). The probabilities of occurrence of codes S 1  to S 6  are respectively 0.35, 0.20, 0.15, 0.15, 0.10 and 0.05 as shown in FIG. 3a. They are therefore arranged in the order of codes S 1  to S 6 . Next, taking the two codes whose probability of occurrence is smallest as one group, their composite probability (the sum of the two probabilities of occurrence) is found. In FIG. 3a, codes S 6  and S 5  have the smallest probability of occurrence, and their composite probability is 0.15. Next, this group and the other codes are arranged in order of magnitude of their probabilities of occurrence (or composite probability). The two codes (or groups) whose probability of occurrence (or composite probability) is smallest are taken as a new group, and the composite probability of this group is found. Subsequently, this process is repeated until a relisting with the composite probability of 1 has been effected as shown in FIG. 3a. 
     Next, using FIG. 3a, a code tree as shown in FIG. 3b is compiled. &#34;0&#34; and &#34;1&#34; are then allocated in accordance with the branching of this code tree. In FIG. 3b, the upper branches are allocated &#34;0&#34;, while the lower branches are allocated &#34;1&#34;. The Huffman codes are obtained by following this branching. For example, as shown by the thick line in FIG. 3b, the fixed length code S 4  passes along a branch &#34;0&#34;, along a branch &#34;1&#34;, and finally along a branch &#34;0&#34;, so it is converted to the Huffman code &#34;010&#34;. The Huffman codes of the codes S 1  to S 56  found in this way are shown in Table 1 below. 
     
                       TABLE 1______________________________________Code   Huffman code    Code   Huffman Code______________________________________S.sub.1  00              S.sub.4                         010S.sub.2  10              S.sub.5                         0110S.sub.3  11              S.sub.6                         0111______________________________________ 
    
     As shown in Table 1, codes whose probability of occurrence is high are converted into Huffman codes of short bit length, while codes whose probability of occurrence is low are converted into Huffman codes of longer bit length. In this way, the overall bit rate can be reduced. 
     In general, to demodulate such variable length code into fixed length code, a conversion table embedded in a solid state memory such as a ROM is used. In FIG. 3a, for convenience in explanation, the maximum bit number of the variable length code (huffman code) was taken as being 4 bits, but, in an actual image data signal, the maximum bit number is very large, for example, 15 bits. 
     Accordingly, some proposals have been made to reduce the capacity of the conversion table. As an example, this type of variable length code demodulating apparatus is described in Japanese Patent Disclosure (Kodai) No. 63-52578. This technique discloses that the bit length of coded data which is input is set as one n-th of the maximum bit length of coded data, and the conversion table is read out n times. Thus, the capacity of the conversion table can be reduced. 
     In the variable length code demodulating apparatus described above, however, a Run-Length code is used in which two values are employed consisting of while and black. Such a technique requires a long transaction time for conversion due to numerous read outs of the conversion table. 
     SUMMARY OF THE INVENTION 
     Accordingly, it is an object of the present invention to provide an improved variable length code demodulating apparatus wherein the capacity of the conversion table can be reduced. 
     It is a further object of the present invention to provide a variable length code demodulating apparatus which is capable of shortening the conversion time. 
     It is still a further object of the present invention to provide a variable length code demodulating apparatus wherein the circuit size can be reduced, without deterioration in performance. 
     In accordance with the present invention, the foregoing objects are achieved by providing a variable length code demodulating apparatus including a converting means and a conversion table. The converting means converts the most significant bits, having a selected bit length, of the variable length code into a conversion code having a bit length smaller than the selected bit length. The conversion table has address inputs and is connected to receive the least significant bits of the variable length code as least significant bit address inputs thereto. The conversion table is further connected to receive the conversion code as most significant bit address inputs thereto. The conversion table generates a fixed length code smaller than the maximum bit length of the variable length code as its fixed bit output code. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     These and other objects and advantages of this invention will become more apparent from the following detailed description of the presently preferred embodiment of the invention, taken in conjunction with the accompanying drawings of which: 
     FIG. 1 is a basic block diagram of the variable length code demodulating apparatus according to the present invention; 
     FIG. 2 is a basic block diagram of the variable length code demodulating apparatus of other embodiment of the present invention; and 
     FIGS. 3a and 3b are diagrams given in explanation of the Huffman codes wherein FIG. 3a shows the process of generating Huffman code, and FIG. 3b, shows a Huffman code tree. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     The preferred embodiment of the present invention will now be described in more detail with reference to the accompanying drawings. 
     In FIG. 1, at an input terminal 21, there is input a variable length code of, for example, a maximum bit number of 15 bits. The most significant 8 bits of this variable length code are supplied to an address input terminal of a conversion table 22, while the least significant 7 bits are supplied to an address input terminal of a conversion table 23. The addresses in the conversion tables 22 or 23 are specified by the data that is input at the address input terminal, and the data stored at the designated address is output. 
     The conversion table 22 has addresses corresponding to all variable length codes of 8 bits or less. At each of these addresses, there is respectively stored a fixed length 9-bit code corresponding to each of these variable length codes of 8 bits or less. The conversion table 22 also has addresses corresponding to the most significant 8 bits of variable length codes of 9 bits or more. At these addresses, there are stored 5 bit conversion codes respectively corresponding to these variable length codes. In addition, the conversion table 22 has a region that stores a 1-bit length code. If this length code is &#34;1&#34;, this indicates that the variable length code is 8 bits or less. If it is &#34;0&#34;, this indicates that the variable length code is longer than 8 bits. Thus, the conversion table 22 is constituted by 2 8  ×(9+5+1) bits. 
     As will be clear from the above example of Huffman coding, the most significant n bits of a variable length code of bit length longer than n bits (where n is a natural number) are necessarily different from the patterns of variable length codes of n bits or less. For example, in the Huffman codes of Table 1 above, the patterns &#34;00&#34;, &#34;10&#34; of the Huffman codes of S 1  and S 2  are not present in the most significant 2 bits of the Huffman codes of S 3 , S 4 , S 5  and S 6 . Consequently, by using variable length codes of 8 bits or less or the most significant 8 bits of a variable length code of 9 bits or more to designate different addresses, a length code can be obtained whereby it is possible to determine, from its address, whether or not the variable length code is 8 bits or less. In fact, the number of patterns of the most significant 8 bits of variable length codes of 9 bits or more is comparatively small. Although there are some differences depending on the system, these patterns can be adequately distinguished by 5 bits (32types). For this reason, in this embodiment, the bit number of the conversion code is set at 5 bits. 
     Thus, the conversion table 22 outputs the length code (1-bit) to a control input terminal 26 of a selector 24. The conversion table 22 also outputs the fixed length code to the other input terminal of the selector 24. The conversion table 22 outputs the 5-bit conversion code as the most significant bits of the address of a conversion table 23. Thus, the conversion table 22 supplies the 5-bit code to the address input terminal of the conversion table 23, together with the least significant 7 bits from the input terminal 21. 
     On the other hand, the conversion table 23 has addresses corresponding to these 12 bit codes. At each address, there is stored a fixed length 9-bit data code corresponding to the variable length input code of 9 bits or more. Thus, the conversion table 23 is constituted of 2 12  ×9 bits. The conversion table 23 outputs the fixed length code stored at the designated address to a second input terminal 30 of the selector 24. The selector 24 is arranged such that, when a length code &#34;1&#34; is input, it outputs the fixed length code that was input at the first input terminal 28 (coming from conversion table 22), while, when a length code &#34;0&#34; is input, it outputs the fixed length code that was input at the second input terminal 30 (coming from conversion table 23). 
     Next, the operation of the variable length code demodulating apparatus constructed as above will be described. 
     A variable length code of 15 bits is input through the input terminal 21. The most significant 8 bits of the variable length code are supplied to the conversion table 22. The least significant 7 bits are input at the address input terminal of the conversion table 23 as the least significant bits of the 5-bit conversion code from the conversion table 22. Now assume that the variable length code is constituted by 8 bits or less. In this case, a length code &#34;1&#34; is output by the conversion table 22 to the control input terminal 26 of the selector 24. Furthermore, the 9-bit fixed length code stored at the address indicated by this variable length code is output by the conversion table 22 to the first input terminal 28 of the selector 24. Since the selector 24 inputs &#34;1&#34; at its control input terminal 26, it outputs the fixed length code at the first input terminal 28. 
     In contrast, if the variable length code is constituted by 9 bits or more, a length code &#34;0&#34; is output by the conversion table 22. The conversion table 22 outputs the 5-bit conversion code stored at the address corresponding to the most significant 8 bits. Thus, a 12-bit code is supplied to the address input terminal of the conversion table 23. The address of the conversion table 23 is thereby designated, and the 9-bit fixed length code corresponding to the variable length code of 9 bits or more is output to the second input terminal 30 of the selector 24. Since the selector 24 inputs &#34;0&#34; at its control input terminal 26, it outputs the fixed length code from the second input terminal 30. The total bit number of the conversion tables is 2 8  ×15+2 12  ×9=40 (k bits), which is reduced to less than 1/7 of that used conventionally. Thus, the circuit size can be greatly reduced. 
     In this embodiment, the patterns of the most significant 8 bits of variable length codes of 9 bits or more are necessarily different from the patterns of variable length codes of 8 bits or less. Furthermore, the number of these patterns is extremely small. Therefore, the most significant 8 bits of variable length codes of 9 bits or more are converted to a 5-bit conversion code, which is used as the most significant bits. As a result, the total number of bits of the conversion tables 22 and 23 can be greatly reduced due to the fact that the demodulation of variable length codes of 9 bits or more is performed by designating the address of the conversion table 23 by a 12-bit code. 
     Obviously, the maximum bit length of the variable length code is not restricted to being 15 bits. Also, instead of supplying respectively the most significant 8 bits and least significant 7 bits to the two conversion tables, it is possible to split the variable length code at a suitably chosen bit number such as to obtain an optimum efficiency of reduction of the number of bits. 
     FIG. 2 shows a second embodiment of this invention. In the second embodiment, the same numerals are applied to similar elements in the first embodiment, and therefore the detailed description thereof are not repeated. The second embodiment is an example where m conversion tables are employed. The variable length code from the input terminal 21 is divided into first to (m-1)-th (where m is a natural number) most significant bits and least significant bits, which are supplied to respective conversion tables T 1  to T m . From the conversion tables T 1  to T m-1 , first to (m-1)-th length codes and fixed length codes are respectively supplied to selectors SE 1  to SE m-1 . Furthermore, from the conversion tables T 1  to T m-1 . first to (m-1)-th conversion codes are respectively supplied to the conversion tables T 2  to T m  of the next stage. The fixed length code from the conversion table T m  is output to selector SE m-1 . The fixed length codes which are output from the selectors SE 2   to SE m-1  are respectively input to the selectors SE 1  to SE m-2  of the front stage. Thus, from the output terminal of the selector SE 1 , a demodulated fixed length code is output corresponding to the variable length code. 
     As described above, with this invention, the total bit length of the conversion tables can be greatly reduced. 
     Numerous other modifications and variations of the present invention are possible in light of the above teachings. It is therefore to be understood that, within the scope of the appended claims, the present invention can be practiced in a manner other than as specifically described herein.