1. Field of the Invention
The present invention relates to a variable length coding unit and a variable length decoding unit preferably applicable to motion pictures.
2. Description of Related Art
FIGS. 12 and 13 are block diagrams showing a configuration of a conventional Huffman coding unit and decoding unit disclosed in Japanese patent application laid-open No. 5-75477/1993. In these figures, the reference numeral 1 designates an information source for supplying information source symbols; and 2 designates a memory for storing the information source symbols. The reference numeral 3 designates a stochastic calculation quantizer for calculating an occurrence probability of the information source symbols; 4 designates an arithmetic circuit for summing up less-frequent occurrence probabilities; and 5 designates an arithmetic circuit for calculating the average of the summed up occurrence probabilities. The reference numeral 6 designates a Huffman table generator for generating a Huffman table; 7 designates a Huffman encoder for Huffman coding the information source symbols according to the Huffman table; and 8 designates a multiplexer for transmitting the Huffman code sequence along with more-frequent occurrence probabilities.
The reference numeral 11 designates a demultiplexer for separating the Huffman code sequence and more-frequent occurrence probabilities sent through the transmission line; and 12 designates a memory for storing the Huffman code sequence. The reference numeral 13 designates an arithmetic circuit for calculating the difference between one and the sum of the more-frequent occurrence probabilities; and 14 designates an arithmetic circuit for calculating the average of the value calculated by the arithmetic circuit 13. The reference numeral 15 designates a Huffman table generator for generating the Huffman table; and 16 designates a Huffman decoder for Huffman decoding the Huffman code sequence according to the Huffman table.
Next, the operation of the conventional units will be described.
First, referring to FIG. 12, the operation of the Huffman coding unit will be described.
The stochastic calculation quantizer 3 calculates the occurrence probabilities P(A)-P(E) of the information source symbols supplied from the information source 1. Among the calculated occurrence probabilities P(A)-P(E), less-frequent occurrence probabilities P(C)-P(E) are supplied to the arithmetic circuit 4 that sums them up. The arithmetic circuit 5 computes the average of the output of the arithmetic circuit 4, and supplies the Huffman table generator 6 with transmission probabilities P1(C)-P1(E). The Huffman table generator 6 generates the Huffman table from the more-frequent occurrence probabilities P(A) and P(B) fed from the stochastic calculation quantizer 3 and the transmission probabilities P1(C)-P1(E) fed from the arithmetic circuit 5. Then, the Huffman encoder 7 carries out the Huffman coding of the information source symbols in reference to the Huffman table generated by the Huffman table generator 6. The multiplexer 8 supplies the transmission line with the Huffman code sequence output from the Huffman encoder 7, along with the more-frequent occurrence probabilities P(A) and P(B).
Next, referring to FIG. 13, the operation of the Huffman decoding unit will be described.
The demultiplexer 11 separates the Huffman code sequence and more-frequent occurrence probabilities P(A) and P(B) from the information transmitted through the transmission line. The Huffman code sequence is stored in the memory 12, and the occurrence probabilities P(A) and P(B) are supplied to the arithmetic circuit 13 and Huffman table generator 15. The arithmetic circuit 13 calculates P(SUM)=1−{P(A)+P(B)}, the difference between one and the sum of the occurrence probabilities P(A) and P(B), and supplies it to the arithmetic circuit 14. The arithmetic circuit 14 calculates the less-frequently occurring transmission probabilities P1(C)-P1(E) from the calculation result P(SUM) supplied. In other words, it calculates the average P1(C)=P1(D)=P(E)=P(SUM)/3, thereby placing the transmission probabilities P1(C)-P1(E) at the same value. The Huffman table generator 15 generates the Huffman table in response to the occurrence probabilities P(A) and P(B) of the information source symbols and the transmission probabilities P1(C)-P1(E) computed by the arithmetic circuit 14. The Huffman decoder 16 carries out the Huffman decoding by reading the Huffman code sequence from the memory 12 in reference to the Huffman table generated by the Huffman table generator 15, and outputs an information source sequence.
FIG. 14 is a block diagram showing a configuration of a conventional image coding unit disclosed in Japanese patent application laid-open No. 8-256266/1996, and FIG. 15 is a block diagram showing the detail of its encoder. In these figures, the reference numeral 22 designates a target extractor for isolating and extracting a target image from an input image signal 21, and for outputting target image information 23; 24 designates a coding scheme decision section for selecting a coding scheme suitable for the target image information 23 from a plurality of coding schemes, and for outputting a selection signal 25; and 26 designates an encoder for encoding the target image information 23 according to the coding scheme corresponding to the selection signal 25, and for outputting coding information 27 and decoding scheme information 28.
In the coding section 26, reference numerals 31-34 designate encoders for carrying out different coding schemes; and 35 designates an encoder selector for selecting one of the encoders 31-34 in response to the selection signal 25.
Next, the operation of the conventional system will be described.
First, the operation of the image coding unit will be described with reference to FIG. 14.
The input image signal 21 is input to the target extractor 22 that isolates and extracts a plurality of target images constituting a frame. The extracted target image information 23 is supplied to the coding scheme decision section 24 that selects one of the plurality of coding schemes suitable to the target image information 23, and outputs the selection signal 25. Specifically, it selects the optimum coding scheme considering the type and complexity of the target images. It is also effective to select a coding scheme that provides a minimum information amount by comparing information amounts after encoding. On the other hand, as to a background including a scene of nature, it will be suitable to apply conventional orthogonal transform coding. The selection signal 25 determined by the coding scheme decision section 24 is input to the coding section 26.
In the coding section 26 as shown in FIG. 15, the encoder selector 35 selects the encoder for carrying out the coding scheme selected by the selection signal 25 from the n encoders 31-34 to perform the coding. The coding section 26 outputs the coding information 27 and decoding scheme information 28 obtained as a result of the coding.
With the foregoing configuration, the conventional Huffman coding unit and decoding unit divide the information source into the less-frequent occurrence probability information source symbols and more-frequent occurrence probability information source symbols, and as for the less-frequent occurrence probability information source symbols, it calculates the average of the less-frequent occurrence probability information source symbol sets as the transmission probability. Applying such a technique to information sources according to international standard coding methods such as H.261, H.263, MPEG1, MPEG2 and MPEG4 that include a great number of probabilities will increase the amount of the stochastic calculation. In addition, as for the information source symbols with the less-frequent occurrence probabilities, the number of symbol sets of the averaged transmission probability tends to increase.
Likewise, on the receiving side, as for the more-frequent occurrence probability information source, the calculation of the transmission probabilities in the decoding becomes complicated, and the Huffman table increases with the occurrence probabilities.
Furthermore, it is necessary for the transmitting side to transmit the occurrence probabilities to the receiving side. Thus, applying the conventional technique to the information source that employs the international standard coding method such as the H.261, H.263, MPEG1, MPEG2 and MPEG4, and hence has a great number of probabilities will impair the transmission efficiency. This is because when the number of information source symbols belonging to the more-frequent occurrence probabilities is large, the large number occurrence probabilities of the information source symbols must be transmitted to the receiving side, and besides, to switch to another new coding scheme during coding, the occurrence probabilities corresponding to the new coding scheme must be transmitted to the receiving side.
In addition, since the conventional system can handle only its own scheme, it cannot code or decode a stream with a format according to the international standard coding method such as the H.261, H.263, MPEG1, MPEG2 and MPEG4, thus lacking in flexibility and applicability to other coding schemes.
As for the conventional image coding unit as shown in FIGS. 14 and 15, it is configured such that it extracts the plurality of target images from the input image, applies coding schemes suitable to the individual extracted target images, and outputs information indicating the decoding schemes of the coding information along with the target images. In contrast, a system that communicates with a party station by utilizing the international standard coding method according to the H.261, H.263, MPEG1, MPEG2 or MPEG4 is based on the premise that it carries out the coding on a frame by frame basis (or using a plurality of frames as one sequence depending on the coding schemes). Therefore, the conventional system, which divides each frame into a plurality of target images utilizing different international standard coding methods, is incompatible with such a system.
Moreover, it is necessary for the conventional system to transmit the information about the decoding scheme (coding scheme) to the party frame by frame even when the scheme is not changed.
Finally, as described above in connection with the operation of the conventional system, “it is also effective to select the coding scheme that provides the minimum information amount by comparing the information amounts after coding”. This poses a problem in that the conventional system requires a lot of processing to complete the coding of each frame, because it divides each frame into a plurality of target images, encodes them by the prepared coding schemes, and selects the scheme providing the minimum information amount.