PICTURE DECODER

Abstract: It is an object to encode an image signal or a shape signal more efficiently than the prior art. As a means to accomplish the object, the change pixel detector 2 receives the input signal 1 as an input signal and detects the pixel which changes the two-valued pixel value. Further, the change pixel predictor 4 also reads out the reference image stored in the memory 3, and predicts the change pixel of the particular input signal. The difference value calculator 5 subtracts the output of the change pixel predictor 4 from the output of the change pixel detector 2. The difference value rounder 7 compares the tolerance value e and the prediction error D, and outputs x which requires the minimum bit number for being encoded in the value D-e≦x≦D+e . The output of the difference value rounder 7 is encoded by the decoder 8 to become the encoded signal 9. Also, the output of the difference value rounder 7 is added in the difference value adder 11 to the predicted pixel 4 of the predicted pixel predictor 4, whereby the change pixel is calculated, and in the change pixel decoder 10, the respective pixels from the already decoded pixel indicated by the change pixel predictor 4 to the change pixel is decoded to be stored in the memory 3.

Description: Field of Technology This invention relates to an image decoding apparatus, Prior Art The image encoding technology has a long history. There has been established excellent standard proposals such as ITU-T H.261, ITU-T H263, ISO MPEG1/2 and so on. Roughly speaking, the image encoding method has two approaches: an encoding method using the orthogonal transform and a prediction encoding method encoding the error of predicted values with the use of the prediction function. Although the encoding method using the orthogonal transform needs complicated calculation, when encoded signals of small bit numbers are obtained, it is possible to keep better picture quality than the prediction encoding method. The ordinary encoding method using orthogonal transform such as JPEG, MPEG and the like utilizes the DCT(Discrete Cosine Transform). Though it is known that DCT enables encoding by a small number of bits, it has own problems in that it needs high-precision multiplication, resulting in complicated calculation, and in that the reversible encoding is impossible. Accordingly, DCT calculation can not be used in the fields in which the reversibility is required. As opposed to this, the prediction encoding method needs simple calculations and can do the reversible encoding. MMR(Modified Modified Read) used in facsimiles is famous as an image coding method having reversibility. MMR is used according to CCITT Rec.T6 "Facsimile Coding Schemes and Coding Control Functions for Group 4 Facsimile Apparatus". In this method, the difference value in the horizontal direction between the change points of pixel values on the immediately previous already-coded scanning line and the change points of pixel value on the not-yet-coded scanning line is variable-length encoded. MMMR (Modified MMR) which is a further improved MMR is used as the evaluation model for MPEG4 (ISO/IEC/JTC/SC29/WG11 N1277, July 1996). Incidentally, if image signals are separated into the objects and then the objects are processed as arbitrary shapes, image can be operated and synthesized, object by object, which leads to the effective signal-transmission. For applications which restrict bit number, by using such information, it is possible to selectively assign priority to important objects to transmit and record the same. However, the prior art technology has not taken into account the encoding of objects having arbitrary shapes. And the standardization of coding for image signals having arbitrary shapes has been proceeding in the ISO MPEG4. In MPEG4, the evaluation model called VM3.0 (printed in ISO/IEC/JTC1/SC29/WG11 N1277) is created, which is now a unique image encoding method that can encode image signals having arbitrary shapes. An image signal having arbitrary shapes ordinarily consists of the shape information indicating the shape of an object and the pixel value information (color information) representing pixel values within an object. Concerning the shape information, the two-valued shape information indicating whether each pixel is significant(on the inside of the shape) or insignificant(on the outside of the shape), or the transparency information indicating the ratio(how much the object occludes the background) of respective pixels which is used in synthesizing with other images. When the transparency has only two levels, 0% and 100%, the shape information is identical to the transparency information and thereby the arbitrary-shape-having image signal is represented by the two of the two-valued shape information and the pixel value information. Fig.23 is a drawing for explaining these information. The transparency information is an information representing how much ratio of each pixel is used for synthesis when a fish shown in figure 23(a) is synthesized with the other image. In figure 23(b), there is shown the value of transparency information in the horizontal scanning line indicated by a dotted line in the figure. The outside of the fish is perfectly transparent. Here, the transparency 0 is defined as being perfectly transparent for simplification. Hence, on the outside of the fish the transparency information has a value of 0, while on the inside of the fish it has a value of non-0. Fig. 23(c) shows the transparency which is made two-valued as having two of 0 and non-0. In figure 23(c), the pixels having the non-0 transparency require encoding of the pixel value information, while the pixels having the 0 transparency do not need the pixel value information, so that the two-valued transparency information is very important to the pixel value information encoding. On the other hand, the component of the transparency information which can not be represented by two-valued information, as shown in figure 23(d), is multi-valued information which is called gray scale. The shape information represented by multi-valued information as described above can be treated by the waveform encoding similar as that for the pixel value information. While performing the image encoding, the intra-frame encoding based on the spacial correlation or the temporal correlation is separately used, both of the two are employed. In the inter-frame encoding, the motion in the close frames is detected, and the motion compensation is carried out for the detected motion. The motion vector is generally used for the motion compensation. In the above-mentioned VM3.0, the intra-frame encoding and the inter-frame encoding are adaptively switched each other block by block, and the motion compensation similar as in MPEG1/2 is carried out, whereby the efficiency of encoding is improved. As described above, when performing encoding to the image consisting of the shape information and the pixel value information, if the motion compensation encoding of a shape information is carried out using the motion vector of the pixel value information for the shape information to be used for the image synthesis, the efficiency of encoding is further improved than when the shape information is directly encoded. This is reported by ISO/IEC/JTC1/SC29/WG11 N1260 March 1996. Further, when the motion detection and motion compensation are executed, it is considered that it is efficient that the shape information is separated into the two-valued shape information component and the multi-valued information component, and the multi-valued information component as well as the pixel value information are subjected to the same waveform encoding together, which has been actually practiced. In the above-described prior art image encoding and the image decoding accompanying to this, there exist the following problems. Though MMR encoding is a representative one of the reversible (loss-less) encoding as described above, because of the reversibility, it is impossible to largely improve the compression rate by allowing the visually less-important picture-quality degradation. In addition, MMR is an intra-frame encoding method, and does not take into account the improvement of the compression rate by utilizing the inter-frame correlation. In MMR and MMMR which a modified version of MMR, only the difference between the change point of the current scanning line and the change point of the immediately previous scanning line is utilized, and the redundancy by the correlation as a straight line in the vertical direction is not sufficiently removed. Accordingly, the encoding efficiency is good when the change of the pixel value happens along the scanning line, but the encoding efficiency is bad when the change of the pixel value does not happen along the scanning line. MMR and MMMR also includes the horizontal encoding mode which does not utilize the correlation in the vertical direction at all in order to encode the pixels which can not be encoded as the difference of the change point of the immediately previous scanning line. This horizontal encoding mode has a room for further improving the efficiency with the use of the correlation in the vertical direction. Further, in the prior art MMR and MMMR, the hierarchical image reproduction by decoding part of bit stream is impossible. The other methods in which the hierarchical image reproduction is possible have no good encoding efficiency and have demerit of increasing the encoding bit number. Accordingly, there exists no encoding method which enables the effective hierarchical image reproduction. Further, when encoding the image consisting of shape information and image information by the motion compensation, the shape information is motion-compensated using the same motion vector as that for the image information in the prior art. However, similarly as that, if a sphere rotates, the figure drawn on the sphere moves, though the shape of the sphere does not change, the motion vector of the image information is not identical to that of the shape information. Therefore, in such a case no good encoding is carried out, which is a problem in the prior art encoding method. Furthermore, while in VM3.0, there is a method which tries to improve the encoding efficiency by adaptively switching the intra-frame encoding and the inter-frame encoding block by block as described, the judgment against intra-frame/inter-frame encoding is based on the pixel value information similarly as in the adaptive switching in MPEG1/2, so that it is difficult to appropriately and efficiently encode the shape information which is largely different from the pixel value information in its nature. In the light of the above-described respects, this invention is proposed and an object of this invention is to provide an image decoding apparatus, which can appropriately decode the above-mentioned encoded signal encoded effectively. Disclosure of Invention Thus, the present invention concerns an image decoding apparatus as defined in the appended claim. Brief Description of Drawings In the drawings, embodiments 11 and 12 are covered by the claims. Fig.1 is a block diagram showing the structure of an image encoding apparatus according to a 1st embodiment not forming part of this invention. Fig.2 is a drawing for explaining the operating principle of an image encoding apparatus according to a 1st embodiment not forming part of this invention. Fig.3 is a block diagram showing the structure of an image encoding apparatus according to a 2nd embodiment not forming part of this invention. Fig.4 is a drawing for explaining the operating principle of an image encoding apparatus according to a 2nd embodiment not forming part of this invention. Fig.5 is a block diagram showing the structure of an image decoding apparatus according to a 3rd embodiment not forming part of this invention. Fig.6 is a block diagram showing the structure of another image decoding apparatus according to a 3rd embodiment not forming part of this invention. Fig.7 is a block diagram showing the structure of an image encoding apparatus according to a 4th embodiment not forming part of this invention. Fig.8 is a drawing for explaining the operating principle of an image encoding apparatus according to a 4th embodiment not forming part of this invention. Fig.9 is a block diagram showing the structure of an image decoding apparatus according to a 5th embodiment not forming part of this invention. Fig.10 is a block diagram showing the structure of an image encoding apparatus according to a 6th embodiment not forming part of this invention. Fig.11 is a block diagram showing the structure of an image decoding apparatus according to a 7th embodiment not forming part of this invention. Fig.12 is a block diagram showing the structure of an image encoding apparatus according to an 8th not forming part embodiment of this invention. Fig.13 is a block diagram showing the structure of an image encoding apparatus according to a 9th embodiment not forming part of this invention. Fig.14 is a block diagram showing the structure of an image encoding apparatus according to a 10th not forming part embodiment of this invention. Fig.15 is a block diagram showing the structure of an image decoding apparatus according to a 11th embodiment forming part of this invention. Fig.16 is a block diagram showing the structure of an image decoding apparatus according to a 12th embodiment forming part of this invention. Fig.17 is a block diagram showing the structure of an image encoding apparatus according to a 13th embodiment not forming part of this invention. Fig.18 is a block diagram showing the structure of an image encoding apparatus according to a 14th embodiment not forming part of this invention. Fig.19 is a block diagram showing the structure of an image encoding apparatus according to a 15th embodiment not forming part of this invention. Fig.20 is a block diagram showing the structure of an image encoding apparatus according to a 16th embodiment not forming part of this invention. Fig.21 is a block diagram showing the structure of an image encoding apparatus according to a 17th embodiment not forming part of this invention. Fig. 22 is a drawing showing a floppy disk as an example of recording media for a image encoding program and a image decoding program according to a further embodiment of this invention. Fig.23 is a drawing for explaining the shape information of an image in an image encoding. Best Embodiments of Invention Embodiment 1 An image encoding apparatus according to a 1st embodiment not forming part of this invention performs efficient encoding in prediction encoding by selecting difference values having short code lengths within the given range. Fig.1 is a block diagram showing the structure of the image encoding apparatus according to the 1st embodiment. In the figure, 1 indicates an input signal, which is input to the image encoding apparatus as a two-valued image signal. 2 indicates a change pixel detector which detects pixels changing pixel values in the input signal 1 and outputs the detected change pixels. 3 indicates a memory which temporarily stores already encoded and decoded image signals which are to be used as reference images. 4 indicates a change pixel predictor which predicts change pixels output by the change pixel detector 2 based on pixels changing pixel values of the reference image, and outputs predicted change pixels. As a prediction method used by the change pixel predictor 4, for example, there can be used the most typical method that predicts that a change pixel should be on a horizontal position the same as that on the upper-positioned scanning line, based on the strong vertical correlation of the two-dimensional image signal, and so on. 5 indicates a difference value calculator which calculates the difference value D between the change pixel detected by the change pixel detector 2 and the predictor 4. 6 indicates a value e which is a given value as the tolerance value of a rounding error and is input to a difference value rounder. 7 indicates the difference value rounder which modifies the difference value D within the range defined by the tolerance value e, and outputs a modified difference value D'. 8 indicates an encoder which encodes the difference value. 9 indicates the encoded signal which is output by the encoder 8. 11 indicates difference value adder which adds the modified difference value D' and the predicted change pixel output by the change pixel predictor 4. 10 indicates a change pixel decoder which decodes the two-valued pixel using the result of the addition output by the difference value adder 11. The operation of the image encoding apparatus according to the 1st embodiment as constructed above is described. The input signal 1, i.e. a two-valued signal, is input to the apparatus. The change pixel detector 2 receives the input signal 1 and detects pixels changing the two-valued pixel values. On the other hand, the change pixel predictor 4 reads out the reference image stored in the memory 3 and predicts change pixels in the input signal. The change pixel detector 2 outputs the detected result as detected change pixels to the difference value calculator 5. The change pixel predictor 4 outputs the predicted result as predicted change pixels to the difference value calculator 5. Thereafter, the difference value calculator 5 subtracts the predicted change pixel from the detected change pixel to obtain the difference value D corresponding to the prediction error of the change pixel. The difference value calculator 5 outputs the difference value D to the difference value rounder 7. The difference value rounder 7 compares the given tolerance value e with the difference value D corresponding to the prediction error output by the difference value calculator 5, and outputs a value x which satisfies D-e≦x≦D+eand the bit number of which should be minimum when x is encoded, as the modified difference value D', when the difference value D does not exceed the tolerance value e. As opposed to this, when the difference value D is beyond the tolerance value e, the difference value rounder 7 obtains the modified difference value D' based on the tolerance value e to be output to the encoder 8. Thereafter, the modified difference value D' is encoded by the encoder 8 to become the encoded signal 9. Also, the modified difference value D' output by the difference value rounder 7 is output to the difference value adder 11. In the difference value adder 11, the modified difference value D' is added to the predicted change pixel output by the change pixel predictor 4 and thereby the pixel value of the change pixel is calculated and is output to the change pixel decoder 10. The change pixel decoder 10 decodes the pixel value of each pixel from the already decoded pixel output by the change pixel predictor 4 to the change pixel input by the difference value adder 11, and stores the decoded result in the memory 3. Subsequently, the stored content in the memory 3 is used as the reference image. The above-described operation is concretely explained, referring to Fig.2. Fig.2 shows a model of a two-valued image signal, indicating white and black(fine slant lines) as pixels. For the simplicity of description, the processing procedure is explained, assuming that the processing is carried out pixel by pixel. Fig.2(a) shows the input signal. The scanning goes from top left in the right direction. The process proceeds toward the bottom right. The change pixel is a pixel which changes the pixel value (white → black or black → white) on a line (the scanning line) . Pc in figure 2(b) indicates an already encoded final pixel. Pu indicates the change pixel of the upper-positioned scanning line. Parts having rough slant lines indicate pixels not encoded yet. The change pixel detector 2 checks change pixels changing pixel values in part not encoded yet shown figure 2 (b) of the input signal shown in figure 2(a), and detects a change pixel P1 and outputs the result as a detected change pixel. On the other hand, the change pixel predictor 4 predicts the change pixel by the above-described method, obtains pixel P0 by assuming that the change pixel should exist on the same horizontal position as that of the change pixel Pu of the upper-positioned scanning line, and outputs the result as a predicted change pixel to the difference value calculator 5. The difference value calculator 5 outputs D=1 as the difference value between the detected change pixel P1 and the predicted change pixel P0 to the difference value rounder 7. In this case, for the image encoding apparatus according to the 1st embodiment, it is assumed that such an encoding would be performed so that the difference value different from P0 by the smaller value is assigned the code having the shorter code length. And the tolerance value of the round error would be given 1. Because the difference between P1 and P0 calculated by the difference value calculator is equal to or smaller than e, the difference value rounder 7 outputs D''=0 as the value satisfying the above-described condition. As a result, the change pixel is rounded and is subjected to the encoding process, whereby the encoded and decoded pixel value becomes what is shown in Fig.2(c). As opposed to this, when the input signal is what is shown in Fig. 2(d), as shown in Fig.2(e), the difference value indicated by the difference between the predicted change pixel P0 and the detected change pixel P1 becomes 2, so that in this case the difference value D exceeds the tolerance value e. Therefore, the difference value rounder 7 modifies the prediction error(the difference value), based on the tolerance value e, not exceeding the tolerable range, and outputs the difference value-1 corresponding to the change pixel P2. As a result, the encoded and decoded pixel value becomes what is shown in Fig.2(f). As described above, the image encoding apparatus according to the 1st embodiment has the difference value rounder 7, and selects the modified difference value which is to have the maximum code length of the error (difference value) in the range of the prediction error equal to or smaller than the tolerance value, using the difference value between the detected change pixel and the predicted change pixel and the given tolerance value 6, and outputs the modified difference value. As a result, though there exists a little degradation of picture quality, the required bit number is reduced to a large extent. In addition, the encoded signal 9 obtained in the image encoding apparatus according to the 1st embodiment can be decoded by an ordinary image decoding apparatus. Embodiment 2 An image encoding apparatus according to a 2nd embodiment not forming part of this invention performs processes, adaptively switching an encoding based on prediction from a particular frame and an encoding based on prediction from a reference frame with motion compensation. Fig.3 is a block diagram showing the structure of the image encoding apparatus according to the 2nd embodiment. In the figure, 20 indicates a motion compensation unit which generates reference pixel values for the already encoded and decoded image signal of a reference frame by performing motion compensation. 21 indicates a mode selector which compares the difference value when prediction is carried out based on the image signal of the particular frame, with the difference value when prediction is carried out based on the image signal of the reference frame, and then selects one of the two values which has the smaller bit number required for encoding. 22 indicates a switching unit which selects the difference value corresponding to the encoding mode selected by the mode selector 21. 1 to 9 indicate the same as those of Fig.1 and the description is also the same and omitted here. A description is given of the image encoding apparatus according to the 2nd embodiment having the above-described structure. When an input signal 1 which is a two-valued image signal is input to the apparatus, the input signal 1 is input to the change pixel detector 2 and then input to the memory 3 and stored in the memory 3. The stored input signal is used as an already encoded and decoded reference image. The change pixel detector 2 receives the input signal 1 and detects the pixel which changes the two-valued pixel value. The change pixel detector 2 outputs the detected result as a detected change pixel to the difference value calculators 5a and 5b. On the other hand, the change pixel predictor 4a reads out the already encoded and decoded reference image of the particular frame stored in the memory 3, and predicts a change pixel based on the particular input signal to be output as a predicted change pixel to the difference value calculator 5a. Following this, the difference value calculator 5a subtracts the predicted change pixel from the detected change pixel to obtain a difference value D. The difference value D which is the output of the difference value calculator 5a corresponds to the prediction error of the predicted change pixel based on the already encoded and decoded pixel of the particular frame. The difference value calculator 5a outputs the difference value D to the mode selector 21 and the switching unit 22. The motion compensation unit 20 subjects the already encoded and decoded image of the reference frame stored in the memory 3 to the motion compensation. The change pixel predictor 4b predicts the change pixel of the particular input signal based on the motion-compensated pixel to be output as a predicted change pixel to the difference value calculator 5b. The difference value calculator 5b subtracts the predicted change pixel from the detected change pixel and obtains a difference value D''. The difference value D'' which is the output of the difference value calculator 5b corresponds to the prediction error of the predicted change pixel based on the already encoded and decoded pixel of the particular frame. The difference value calculator 5b outputs the difference value D to the mode selector 21 and the switching unit 22. The mode selector 21 compares the code lengths(the required bit number for encoding) of the difference value D and the difference value D'' input from the difference value calculators 5a and 5b when respectively encoded, and selects the prediction method which needs a smaller bit number for encoding, and outputs the identifying signal as an encoding mode. The mode selector 21 outputs the encoding mode "particular frame" if the code length is short when the difference value D is encoded, or outputs the encoding mode "reference frame" if the code length is short when the difference value D'' is encoded, to the switching unit 22 and the encoder 8a. The switching unit 22, responding to the output of the mode selector 21, outputs the difference value D output by the difference value calculator 5a if the encoding mode is "particular frame", or outputs the difference value D'' output by the difference value calculator 5b if the encoding mode is "reference frame". The encoder 8a encodes the encoding mode selected by the mode selector 21 and outputs an encoded signal 9a. The encoder 8b encodes the output difference value and outputs an encoded signal 9b. The image encoding apparatus according to the 2nd embodiment performs encoding without any rounding error and stores the input image signal 1 as the encoded and decoded pixel values up to the change pixel as described above, in the memory 3. The above-described operation is concretely explained, referring to Fig.4. Fig.4 shows a model of a two-valued image signal, indicating white and black pixels as pixels, similarly to Fig.2 used for explaining the 1st embodiment. For the simplicity of description, the processing procedure is explained, assuming that the processing is carried out pixel by pixel. In the figure, Fig.4(a) shows the input signal, Fig.4(b) shows the image signal of the reference frame and Fig.4(c) is a drawing for explaining the prediction based on the particular frame. P1 indicates the change pixel detected by the change pixel detector 2 similarly to the 1st embodiment. Pc indicates an already encoded final pixel. Pu indicates the change pixel of the upper-positioned scanning line. Parts having rough slant lines indicate pixels which are not encoded yet. The change pixel predictor 4a, using the similar way of prediction of change pixels in the 1st embodiment, makes a prediction based on the change pixel Pu on the upper-positioned scanning line by utilizing the correlation and makes P0 which is positioned on the same horizontal position as that of Pu the predicted change pixel based on the particular frame. Fig.4(b) shows the reference frame after the performance of the motion compensation unit 20. The change pixel predictor 4b obtains the predicted change pixel Pr. Accordingly, the difference value D in the difference value calculator 5a becomes 1, the difference P1 and P0. The difference value D'' in the difference value calculator 5b becomes 0, the difference P1 and Pr. In the image encoding apparatus according to the 2nd embodiment as well as that of the 1st embodiment, if the encoding is such that a code having a shorter code length is assigned to a difference value as the difference from P0 is smaller, the code for the difference P1 and P0 has a shorter code length than that for the difference Pr and P1. Accordingly, the mode selector 21 selects "reference frame" which outputs the difference D'', so that the encoding mode "reference frame" and the difference value D'' are encoded and become the encoded signal output by the image encoding apparatus according to the 2nd embodiment. Fig.4(e) shows the result which is obtained by decoding the encoded signal. As described above, the image encoding apparatus according to the 2nd embodiment, by the memory 3, the change pixel predictors 4a and 4b, the difference value calculators 5a and 5b and the motion compensation unit 20, makes the prediction based on the particular frame, and the prediction based on the reference frame, and obtains the difference value between each predicted value and the detected result; and by the mode selector 21, switching unit 22 and encoders 8a and 8b, compares the difference values from the prediction based on the particular frame and from the prediction based on the reference frame, and selects the difference value which has the minimum code length, and encodes the difference value, where, by utilizing the correlation between frames, the bit number required for encoding is reduced to a large extent. Note that the image encoding apparatus according to the 2nd embodiment receives the input signal 1 block by block and the encoding mode is selected for respective blocks, that is, the encoding based on the prediction with the particular frame and the encoding based on the prediction with the reference frame using the motion compensation are, block by block, switched, whereby obtaining the above-described result. Also, in the image encoding apparatus according to the 2nd embodiment, the change pixel detector 2, and the change pixel predictors 4a and 4b output the distance (pixel number) to the change pixel. However, it is also possible to output a two-valued signal, for example, '0' or '1' representing "the next pixel is a change pixel" or "the next pixel is not a change pixel", respectively, and the difference calculators 5a and 5b calculate the two-valued signal. However, in this case, it is not that the distance is encoded as described above, but that the outputs of the difference calculators 5a and 5b are encoded for the respective pixels of the input signal 1. As described above, the outputs of the change pixel detector 2 and the change pixel predictors 4a and 4b have two values, which results in a simplification of the encoding process. Embodiment 3 An image decoding apparatus according to a 3rd embodiment not forming part of this invention which performs appropriate decoding for encoded signals encoded by the image encoding apparatus according to the 2nd embodiment. Fig.5 is a block diagram showing the structure of the image decoding apparatus according to the 3rd embodiment. In the figure, 30a and 30b correspond to the encoded signals 9a and 9b of Fig.3, respectively. 30a indicates a signal into which the encoding mode is encoded, and 30b indicates a signal into which the difference value is encoded. 31a indicates a decoder which decodes the signal into which the encoding mode is encoded and obtains a predicted mode signal. 31b indicates a decoder which decodes the signal into which the difference value is encoded and obtains a decoded difference value signal. 32 indicates a switching unit which switches the predicted values of change pixels in response to the predicted mode signal obtained by the decoder 31a. 34 indicates a decoded image signal. The apparatus has the same memory 3, the change pixel decoder 10, and the difference value adder 11 as those in Fig.1 and the same motion compensation unit 20 as that in Fig.3. Their descriptions is the same as those in the 1st and 2nd embodiments, and is therefore omitted here. A description is given of the image decoding apparatus according to the 3rd embodiment shown in Fig.5 as constructed above. The image decoding apparatus according to the 3rd embodiment receives the input signal 30a which is the signal 9a into which the selected encoded mode has been encoded in the image encoding apparatus according to the 2nd embodiment, and the input signal 30a is decoded in the decoder 31a, and the predicted mode signal indicating "particular frame" or "reference frame" is obtained. The decoder 31a outputs the predicted mode into the switching unit 32. Also, the image decoding apparatus according to the 3rd embodiment receives the input signal 30b which is the signal 9b into which the selected difference value has been encoded in the image encoding apparatus according to the 2nd embodiment, and the input signal 30b is decoded in the decoder 31b, and the decoded difference value is obtained. The decoder 31b outputs the decoded difference value into the difference value addition means 11. On the other hand, the change pixel predictor 4a reads out an already decoded reference image of the particular frame stored in the memory 3, and predicts a change pixel based on the particular image signal, and outputs the result as a predicted change pixel based on the particular frame into the switching unit 32. Also, the motion compensation unit 20 subjects an already decoded image of a reference frame stored in the memory 3 to the motion compensation. The change pixel predictor 4b predicts the change pixel of the particular input signal based the motion-compensated pixel, and outputs the result as a predicted change pixel based on the reference frame into the switching unit 32. The switching unit 32 into which the change pixel predictors 4a and 4b output the predicted pixels, performs switching according to the input predicted mode signal. Accordingly, the switching unit 22 selects the predicted change pixel based on the particular frame output by the change pixel predictor 4a if the input predicted mode signal indicates "particular frame", or selects the predicted change pixel based on the reference frame output by the change pixel predictor 4b if the input predicted mode signal indicates "reference frame", and outputs the predicted change pixel to the difference value addition means 11. The difference value addition means 11 calculates a change pixel by adding the predicted change pixel obtained by the switching unit 22 with the decoded difference value obtained from the decoder 31b, and outputs the result to the change pixel decoder 10. The change pixel decoder 10, based on the predicted change pixel of the change pixel prediction means 4a and the change pixel obtained by the difference value addition means 11, encodes the pixel value therebetween. The result of this decoding is stored in the memory 3, and is output as a decoded image signal 34 from the image decoding apparatus according to the 3rd embodiment. For example, when the input signal is an encoded signal in such a way as what is described using Fig.4 in the 2nd embodiment, the result of decoding shown in Fig.4(e) is obtained. Fig.6 is a block diagram showing the structure of an application of the image decoding apparatus according to the 3rd embodiment. The difference from the image decoding apparatus shown in Fig.5 is that there are two difference value addition means 11a and 11b, and the switching unit 33 switches not the outputs of the change pixel prediction means 4a and 4b, but the outputs of the difference value addition means 11a and 11b. In this case, the encoded signal output by the image encoding apparatus according to the 2nd embodiment can be appropriately decoded, corresponding to the encoding mode used in the encoding. Further, when the apparatus has a plurality of the change pixel decoders 10 and the switching unit is positioned to receive the outputs of a plurality of the change pixel decoders 10, the same effect is obtained. As described above, the image decoding apparatus according to the 3rd embodiment has the decoder 31a which decodes the encoding mode of the encoded signal, the decoder 31b which decodes the encoded signal of the difference value, the change pixel prediction means 4a which predicts the change pixel based on the particular frame, the change pixel prediction means 4b which predicts the change pixel based on the reference frame using the motion compensation, the difference value addition means 11 which performs decoding based on the predicted change pixel, and the change pixel decoder 10, whereby the switching unit performs switching according to the predicted mode obtained by the decoder 31a, namely the switching unit adaptively switches the decoding based on the particular frame and the decoding based on the reference frame, according to the predicted mode corresponding to the encoding mode which has been used in encoding. Therefore, the encoded signal efficiently encoded in the 2nd embodiment can be appropriately decoded. Note that in the 2nd and 3rd embodiments there can be prepared a plurality of reference frames and three or more predicted modes can be used. Also, in the 3rd embodiment, when the encoded signal is such a signal that is, block by block, encoded with the respective selected encoding modes, the apparatus receives input signals block by block, and obtains the respective predicted modes, and performs processes block by block according to each encoding mode, whereby the encoded signal can be appropriately decoded. Embodiment 4 An image encoding apparatus according to a 4th embodiment not forming part of this invention which adaptively switches the encoding based on the prediction by the horizontal scanning and the encoding based on the prediction by the vertical scanning. Fig.7 is a block diagram showing the structure of the image encoding apparatus according to the 4th embodiment. In the figure, 40a and 40b indicate horizontal scanners, and 41a and 41b indicate vertical scanners. The other numerals indicate the same as those of the Fig.3, and the description of the other numerals is the same as that in the 2nd embodiment, and is therefore omitted here. A description is given of the operation of the image encoding apparatus according to the 4th embodiment. When two-valued signals as input signals are input to the apparatus, the input signal 1 is input to the change pixel detector 2a by being horizontally scanned with the horizontal scanner 40a. The input signal 1 is also input to the change pixel detector 2b by being vertically scanned by the vertical scanner 40a. Further, the input signal 1 is input to the memory 3 and stored therein to be used as an already encoded and decoded reference image of the particular frame. The change pixel detector 2a receives the horizontally scanned input signal 1 and detects pixels changing two-valued pixel values. The change pixel detector 2b receives the vertically scanned input signal 1 and detects pixels changing two-valued pixel values. The change pixel detectors 2a and 2b output the result of the detection as detected change pixels to the difference value calculators 5a and 5b, respectively. On the other hand, the horizontal scanner 40b reads out the already encoded and decoded reference image of the particular frame stored in the memory 3, horizontally scans the reference image to the change pixel predictor 4a to output the same. The predictor 4a predicts change pixels to output the predicted change pixels to the difference value calculator 5a. Following this, the difference value calculator 5a subtracts the predicted change pixel from the detected change pixel and obtains a difference value Dh by the horizontal scanning. The output Dh of the difference value calculator 5a corresponds to the prediction error predicted by the horizontal scanning. The difference value calculator 5a outputs the difference value Dh to the mode selector 21 and the switching unit 22. On the other hand, the vertical scanner 41b reads out the already encoded and decoded reference image of the particular frame stored in the memory 3, vertically scans the reference image to the change pixel predictor 4b to output the same. The predictor 4b predicts change pixels and outputs the predicted change pixels to the difference value calculator 5b. Following this, the difference value calculator 5b subtracts the predicted change pixel from the detected change pixel and obtains a difference value Dv by the vertical scanning. The output Dv of the difference value calculator 5b corresponds to the prediction error predicted by the vertical scanning. The difference value calculator 5b outputs the difference value Dv to the mode selector 21 and the switching unit 22. The mode selector 21 compares the code lengths(the required bit number for encoding) of the difference values Dh and Dv input from the difference value calculators 5a and 5b when respectively encoded, and select the prediction method which requires a smaller bit number for encoding, and outputs the identifying signal as an encoding mode. The mode selector 21 outputs the encoding mode "horizontal direction" if the code length is short when the difference value Dh is encoded, or outputs the encoding mode "vertical" if the code length is short when the difference value Dv is encoded, to the switching unit 22 and the encoder 8a. The switching unit 22, responding to the output of the mode selector 21, outputs the difference value Dh output by the difference value calculator 5a if the encoding mode is "horizontal direction", or outputs the difference value Dv output by the difference value calculator 5b if the encoding mode is "vertical direction". The encoder 8a encodes the encoding mode selected by the mode selector 21 and outputs an encoded signal 9a. The encoder 8b encodes the output difference value and outputs an encoded signal 9b. The image encoding apparatus according to the 4th embodiment performs loss-less encoding without rounding the error and stores the input image signal 1 as the encoded and decoded pixel values up to the change pixel as described above, in the memory 3. Fig.8 is a drawing for explaining how the scanning directions are switched by the image encoding apparatus according to the 4th embodiment. The image signal has correlations in the horizontal and vertical directions. The prior art image encoding method utilizes these correlations for compression. Concerning the application of the correlation in the prior art technology, as can be seen in, for example, MMR, the encoding is carried out based on only a correlation in either the horizontal direction or the vertical direction. However, if the image is observed locally, either of the correlations in the horizontal or vertical direction is sometimes the strongest. For example, as shown in Fig.8, if the correlation in the horizontal direction is stronger than that in the vertical direction, the prediction error of the change pixel at the pixel position becomes smaller based on the prediction in the vertical direction rather than based on the prediction in the horizontal direction, whereby enabling the encoding efficiency to be improved. Accordingly, switching the vertical-direction prediction and the horizontal-direction prediction according to the nature of the image largely contributes to the improvement of the encoding efficiency. As described above, in the image encoding apparatus according to the 4th embodiment, by including the horizontal scanners 40a and 40b, the vertical scanners 41a and 41b, the change pixel detectors 2a and 2b, the memory 3, the change pixel predictors 4a and 4b, and the difference value calculators 5a and 5b, the prediction is performed in the horizontal and vertical directions, and the difference value between the predicted value and the detected result is then obtained for both the directions; and by including the mode selector 21, the switching unit 22, and the encoders 8a and 8b, the difference from the prediction by the horizontal scanning and the difference from the prediction by the vertical scanning are compared and the difference value which has the minimum code length is selected and encoded, whereby the bit number required for encoding by utilizing the local change of the horizontal and vertical correlations can be reduced to a large extent. Note that, also in the image encoding apparatus according to the 4th embodiment, the input signal 1 is input block by block and the encoding mode is also selected for respective blocks. That is, the apparatus performs adaptively switching the encoding based on the prediction by the horizontal scanning and the encoding based on the prediction by the horizontal scanning, block by block, whereby the above-mentioned effect is obtained. Further, also in the image encoding apparatus according to the 4th embodiment as well as the 2nd embodiment, it is possible that the change pixel detector 2 and the change pixel predictors 4a and 4b output not the distance (pixel number) to a change pixel, but a two-valued signal representing the state of the change of the pixel, whereby the process load can be reduced. Embodiment 5 An image decoding apparatus according to a fifth embodiment not forming part of this invention appropriately decodes the encoded signal which is efficiently encoded by the image encoding apparatus according to the 4th embodiment. Fig.9 is a block diagram showing the structure of the image decoding apparatus according to the 5th embodiment In the figure, 40b and 41b are similar to those of Fig.7, and the other numerals are similar to those of the 3rd embodiment, and their description is similar to those of the 3rd and 4th embodiments, so therefore is omitted. The operation of the image decoding apparatus according to the 5th embodiment as constructed above is explained. The image decoding apparatus according to the 5th embodiment receives the input signal 30a which is the signal 9a into which the selected encoded mode has been encoded in the image encoding apparatus according to the 4th embodiment, and the input signal 30a is decoded in the decoder 31a, and the predicted mode signal indicating "horizontal direction" or "vertical direction" is obtained. The decoder 31a outputs the predicted mode into the switching unit 32. Also, the image decoding apparatus according to the 5th embodiment receives the input signal 30b which is the signal 9b into which the selected difference value has been encoded in the image encoding apparatus according to the 4th embodiment, and the input signal 30b is decoded in the decoder 31b, and the decoded difference value is obtained. The decoder 31b outputs the decoded difference value into the difference value addition means 11. On the other hand, the horizontal scanner 40b reads out the already encoded and decoded reference image of the particular frame stored in the memory 3, horizontally scans and outputs the reference image to the change pixel predictor 4a. The predictor 4a predicts change pixels and outputs the result as predicted change pixels to the switching unit 22. On the other hand, the vertical scanner 41b reads out the already encoded and decoded reference image of the particular frame stored in the memory 3, vertically scans the reference image to the change pixel predictor 4b and outputs the same. The predictor 4b predicts change pixels and outputs the predicted change pixels to the switching unit 22. The switching unit 22 into which the change pixel predictors 4a and 4b output the predicted pixels, performs switching according to the input predicted mode signal. Accordingly, the switching unit 22 selects the predicted change pixel based on the horizontal scanning output by the change pixel predictor 4a if the input predicted mode signal indicates "horizontal direction", or selects the predicted change pixel based on the vertical scanning output by the change pixel predictor 4b if the input predicted mode signal indicates "vertical direction", and outputs the predicted change pixel to the difference value addition means 11. The difference value addition means 11 calculates a change pixel by adding the predicted change pixel obtained by the switching unit 22 to the decoded difference value obtained from the decoder 31b, and outputs the result to the change pixel decoder 10. The change pixel decoder 10, based on the predicted change pixel of the change pixel prediction means 4a and the change pixel obtained by the difference value addition means 11, encodes the pixel value therebetween. The result of this decoding is stored in the memory 3, and is output as a decoded image signal 34 from the image decoding apparatus according to the 5th embodiment. As described above, the image decoding apparatus according to the 5th embodiment has the decoder 31a which decodes the encoding mode of the encoded signal, the decoder 31b which decodes the encoded signal of the difference value, the change pixel prediction means 4a which predicts the change pixel based on the horizontal-direction scanning, the change pixel prediction means 4b which predicts the change pixel based on the vertical-direction scanning, the difference value addition means 11 which performs decoding based on the predicted change pixel, and the change pixel decoder 10, whereby the switching unit performs switching according to the predicted mode obtained by the decoder 31a, namely the switching unit adaptively switches the decoding based on the horizontal-direction scanning and the decoding based on the vertical-direction scanning, according to the predicted mode corresponding to the encoding mode which has been used in encoding, and therefore the encoded signal efficiently encoded in the 4th embodiment can be appropriately decoded. Note that in the 5th embodiment there is described the image decoding apparatus which is constructed based on the structure shown in Fig.5 of the 3rd embodiment, however, the apparatus can be constructed based on the structure shown in Fig.6 of the 3rd embodiment, or as described in the 3rd embodiment the switching unit can receive the output of the change pixel decoder in the 5th embodiment, and it is also possible to perform appropriate decoding. Also, in the 5th embodiment, when the encoded signal is such a signal that is, block by block, encoded with the encoding modes selected for respective blocks, the apparatus receives input signals block by block, and obtains the predicted modes for respective blocks, and performs processes block by block according to respective encoding modes, whereby the encoded signal can be appropriately decoded. Embodiment 6 An image encoding apparatus according to a 6th embodiment not forming part of this invention with greater efficiency encodes multi-valued image signals. Fig.10 is a block diagram showing the structure of the image encoding apparatus according to the 6th embodiment. In the figure, an input signal 1a is input to the image encoding apparatus according to the 6th embodiment as a multi-valued signal. Thus, what is different from the 1st embodiment is that the multi-valued signal is input and processed and that there is included two encoders. The other points are similar to those of the 1st embodiment. The description of these is similar to the 1st embodiment, and is therefore omitted. A description is given of the image encoding apparatus according to the 6th embodiment as constructed above. When the input signal 1a is input, the change pixel detector 2, for this multi-valued input signal, compares the pixel value at the final encoding and the decoding position with the pixel value at the next position, and judges whether each pixel corresponds to "change" or to "non-change". Thereafter, a change pixel number, the number of pixels which is judged as "change", is calculated, and compared with the given value. Here, the given value is assumed to be 60. The pixel which is judged as "change" and of which the change pixel number is beyond 60 is defined as a change pixel, and the pixel value and position of the change pixel are output as a detected change pixel to the difference value calculator 5, the change pixel decoder 10 and the encoder 8a. On the other hand, the change pixel predictor 4 reads out the already encoded and decoded reference image of the particular frame stored in the memory 3, and predicts a change pixel based on the particular input signal, and outputs the result as a predicted change pixel to the difference value calculator 5, the difference value adder 11 and the change pixel decoding means. The difference value calculator 5 subtracts the predicted change pixel from the detected change pixel and obtains the difference value and outputs the difference value to the encoder 8b and difference adder 11. The difference value adder 11 adds the input predicted change pixel and the difference value, and outputs the result to the change pixel decoder 10. The change pixel decoder 10 decodes the pixel values of pixels up to the change pixel and the pixel value of the change pixel based on the input, and stores the result in the memory 3. The encoders 8a and 8b encode the pixel values of the input change pixels and the difference values, and output the encoded signals 9a and 9b, respectively. As described above, in the image encoding apparatus according to the 6th embodiment having a structure similar to that of the 1st embodiment, whether there exists the change or not is judged pixel by pixel, the number of pixels which are judged as "change" is calculated, and if the number of pixels judged as "change" is equal to or greater than the threshold, they are defined as the change pixel, whereby not only is it possible to perform the similar encoding for only two-valued images, but also for multi-valued images. Embodiment 7 An image decoding apparatus according to a 7th embodiment not forming part of this invention decodes the encoded signal encoded by the image encoded apparatus according to the 6th embodiment and obtains a multi-valued signal. Fig.11 is a block diagram showing the structure of the image decoding apparatus according to the 7th embodiment. In the figure, a decoder 31a decodes the encoded signal into which the pixel values of change pixels are encoded. The decoder 31b decodes the encoded signal into which the predicted difference values are encoded. The other points are similar to those of Fig.5. The description of these points is similar to those of the 3rd embodiment, and is therefore omitted. A description is given of the image decoding apparatus according to the 7th embodiment as constructed above. The image decoding apparatus according to the 7th embodiment receives the input signal 30a which is the signal 9a into which the pixel values of change pixels have been encoded in the image encoding apparatus according to the 6th embodiment, and the input signal 30a is decoded in the decoder 31a, and decoded pixel values are obtained and the decoded pixel values are output to the change pixel decoder 10. On the other hand, the image decoding apparatus according to the 7th embodiment receives the input signal 30b which is the signal 9b into which the predicted difference values have been encoded in the image encoding apparatus according to the 6th embodiment, and the input signal 30b is decoded in the decoder 31b, and decoded difference values are obtained and the decoded difference values are output to the change pixel decoder 10. On the other hand, the change pixel predictor 4 reads out the already encoded and decoded reference image stored in the memory 3, and predicts a change pixel based on the particular image signal to output the predicted change pixel to the change pixel decoder 10 and difference value adder 11. The difference value adder 11 adds the input predicted change pixel and the difference value, and outputs the result to the change pixel decoder 10. The change pixel decoder 10 decodes the pixel values of pixels up to the change pixel and the pixel value of the change pixel based on the input, and stores the result in the memory 3. As described above, the image decoding apparatus according to the 7th embodiment has the decoder 31a which decodes the encoded signal into which the pixel values of change pixels are encoded and the decoder 31b which decodes the encoded signal into which the predicted difference values are encoded, whereby the encoded signal encoded by the image encoding apparatus according to the 6th embodiment can be appropriately decoded to obtain a multi-valued image signal. Embodiment 8 An image encoding apparatus according to an 8th embodiment not forming part of this invention receives an image signal consisting of a transparency signal indicating the ratio for synthesizing an image and a pixel value signal, as an input signal, and encodes the input signal with reference to a reference image. Fig.12 is a block diagram showing the structure of the image encoding apparatus according to the 8th embodiment. In the figure, 60a indicates a pixel value signal. 60b indicates a transparency signal. The pixel value signal and the transparency signal constitute a image signal and are input to the image encoding apparatus according to the 8th embodiment as input signals. 61 indicates a memory which temporarily stores data such as previously encoded and decoded image signals used as reference images. 62a and 62b indicate motion detectors which detect motion with the reference images to output motion vectors. 63a and 63b indicate motion compensation units which perform motion compensation with the image signal of the already encoded and decoded reference frame to generate reference pixel values. 64a and 64b indicate difference value calculators which calculate the difference value between the input signal and the motion-compensated signal, and output the difference value. 65a and 67b indicate encoders which encode the motion vectors. 67a and 65b indicate encoders which encode the difference values. 66a and 68b indicate encoded signals into which the motion vectors are encoded. 68a and 66b indicate encoded signals into which the difference values are encoded. A description is given of the image encoding apparatus according to the 8th embodiment as constructed above. The image encoding apparatus according to the 8th embodiment receives image signals, as the pixel value signal 60a and the transparency signal 60b. Here, the transparency signal is such a signal as shown in Fig.23(b) used for explaining the prior art, and indicates what ratio is used for synthesizing each pixel when it is combined with the other image. The pixel value signal 60a is input to the memory 61, the motion detector 62a and the difference value calculation means 64a. The transparency signal 60b is input to the memory 61, the motion detector 62b and the difference value calculation means 64b. The motion detectors 62a and 62b perform detecting motions by comparing the input signals with the already encoded and decoded pixel values contained by the reference image read out from the memory 61, and obtain motion vectors of each input signal. The motion vectors of the pixel value signals obtained by the motion detector 62a are output to the encoder 65a, the motion compensation unit 63a and the memory 61. The motion compensation unit 63a reads out the pixel value indicated by the motion vector of the pixel value signal from the memory 61, and outputs the motion-compensated value of the pixel value signal into the difference calculator 64a. The difference calculator 64a calculates the difference value between the input pixel value signal and motion-compensated value and obtains the same, and outputs the difference value to the encoder 67a. The motion vector of the pixel value signal is encoded in the encoder 65a to become encoded signal 66a, while the difference value is encoded in the encoder 67a to become encoded signal 68a. Similarly, the motion vector of the transparency signal obtained from the motion detector 62b is output to the encoder 67b, the motion compensation unit 63b and the memory 61. The motion compensation unit 63b performs motion compensation for the transparency signal, and outputs the obtained motion compensated value to the difference value calculator 64b. On the other hand, the difference value calculator 64b outputs the obtained difference value to the encoder 67a similarly to the 64a. Similar to the pixel value signal, the motion vector of the transparency signal is encoded in the encoder 67b to become the encoded signal 68b, and the difference value is encoded in the encoder 65b to become the encoded signal 66b. The 8th embodiment is an example of a reversible encoding, so that the encoded input signal is stored in the memory 61 and is used for encoding subsequent image signals(not shown). As described above, the image encoding apparatus according to the 8th embodiment has the motion detector 62a, motion compensation unit 63a, difference value calculator 64a, encoder 65a and encoder 67a, all of which process the pixel value signal 60a, and has the motion detector 62b, the motion compensation unit 63b, the difference value calculator 64b, the encoder 65b and the encoder 67b, all of which process the transparency signal 60b, whereby the pixel value signal and the transparency signal are separately subjected to the motion detection to obtain the motion vectors and are also subjected to the motion compensation. As described in the Prior Art section, in the prior art image encoding, when the image consisting of the shape information and pixel value information is encoded, concerning the shape information used for the image synthesis, in order to improve the encoding efficiency, the motion compensation for the shape information is carried out using the motion vector of the pixel value information. Accordingly, when encoding such a signal as the input image signal of the 8th embodiment, the motion compensation encoding for the transparency signal is performed using the motion vector of the pixel value signal. However, although the transparency signal is a signal representing the shape of the object, the motion vector does not always agree with the motion vector of the pixel value signal. For example, although the shape of a rotating disc is invariable, the drawings on the disc move. Hence, in this case, as the motion vector of the pixel value signal is much different from that of the transparency signal, when the motion compensation is performed for the transparency signal using the motion vector of the pixel value signal, the motion error becomes large and the code length of the difference value increases, resulting in the reduction of the encoding efficiency. As opposed to this, the image encoding apparatus according to the 8th embodiment performs motion compensation using another detected motion vectors rather than the motion vector of the pixel value signal and thereby obtains a more precise approximation to the input transparency signal by the motion compensated signal and improves the encoding efficiency as a result of the reduction of the motion compensation error. Also, in the image encoding apparatus according to the 8th embodiment, the input signal can be input block by block, and the motion compensation and the encoding can be performed for respective blocks, whereby the above-mentioned effect is obtained. Embodiment 9 An image encoding apparatus according to a 9th embodiment not forming part of this invention, similarly to the 8th embodiment, receives an image signal consisting of a transparency signal and a pixel value signal, as input signals, and encodes the input signal with reference to a reference image. Fig.13 is a block diagram showing the structure of the image encoding apparatus according to the 9th embodiment. In the figure, the numerals indicate the same as those in Fig.12, and the description is similar to that for the embodiment 8. The difference from the structure of the image encoding apparatus according to the 8th embodiment is that, in the image encoding apparatus according to the 9th embodiment, the motion detector 62a obtains the motion vector from the pixel value signal 60a and outputs the motion vector to the motion detector 62b for the transparency signal 60b, and the motion detector 62b detects the motion from in the vicinity of the motion vector of the input pixel value signal. Also, the operation of the image encoding apparatus according to the 9th embodiment is similar to that of the 8th embodiment except the motion detector 62a performs the above-mentioned output and the motion detector 62b performs the above-mentioned detection. As described above, in the image encoding apparatus according to the 9th embodiment, based on the structure of the 8th embodiment, the motion detector 62a obtains the motion vector from the pixel value signal 60a and outputs the motion vector to the motion detector 62b for the transparency signal 60b, and the motion detector 62b detects the motion of the transparency from in the vicinity of the motion vector of the input pixel value signal. That is, it is possible that when the motion of the transparency signal is detected, the result of the motion detection of the pixel value signal is used. Although the motion vectors of the pixel value signal and the transparency signal are sometimes largely different from each other as shown in the 8th embodiment, they are almost the same in most images. Therefore, when the motion vector of the transparency signal is detected, if the motion vector of the transparency signal is detected only in the vicinity of the motion vector of the pixel value signal, compared to the case of detecting independently of the pixel value signal, the calculation times required for the motion detection is reduced. Note that, compared to the case of the motion detection independent of the pixel value signal the number of motion vectors which can be selected is restricted, so that the motion compensation error of the transparency signal is more or less increased, but the ratio is slight. Accordingly, the image encoding apparatus according to the 9th embodiment as well as the 8th embodiment performs the appropriate motion compensation for each signal, resulting in improving the encoding efficiency and reducing the calculation times of the motion detection. Note that, in the image encoding apparatus according to the 9th embodiment, although the motion vector of the pixel value signal is used for the motion detection of the transparency signal, it is possible that based on the structure of the 8th embodiment, the motion detector 62b obtains the motion vector from the transparency signal 60b and outputs the motion vector to the motion detector 62a for the pixel value signal 60a, and the motion detector 62a detects the motion of the pixel value signal from in the vicinity of the motion vector of the input transparency signal. That is, it is possible that when the motion of the pixel value signal is detected, the result of the motion detection of the transparency signal is used. Also, the calculation times of the motion detection can be reduced. Also, similarly to the 8th embodiment, the block-by-block encoding is possible. Embodiment 10 An image encoding apparatus according to a 10th embodiment not forming part of this invention, similarly to the 8th and 9th embodiments, receives an image signal consisting of a transparency signal and a pixel value signal, as an input signal, and encodes the input signal with reference to a reference image. Fig.14 is a block diagram showing the structure of the image encoding apparatus according to the 10th embodiment. In the figure, 70 indicates a difference calculator for motion vectors which obtains the difference vector between the motion vector of the pixel value signal obtained from the motion detector 62a and the motion vector of the transparency signal obtained from the motion detector 62b. Though the encoder 67b encodes the motion vector of the transparency signal in the 8th embodiment, the encoder 67b encodes the difference vector of the motion vector obtained by the difference value calculator 70 in the 10th embodiment. The other numerals indicate the same as those in Fig.12, and the description is similar to that in the 8th embodiment. The operation of the image encoding apparatus according to the 10th embodiment is similar to that of the 8th embodiment except that the motion detectors 62a and 62b output motion vectors to the difference value calculator 70, and the difference value calculator 70 obtains the above-mentioned difference vector to the encoder 67b and outputs the same, and the encoder 67b encodes the difference vector of the motion vector. As described above, in the image encoding apparatus according to the 10th embodiment, based on the structure of the image encoding apparatus according to the 8th embodiment, the difference value calculator 70 for motion vectors is added to the structure, and thereby, instead of encoding the motion vector of the transparency signal, the difference vector between the motion vectors of the pixel value and the transparency vectors is encoded. As described in the 9th embodiment, since the motion vectors of both the signals often correlate, if the difference vector between the motion vectors of both the signals is encoded, the frequency of occurrence of the difference vector is concentrated in the neighborhood of 0 vector, whereby, performing the variable-length encoding which gives a code of a short code length to the difference vector in the neighborhood of 0 vector, the encoding efficiency is improved and the encoding can be performed with a smaller bit number. Note that, in the image encoding apparatus according to the 10th embodiment, although the difference vector of the motion vectors of both the signals are encoded instead of the motion vectors of the transparency signal, there can be provided the structure in which the difference vector obtained by the difference value calculator 70 is output to the encoder 65a instead of 67b. If the difference vector of the motion vectors of both the signals is encoded instead of encoding the motion vector of the pixel value signal, the same result can be obtained. Also, similar to the 8th embodiment, the block-by-block encoding is possible. Embodiment 11 An image decoding apparatus according to a 11th embodiment of this invention appropriately decodes the encoded signal efficiently encoded by the image encoding apparatus according to the 8th embodiment. Fig.15 is a block diagram showing the structure of the image decoding apparatus according to the 11th embodiment. In the figure, 82a and 82b indicate encoded signals corresponding to the encoded signals 68a and 66b in Fig.12, respectively, into which the difference values in the pixel value signal and in the transparency signal are encoded respectively. 80a and 80b indicate encoded signals corresponding to the encoded signals 66a and 68b in Fig.12, respectively, into which the motion vectors in the pixel value signal and in the transparency signal are encoded respectively. 83a and 83b indicate decoders which decode the difference values in the pixel value signal and in the transparency signal, and output the decoded difference values in the pixel value signal and in the transparency signal, respectively. 81a and 81b indicate decoders which decode the motion vectors of the pixel value signal and of the transparency signal, and output the decoded motion vectors of the pixel value signal and of the transparency signal, respectively. 61 indicates a memory which temporarily stores data such as the already encoded and decoded image signal used as a reference image. 63a and 63b indicate motion compensation units which perform the motion compensation using the decoded motion vectors. 84a and 84b indicate difference value adders which perform the addition processing using the decoded difference values. 85a and 85b indicate decoded image signals. The operation of the image decoding apparatus according to the 11th embodiment as constructed above is explained. The signals 68a and 66b into which the difference values of the pixel value signal and of the transparency signal are encoded by the image encoding apparatus according to the 8th embodiment respectively, are input to the image decoding apparatus according to the 11th embodiment as the input signals 82a and 82b, and are decoded by the decoders 83a and 83b, and are output to the difference value calculators 84a and 84b as the difference values of the pixel value signal and the transparency signal, respectively. The signals 66a and 68b into which the motion vectors of the pixel value signal and of the transparency signal are encoded by the image encoding apparatus according to the 8th embodiment respectively, are input to the image decoding apparatus according to the 11th embodiment as the input signals 80a and 80b, and are decoded by the decoders 81a and 81b, and are output to the motion compensation units 63a and 63b as the motion vectors of the pixel value signal and the transparency signal, respectively. The motion compensation units 63a and 63b read out pixel values indicating the respective input motion vectors from the memory 61, and perform the motion compensation, and output the motion compensated values into the difference value adder 84a and 84b, respectively. The difference value adders 84a and 84b add the respectively input encoded difference value and motion compensated value, and output the decoded image signals 85a and 85b, respectively, which are stored in the memory 61. As described above, the image decoding apparatus according to the 11th embodiment has the decoder 81a, the decoder 83a, the motion compensation unit 63a, and the difference value calculator 84a, all of which perform the process of the encoded signal of the pixel value signal, and has the decoder 81b, the decoder 83b, the motion compensation unit 63b, and the difference value calculator 84b, all of which perform the process of the encoded signal of the transparency signal, whereby the encoded signals 80a and 82a of the pixel value signal, and the encoded signals 80b and 82b of the transparency signal can be separately subjected to the decoding process, whereby decoding can be appropriately performed to obtain the image signal. Note that, in the image decoding apparatus according to the 11th embodiment, although the encoded signal encoded by the image encoding apparatus according to the 8th embodiment is encoded, the encoded signal obtained by the image encoding apparatus according to the 9th embodiment can be appropriately decoded. Also, the signals which have been input block by block and encoded for respective blocks in the 8th and 9th embodiment can be received block by block to be appropriately decoded. Embodiment 12 An image decoding apparatus according to a 12th embodiment of this invention appropriately decodes the encoded signal efficiently encoded by the image encoding apparatus according to the 10th embodiment. Fig.16 is a block diagram showing the structure of the image decoding apparatus according to the 12th embodiment. In the figure, 86 indicates a difference value adder for motion vectors which adds a decoded motion vector and a decoded difference motion vector. The other numerals are similar to those in Fig.15, and the description is similar to that in the 11th embodiment and is therefore omitted here. The operation of the image decoding apparatus according to the 12 the embodiment as constructed above is described. The decoder 81a outputs the decoded motion vector of the pixel value signal obtained by decoding the input signal 80a, to the motion compensation unit 63a and the difference adder 86 for motion vectors. The decoder 80b receives, not the encoded signal of the motion vector of the transparency signal in the 11th embodiment, but the encoded signal 68b of the difference motion vector in the 10th embodiment. The decoder 80b obtains, not the motion vector of the transparency signal by decoding in the 11th embodiment, but the difference vector, and outputs the decoded difference motion vector to the difference adder 86 for motion vectors. The output decoded difference motion vector is the difference vector between the motion vectors of the pixel value signal and the transparency signal. Therefore, by adding the difference vector with the decoded motion vector of the pixel value signal in the difference value adder 86, the motion vector of the transparency signal is obtained. The decoded motion vector of the transparency signal is output to the motion compensation unit 63b. The other part of the operation is the same as the process of the image decoding apparatus according to the 11th embodiment. The decoded signal 85a of the pixel value signal and decoded signal 85b of the transparency signal are the outputs of the apparatus. As described above, the image decoding apparatus according to the 12th embodiment has the structure which is based on the structure of the image decoding apparatus according to the 11th embodiment and which is added to the difference value adder 86 for motion vectors, and thereby performs addition of the decoded motion vector and the decoded difference vector, whereby the encoded signal output by the 10th embodiment which outputs the encoded signal of the difference vector as an encoded signal can be appropriately decoded. Also, it is possible to respond in the situation whereby the encoding is performed block by block as in the 10th embodiment, similar to in the 11th embodiment. Embodiment 13 An image encoding apparatus according to a 13th embodiment not forming part of this invention receives an image signal with blocked shapes which consists of the shape signal indicating the shape of the object and whether the pixel value of pixels is significant or not, and the pixel value signal, as an input signal, and encodes the input signal with reference to a reference image. Fig.17 is a block diagram showing the structure of the image encoding apparatus according to the 13 embodiment. In the figure, 60a indicates a pixel value signal. 60b indicates a shape signal. 60a and 60b constitute the image signal and are input to the image encoding apparatus according to the 8th embodiment as input signals. 69a and 69b indicate decoders which decode the encoded signals of the difference values output by the encoders 67a and 65b. 75a and 75b indicate difference value adders which add the decoded difference value and the motion compensated value, and the result is stored in the memory 61. The other numerals are similar to those in Fig.12, and the description is similar to that in the 8th embodiment and is therefore omitted here. A description is given of the operation of the image encoding apparatus according to the 13th embodiment as constructed above. The image signal with blocked shapes, the input signal, is input to the image encoding apparatus according to the 13th embodiment as the pixel value signal 60a and the shape signal 60b. Here, the shape signal is the one shown in Fig. 23 used in the Prior Art section, consisting of the two-valued information shown in Fig. 23(c) or multi-valued information shown in Fig.23(d). In the case of the multi-valued information, it is similar to the transparency signal in the 8th embodiment. In the image encoding apparatus according to the 13th embodiment, by the process similar to that in the 8th embodiment, the pixel value signal and the shape signal are encoded, and thereby the encoded signal 66a of the motion vector of the pixel value signal, the encoded signal 68a of the difference value of the pixel value signal, the encoded signal 66b of the motion vector of the shape signal and the encoded signal 68b of the difference value of the shape signal are obtained. Although the encoded signal is input to the memory 61 in the apparatus according to the 8th embodiment, in the 13 embodiment the encoded difference values are respectively decoded in the decoders 69a and 69b, and are output to the difference value adders 75a and 75b, and are added to the motion compensated values output by the motion compensation units 63a and 63b in the difference value adders 75a and 75b, and are input to the memory 61. Accordingly, the reference image used for the encoding is encoded and decoded, and is added to the motion compensated value, which is the difference from the 8th embodiment. As described above, the image encoding apparatus according to the 13th embodiment has the structure which is based on the structure of the image encoding apparatus according to the 8th embodiment and which is added to the decoders 69a and 69b and the difference value adders 75a and 75b, and therefore, similarly to the 8th embodiment, by reducing the motion compensation error the improvement of the encoding efficiency is realized, and moreover, though there accompanies a slight increase in the processing load, with the use of the more appropriate signal which is encoded and decoded as a reference image, and is added to the motion compensated value, a further reduction of the motion compensation error can be realized. Note that, the encoded signal output by the image encoding apparatus according to the 13th embodiment, similarly to the 8th embodiment, in the image decoding apparatus according to the 11th embodiment, is appropriately encoded. Embodiment 14 An image encoding apparatus according to a 14th embodiment not forming part of this invention, similar to the 13th embodiment, receives an image signal consisting of a shape signal and a pixel value signal as an input signal, and referring to a reference image, encodes this input signal. Fig.18 is a block diagram showing the structure of the image encoding apparatus according to the 14th embodiment. In the figure, the numerals are the same as those in Fig.17, and the description is similar to that in the 13 embodiment. In the image encoding apparatus according to the 14th embodiment, similar to the 9th embodiment, the motion detector 62a for the pixel value signal 60a outputs the motion vector of the obtained pixel value signal to the motion detector 62b for the transparency signal 60b, and the motion detector 62b performs the motion detection of the transparency signal in the vicinity of the motion vector of the input pixel value signal, which is the difference from the structure of the image encoding apparatus according to the 13th embodiment. Also, the operation of the image encoding apparatus according to the 14th embodiment is similar to that of the 13 embodiment, , except that the motion detector 62a performs the above-mentioned output and the motion detector 62b performs the above-mentioned detection. As described above, in the image encoding apparatus according to the 14th embodiment, based on the structure of the 13th embodiment, the motion detector 62a for the pixel value signal 60a outputs the motion vector of the obtained pixel value signal to the motion detector 62b for the shape signal 60b, and the motion detector 62b performs the motion detection of the shape signal in the vicinity of the motion vector of the input pixel value signal, and thereby similar to the 9th embodiment, at the time of the motion detection of the shape signal, using the result of the motion detection of the pixel value signal, the calculation times of the motion detection can be reduced. Note that, the possible structure in which the motion vector of the pixel value signal can be detected in the vicinity of the motion vector of the shape signal, is similar to that of the 9th embodiment, and it is similar to the 13th embodiment in which the encoded signal is obtained by the image encoding apparatus according to the 14th embodiment. Embodiment 15 An image encoding apparatus according to a 15th embodiment, similarly to the 13th and 14th embodiments, receives an image signal consisting of a shape signal and a pixel value signal as an input signal, and referring to a reference image, encodes this input signal. Fig.19 is a block diagram showing the structure of the image encoding apparatus according to the 15th embodiment. In the figure, the difference calculator 70 of the motion vector is similar to that of the 10th embodiment shown in Fig.13. And, the encoder 67b, similarly to that in the 10th embodiment, encodes the difference vector of the motion vector obtained by the difference value calculator 70. The other numerals indicate the same as those in Fig.17, and the description is similar to that of the 13 embodiment. Concerning the operation of the image encoding apparatus according to the 15th embodiment, the motion detectors 62a and 62b output the motion vectors to the difference value calculator 70, and the difference value calculator 70 obtains the above-mentioned difference vector to output to the encoder 67b, and the encoder 67b encodes the difference vector of the motion vector, which is similar to that of the 10th embodiment, while the other operations are similar to those of the 13th embodiment. As described above, the image encoding apparatus according to the 15th embodiment is based on the structure of the image encoding apparatus according to the 13th embodiment and is added to the difference value calculator 70 of the motion vector, and thereby encodes the difference vector between the motion vector of the pixel value signal and the motion vector of the shape signal instead of encoding the motion vector of the shape signal. Accordingly, similar to the 10th embodiment, the performance of the variable-length encoding enables the further improvement of the encoding efficiency to be realized. Note that the case of encoding the difference vector instead of encoding the motion vector of the pixel value signal is possible, which is similar to the 10th embodiment. Also, the encoded signal output by the image encoding apparatus according to the 15th embodiment can be, similarly to that in the 10th embodiment, appropriately decoded by the image decoding apparatus according to the 12th embodiment. Embodiment 16 An image encoding apparatus according to a 16th embodiment, similar to the 13th to 15th embodiments, receives an image signal consisting of a shape signal and a pixel value signal as an input signal, and referring to a reference image, encodes this input signal. Fig.20 is a block diagram showing the structure of the image encoding apparatus according to the 16th embodiment. In the figure, 90 indicates the motion detector judgment unit which receives the input shape signal 60b and the motion vectors of the pixel value signal output by the motion detector 62a, and judges the propriety of the motion compensation of the shape signal with the motion vector of the pixel value signal, and according to the judgment, outputs the instruction whether the motion detection will be performed or not, to the motion detector 62b. The operation of the above-constructed image encoding apparatus according to the 16th embodiment is described. The processing of the pixel value signal 60a input to the image encoding apparatus according to the 16th embodiment, except for the point that the motion vector of the pixel value signal obtained in the motion detector 62a is also output to the motion detection judgment unit 90, is similar to the 13th embodiment, and thereby the encoded signal 66a of the motion vector of the pixel value signal and the encoded signal 68a of the difference value of the pixel value signal are obtained. On the other hand, the input shape signal 60b is first input to the motion detection judgment unit 90. The motion detection judgment unit 90 performs the motion compensation of the input shape signal 60b using the motion vector of the input pixel value signal, and compares the motion-compensated shape signal with the input shape signal 60b, and judges whether both the shape signals have agreement or not. Thereafter, if there exists agreement, the motion vector of the pixel value signal is output to the motion detector 61b, and the motion detector 61b does not perform the motion detection of the shape signal and the input motion vector of the pixel value signal is substituted for the motion vector of the shape signal. As opposed to this, if there does not exist agreement in the result of the comparison of the motion detection judgment 90, the motion detection judgment 90 outputs such an instruction to the motion detector 61b that the motion detector 61b performs the motion detection, and the motion vector is calculated by the motion detector 61b. For the shape signal, the remaining processes are similar to those of the 13th embodiment, and the encoded signals 66b and 68b are obtained. As described above, the image encoding apparatus according to the 16th embodiment has the structure of the image encoding apparatus according to the 13th embodiment which is added to the motion detection judgment unit 90, and judges the propriety of the performance of the motion compensation of the input shape signal using the motion vector of the input pixel value signal, and if the result of the judgment is that it is possible, the motion detection for the input shape signal is not performed and thereby the omission of the calculation realizes the reduction of the processing load. If the result of the judgment is that it is impossible, the motion detection for the input shape signal is performed similarly to the 13th embodiment and thereby the encoding efficiency and picture quality of the encoded signal are not affected. Note that, in the 16th embodiment, although the detection of the shape signal is not performed when the motion-compensated shape signal and the input shape signal have agreement, if the slight degradation of the encoding efficiency due to the increase in the motion compensation error is tolerable, it is also possible that the motion detection is not performed when the error due to the motion compensation in the judgment is equal to or smaller than the given value, and thereby a further reduction of the processing load can be realized. Embodiment 17 An image encoding apparatus according to a 17th embodiment, similar to the 13th to 16th embodiments, receives an image signal consisting of a shape signal and a pixel value signal as an input signal, and referring to a reference image, encodes this input signal. Fig.21 is a block diagram showing the structure of the image encoding apparatus according to the 17th embodiment. In the figure, 93 indicates the switching judgment unit which receives the motion vectors of the pixel value signal and shape signal, and similarly to 16th embodiment, judges the propriety of the motion compensation of the shape signal using the motion vector of the pixel value signal, and according to the judgment, gives an instruction to the switching unit 94. The switching unit 94, according to the instruction of the switching judgment unit 93, switches the motion vector of the pixel value signal and the motion vector of the shape signal for the output to the difference value calculator 70. The memory 95 for the motion vector performs the temporal storage in order to input the motion vector output by the switching unit 94 to the difference value detector 70 after a delay. The other numerals are similar to those of Fig.19, and the description is similar to that of the 15th embodiment. The operation of the image encoding apparatus according to the 17th embodiment is similar to that of the 15th embodiment, except for that according to the judgment of the switching judgment unit 93, the two embodiments differ in the difference motion vector to be obtained by the difference value calculator 70, so the operation of that alone is described. The switching judgment unit 93 receives and compares the encoded signal of the motion vector of the pixel value signal and the motion vector of the shape signal, both of which are of the immediately previous encoded input signal, and checks whether the motion vector of the shape signal of the immediately previous encoded input signal is already encoded or not. That is, by processing the immediately previous encoded input signal, it is checked whether the encoded signal of the difference motion vector obtained from the encoder 67b has been the difference vector between the motion vector of the pixel value signal and the motion vector of the shape signal, or the difference vector between the motion vectors of the shape signals. Thereafter, when the difference vector of the motion vectors of the shape signals has been encoded, by sending an instruction to the switching unit 94, the motion vector detected from the shape signal is input to the memory 95 for delay. Accordingly, in this case, the encoder 67b obtains the difference vector between the immediately previous encoded motion vector of the shape signal obtained from the memory 95 for delay and the motion vector detected from the input shape signal, and encodes the difference vector. On the other hand, when the difference vector between the motion vectors of the pixel value and shape signals of the immediately previous input signal has been encoded, by sending an instruction to the switching unit 94, similarly to the 15th embodiment, the difference vector of the motion vectors of both the signals is to be encoded. As described above, the structure of the image encoding apparatus according to the 17th embodiment is based on the structure of the image encoding apparatus according to the 15th embodiment and is added to the switching judgment 93, the switching unit 94 and the memory 95 for delay, and thereby when the motion vector of the immediately previous shape signal is encoded, the difference vector between the motion vector and detected motion vector are obtained and encoded, and the encoding efficiency can be improved by utilizing the difference between the motion vectors of the shape signals which highly correlate. Note that, in the 17th embodiment, although the judgment and the encoding of the difference vector are performed for the motion vector of the shape signal, the judgment and the encoding of the difference vector can be also performed for the motion vector of the pixel value signal, and similarly, an improvement of the encoding efficiency can be realized. Embodiment 40 An image encoding program recording medium and an image decoding program recording medium realize the image encoding apparatuses and the image decoding apparatuses according to the 1st to 17th embodiments. Fig. 22 shows a floppy disk which is an example of a recording medium which records the program. An image encoding program which is recorded in the floppy disk shown in Fig. 22, is executed on a personal computer or a work station or the like, and thereby realizes the image encoding apparatus according to the 2nd embodiment. Similarly, an image decoding program is recorded on the floppy disk shown in Fig. 22, is executed on a personal computer or a work station or the like, and thereby realizes the image decoding apparatus according to the 3rd embodiment. This case is, in the same embodiment, one in which the selection is performed by the switch after the change pixel encoding process as described using Fig.6. As described above, the program recording media according to the 40th embodiment record the image encoding program or the image decoding program, and thereby on a computer system such as an ordinary personal computer and the like, the image encoding apparatus or the image decoding apparatus according to this invention can be realized. Note that, in the 40th embodiment, although the image encoding apparatus according to the 2nd embodiment and the image decoding apparatus according to the 3rd embodiment are recorded, the apparatuses according to the other embodiments can be similarly realized. Further, in the 40th embodiment, although the floppy disk is presented as a recording medium, an IC card, a CD-ROM, an optical disc and a cassette tape or the like can be similarly employed, if it is a medium which can record the programs.

Claims: An image decoding apparatus which receives an encoded signal {80a, 80b, 82a, 82b) of an image, and decodes the encoded signal, comprising: a pixel value decoding unit (83a) operable to decode an encoded difference value (82a) of a pixel value signal included in the encoded signal to obtain a decoded difference pixel value signal of a target image; a pixel value motion vector decoding unit (81a) operable to decode an encoded pixel value motion vector (80a) included in the encoded signal to obtain a decoded pixel value motion vector of the target image; a first motion compensation unit (63a) operable to compensate a pixel value signal of a reference image using the decoded pixel value motion vector of the target image to obtain the result of the motion compensation as the compensated pixel value signal of the target image; and a calculation unit (84a) operable to add the decoded difference pixel value signal of the target image and the compensated pixel value signal of the target image to obtain the result (85a) of the addition as a decoded pixel value signal of the target image; said image decoding apparatus being characterized by further including: a shape motion vector decoding unit (81b) operable to decode an encoded shape motion vector (80b) included in the encoded signal to obtain a decoded shape motion vector of the target image; a second motion compensation unit (63b) operable to compensate a shape signal of the reference image using the decoded shape motion vector of the target image to obtain the result of the motion compensation as a compensated shape signal of the target image; and a shape decoding unit (83b) operable to decode a shape information (82b) included in the encoded signal of the target image by referring to the compensated shape signal of the target image to obtain a decoded shape signal of the target image.

Inventors: KADONO SHINYA, KADONO, SHINYA
Applicants: MATSUSHITA ELECTRIC IND CO LTD, MATSUSHITA ELECTRIC INDUSTRIAL CO., LTD.
Application year: 1997
Main classification: H04N1
IPC codes: H04N7, G06T9