Coding device and decoding device of digital image signal

Abstract: A coding device of a digital image signal coding highly efficiently a digital image signal by using a bidirectional motion compensating prediction and a DCT (digital cosine transform) transformation thereby compressing information, including means for inputting reference images for coding images for a bidirectional prediction to a spatial region as data and blocking the data, means for coding the blocked data, means for writing the coded data to a memory, means for reading reference regions for calculating a motion vector for prediction or data of the reference regions for calculating a prediction value from the memory, means for decoding the read data, and means for calculating the motion vector or means for calculating the prediction value by using the decoded data.

Description: BACKGROUND OF THE INVENTION FIELD OF THE INVENTION The present invention relates to a coding device and a decoding device of a digital image signal. DISCUSSION OF THE BACKGROUND Figure 12 is a block diagram of a coder with respect to an image signal portion in coding an information source in MPEG (Moving Picture Experts Group) 1 described on page 105 of "Pointwisely illustrated Newest MPEG Textbook" supervised by Hiroshi Fujiwara, edited by the "Multimedia Communication Research Association" and issued by ASCII Corporation on August 1, 1994. In Figure 12, numeral 1 designates a video input unit, numeral 2 designates a difference former, numeral 3 designates a coding control unit, numeral 4 designates a DCT (Discrete Cosine Transform) transformer, numeral 5 designates a quantizer, numeral 6 designates a dequantizer, numeral 7 designates an inverse DCT transformer, numeral 8 designates an adder, numerals 9 and 10 designate switches, numerals 11 and 12 designate prediction memories and numeral 13 designates an averaging circuit. Next, an explanation will be given of the operation. An image signal is provided from the video input unit 1 and the signal is coded in accordance with the standards of MPEG. There is adopted in MPEG 1 discrete cosine transform (hereinafter "DCT") as a high efficiency coding method utilizing spatial correlation and bidirectional motion compensating interframe prediction as a means for utilizing temporal correlation. The DCT calculation is carried out by the DCT transformer 4. Image data at a position where the motion is compensated is read from the prediction memory 11 or the prediction memory 12 and a difference is calculated at the difference former 2. Further, the data is transformed into data in frequencies by the DCT transformer 4 and thereafter, quantization allocating quantization levels corresponding to approximated representative values with respect to the result of calculation by the DCT transformer is carried out by the quantizer 5. Although not expressed in Figure 12, information of a motion vector, a macroblock type, quantization designating information and quantization transforming coefficient is compressed by using variable code length formation allocating a code length in accordance with the frequency of occurrence of data. The quantization transforming coefficient outputted from the quantizer 5 is transformed into a representative value by the dequantizer 6 while it is formed into a variable length code. By restoring the result to data in the spatial region by the inverse DCT transformer 7 it is restored to have a value proximate to that of data before inputting it to the DCT transformer 4. The data which has been subjected to the inverse DCT formation, is added to image data at a position where the motion is compensated, which is read from the prediction memory 11 or the prediction memory 12. This addition is carried out by the adder 8. In this way the data is restored to the data in the spatial region where the motion compensating prediction is restored to an original state and therefore, the data can be used in the next prediction. The averaging circuit 13 is a circuit averaging with rounding a prediction temporally in the forward direction and a prediction temporally in the backward direction between corresponding pixels. The switch 10 is controlled to switch in accordance with the prediction mode or a storage state of the memory 11 or 12. This control is governed by the coding control unit 3. An image information for predicting a temporally coded frame from future and an image information for predicting it from past are stored in the two prediction memories 11 and 12 and the coder's side switches to use them. There are two prediction modes, namely, the intra mode which does not use temporally preceding and succeeding frames and the MC (motion compensating) mode. According to the MC mode either of the predictions of the two prediction memories 11 and 12 or an average of the both predictions can be utilized. To realize the bidirectional prediction, according to the MPEG, images are provided with I picture (Intra-Picture), P picture (Predictive-Picture) and B picture (Bidirectionally predictive-Picture). I picture is referred to as a frame that is formed without using interframe prediction among an aggregation of dynamic images (hereinafter "GOP" (Group of Pictures)) and a minimum of one picture is necessary in one GOP. P picture is an image formed by conducting prediction from I or P picture in which the prediction in the forward direction is used. In this picture the intra mode where the pattern of the macroblock does not use prediction can be mixed. B picture is in a form mixed with an average of prediction in both directions of the prediction only in the forward direction and the prediction only in the backward direction, and the intra mode. The relation among the respective pictures is normally under a constant relationship. That is, the interval between I pictures is equal to the interval between GOPs and B pictures are inserted between I picture and P picture and this relationship normally remains unchanged in the midst of coding. Figure 13 is a diagram showing this relationship. Original image is inputted from the video input unit 1 and normally, an aggregation of 15 frames of dynamic images is often coded. In this case GOP is constituted by a unit of 15 frames and I picture is often allocated at a third frame in GOP. At the start of coding, with respect to B pictures at initial two frames in front of I picture, although the prediction in the backward direction is conducted, in the midst of coding the bidirectional prediction from the last one of P picture in the preceding GOP and the I picture in the current GOP can be carried out. Also, according to Figure 13, two frames of B pictures are inserted between I picture and P picture. It is necessary to code and output frames by rearranging the order of the frames due to the presence of B frames. Once I pictures or the P pictures are coded, they are immediately output. However, with regard to B pictures, coded data is stored and is outputted after I pictures or P pictures have been outputted. That is, it is determined that the data is outputted in an order specified in the data at a stage of coding in Figure 13. Therefore, it is necessary that the data which has been quantized once in the frequency region of DCT, is restored to data in the original spatial region and further to a data where the motion compensating prediction is restored and a memory of two frames of the bidirectional prediction is provided. The prediction memories 11 and 12 are prepared for this purpose. However, the prediction memories 11 and 12 must store a large amount of data of 8M bits in the case of NTSC (National Television System Committee) system, since the number of pixels is 720×480 pixels per frame, one pixel is constituted by 8 bits and the brightness signal and the color signal are included. It is difficult to mount such a large memory on a single LSI and even if a DRAM etc. is provided in addition thereto, its capacity is large, giving rise to an increase in cost. The coded portion of the information source of the image signal is multiplexed along with a coded output of an audio signal through formation of a variable length code and is sent to a transmitting path. Figure 14 illustrates this procedure. The demultiplexing of image data and audio data is conducted via the transmitting path, the respective data are decoded and the image data and the audio data are enjoyed by viewers through monitors or speakers, respectively. Further, with regard to the transmitting path the data is transmitted by radio wave through air as shown by Figure 15, or transmitted by cables or transmitted by stored media. The data is subjected to communication path coding in a form in compliance with the transmitting path. For example, the data is transmitted via a signal processing such as error correction or digital modulation. Next, an explanation will be given of the side of decoding. Figure 16 is a block diagram of a decoder for an image signal portion in coding an information source of MPEG 1 described on page 105 of "Pointwisely Illustrated Newest MPEG Text Book" supervised by Hiroshi Fujiwara, edited by the "Multimedia Communication Research Association" and issued by ASCII Corporation on August 1, 1994. In Figure 16 numeral 14 designates a dequantizer, numeral 15 designates an inverse DCT transformer, numeral 16 designates an adder, numerals 17, 21 and 22 designate switches, numerals 18 and 19 designate prediction memories, numeral 20 designates an averaging circuit and numeral 23 designates a monitor. Next, an explanation will be given of the operation. The data which has been subjected to the operation of coding image information source and subjected to the operation of coding in respect of a communication path and transmitted, is subjected to the operation of decoding in respect of the communication path. Only image data thereof is extracted and the variable length code is decoded and the data is inputted to the decoder as data of which quantization characteristic designating information, macroblock type, motion vector and quantization transforming coefficient have been extracted. The dequantizer 14 dequantizes the data from the quantization characteristic designating information and the quantization transforming coefficient to transform them into representative values in the frequency region of DCT and the inverse DCT transformer 15 restores the data to the data in the spatial region. Based on the data in the spatial region and the motion vector, necessary portions of the data of preceding and succeeding frames are read from the prediction memory 18 and the prediction memory 19 in a compensated form by shifting them by the amount of motion and are added to the data in the spatial region by the adder 16. This operation corresponds to decoding a difference value from a prediction value and at this stage the decoding of the motion compensating prediction and the DCT transformation is completed. At this occasion, the switches 21 and 22 are controlled based on the information of the macroblock type. The macroblock type is referred to as a mode type permitted to each macroblock which has been explained in the above-mentioned picture type. The averaging circuit 20 is a circuit for calculating an average value with rounding of the prediction in the forward direction and the prediction in the backward direction as a result of the bidirectional prediction with respect to one macroblock type of B picture in the macroblock types. There is an agreement that the order of frames is rearranged also on the side of decoding to carry out the coding and decoding in such a way. This procedure is indicated by Figure 13. The stage of decoding in Figure 13 indicates the input order of the decoder in Figure 16. B picture in the data is outputted immediately after decoding. However, I picture or B picture is outputted after outputting B picture. Therefore, it is necessary to hold the once decoded I picture and P picture in the memories 18 and 19 until B pictures therebetween have been decoded. For that purpose, in the case of, for example, NTSC (National Television System Committee) signal, a large amount of data of 8M bits must be stored since the number of pixels is 720×480 pixels per frame, one pixel is constituted by 8 bits and the brightness signal and the color signal are also included. However, it is difficult to mount such a large memory on a single LSI and even if a DRAM etc. is provided in addition thereto, the capacity thereof is large, giving rise to an increase in cost. Further, it is necessary that the time axis of the image data is brought into alignment with the time axis of the audio data. Otherwise, if the times of the two signals are shifted from each other in the process of coding and decoding, there is no mechanism of adjusting the shift. Therefore, it is prescribed that time information is multiplexed to each data at a multiplexing unit in Figure 14. Figure 17 is a diagram showing a region for inserting the time information therefor. Figure 17 is a diagram showing a bit stream format of PES (Packetized Elementary Stream). As illustrated in the diagram the video or audio signal is processed into a packet referred to as PES and it is prescribed that time information that is referred to as time stamp is multiplexed at that time. Two time stamps of presentation time stamp and decoding time stamp are prepared in order to be able to deal with rearrangement of frame order in carrying out the bidirectional prediction of MPEG. The presentation time is represented by PTS (Presentation time Stamp) and the decoding time is represented by DTS (Decoding Time Stamp). Synchronization is conducted by using these time information. Therefore, when some processing is inserted in addition to the normal processing, there causes contradiction in such a time control and the synchronizing relationship collapses. As stated above, when coding is carried out by using the motion compensating prediction and the DCT transformation, an enormous amount of memory is required for prediction, resulting in high cost. Also, it is difficult in respect of scale and capacity to mount the memory on a single chip of a semiconductor. In addition thereto, when decoding is carried out by using the motion compensating prediction and the DCT transformation, an enormous amount of memory is required for prediction, resulting in high cost. Also, it is difficult in respect of scale and capacity to mount the memory on a single chip of a semiconductor. If some processing is tried to save the memory, time is shifted and times of audio and image data are shifted from each other. EP-A-0 687 111 (prior art under Article 54 (3) EPC) relates to a method for coding/decoding a data stream in which data such as reference image data is compressed before storage in a memory. EP-A-0 542 195 relates to an essentially standard MPEG encoder. EP-A-0 535 272 relates to a hybrid encoder. DCT coefficients are derived for image blocks. Only some of the DCT coefficients are stored in a memory, with the result that the less visible high frequency data is minimised. The stored coefficients are reconstituted by adding zeros to form the original number of coefficients. SUMMARY OF THE INVENTION The present invention has been carried out in view of the above-described problems and it is an object of the present invention to provide a coding and/or decoding device capable of restraining as small as possible the capacity of a memory that is used in coding and decoding an image signal. It is another object of the present 10 invention to provide a coding and/or decoding device capable of restraining a shift between times of audio and image signals. The invention provides a coding device as set out in claim 1, a decoding device as set out in claim 2 and a method of encoding and/or decoding data as set out in claim 12. According to the coding device of a digital image signal in accordance with a first aspect of the present invention, the reference image data for coding the images for the bidirectional prediction, is blocked in a form similar to that of a DCT block by the blocking means, then coding is carried out highly efficiently in respect of the data in the block whereby the data is written to the memory after minimizing the information to be stored in the memory and in reading the data, the data is referred to after decoding the data. According to the coding device of a digital image signal in accordance with a second aspect of the present invention, the reference image data for coding the images for the bidirectional prediction, is blocked in a form similar to that of the DCT block by the blocking means, the coding is carried out highly efficiently in respect of the data of the block whereby the data is written to the memory after minimizing the information to be stored in the memory and in reading the data, the data is referred to after decoding the data and further, the coding is carried out such that the time axis of the image signal is brought into alignment with the time axis of the audio signal. According to the coding device of a digital image signal in accordance with a third aspect of the present invention, the reference image data is transformed into a form similar to a screen input by the raster-transforming means, the coding is carried out highly efficiently in respect of the raster-transformed data and the data is written to the memory after minimizing the information to be stored in the memory and in reading the data, the data is referred to after decoding the data. According to the coding device of a digital image signal in accordance with a fourth aspect of the present invention, the prediction value from the contiguous pixel is calculated and the difference from the prediction value is calculated whereby the calculation result concentrates in the vicinity of 0. Accordingly, the information to be stored in the memory is reduced with almost no deterioration of image quality even if a coarse quantization is carried out at portions other than the concentrated portion and the scale is significantly reduced. According to the coding device of a digital image signal in accordance with a fifth aspect of the present invention, the contiguous pixel the location of which is the most proximate to the data in respect of the space and time of the screen, is selected whereby the degree of concentration of the value of the data is enhanced. Accordingly, the degree of deterioration is further lowered and yet the scale remains almost unincreased. According to the coding device of a digital image signal in accordance with a sixth aspect of the present invention, the data is blocked, the dynamic range is calculated and the quantization is allocated within the range. Therefore, it is possible to set quantization levels dispensing with wasteful quantization out of the dynamic range whereby even if a further coarse quantization is carried out, almost no deterioration of image quality is resulted and accordingly, the information to be stored in the memory is further reduced and yet the scale remains almost unincreased. According to the coding device of a digital image signal in accordance with a seventh aspect of the present invention, the data is blocked, the quantization is allocated according to the distribution of the data and therefore, it is possible to set quantization levels which are not affected by noise, resulting in no deterioration of image quality in respect of noise. Further, it is possible to set the quantization levels dispensing with wasteful quantization out of the distribution whereby even if a coarse quantization is carried out, almost no deterioration of image quality is resulted. According to the coding device of a digital image signal in accordance with an eighth aspect of the present invention, the blocks are selected such that the blocks are the most proximate to each other in respect of the space within the same time period of the screen whereby the degree of concentration of the value of the data is enhanced and accordingly, the degree of deterioration of image quality is further reduced and yet the scale remains almost unincreased. According to the coding device of a digital image signal in accordance with a ninth aspect of the present invention, the quantization levels enlarging the error are calculated and the representative values are coded whereby the error of quantization is made extremely small even if the data is decoded. According to the decoder of a digital image signal in accordance with a tenth aspect of the present invention, the reference image data for coding the images for the bidirectional prediction, is blocked in a form similar to that of the DCT block by the blocking means, the coding is carried out highly efficiently in respect of the data of the block and the reference of the data is carried out by decoding the data in writing and reading the data to and from the memory after minimizing the information to be stored in the memory. According to the decoding device of a digital image signal in accordance with an eleventh aspect of the present invention, the reference image data for coding the images for the bidirectional prediction, is blocked in a form similar to that of the DCT block by the blocking means, the coding is carried out highly efficiently in respect of the data of the block, the reference of the data is carried out by decoding the data in writing and reading the data to and from the memory after minimizing the information to be stored in the memory and further the decoding is carried out such that the time axis of the image data is brought into alignment with the time axis of the audio signal. According to the decoding device of a digital image signal in accordance with an twelfth aspect of the present invention, the reference image data is transformed in a form similar to that of a screen input by the raster-transforming means, the coding is carried out highly efficiently in respect of the raster-transformed data and the reference of the data is carried out by decoding the data in writing and reading the data to and from the memory after minimizing the information to be stored in the memory. According to the decoding device of a digital image signal in accordance with a thirteenth aspect of the present invention, the prediction value from the contiguous pixel is calculated and the difference from the prediction value is calculated whereby the calculation result concentrates in the proximity of 0. Therefore, even if a coarse quantization is carried out at portions other than the concentrated portion, the information to be stored in the memory is reduced with almost no deterioration of image quality and further, the scale is significantly reduced. According to the decoding device of a digital image signal in accordance with a fourteenth aspect of the present invention, the contiguous pixel the location of which is the most proximate to the data in respect of the space and time of the screen, is selected whereby the degree of concentration of the value of the data is enhanced. Accordingly, the degree of deterioration of the image quality is further lowered and yet the scale remains almost unincreased. According to the decoding device of a digital image signal in accordance with a fifteenth aspect of the present invention, the data is blocked, the dynamic range is calculated and the quantization is allocated within the range. Therefore, it is possible to set quantization levels dispensing with wasteful quantization out of the dynamic range whereby even if a further coarse quantization is carried out, almost no deterioration of the image quality is resulted and therefore, the information to be stored in the memory is further reduced and yet the scale remains almost unincreased. According to the decoding device of a digital image signal in accordance with a sixteenth aspect of the present invention, the data is blocked, the quantization is allocated according to the distribution of the data and therefore, it is possible to set quantization levels which are not affected by noise and resulting in no deterioration of image quality in respect of noise. Furthermore, it is possible to set the quantization levels dispensing with wasteful quantization out of the distribution whereby even if a further coarse quantization is carried out, almost no deterioration of image quality is resulted. According to the decoding device of a digital image signal in accordance with a seventeenth aspect of the present invention, the blocks are selected such that the block are the most proximate to each other in respect of the space within the same time period of the screen whereby the degree of concentration of the value of the data is enhanced and therefore, the degree of deterioration of the image quality is further reduced and yet the scale remains almost unincreased. According to the decoding device of a digital image signal in accordance with an eighteenth aspect of the present invention, the quantization levels enlarging the error are calculated and the representative values are coded whereby the error of quantization is made extremely small even if the data is decoded. According to the coding and decoding device of a digital image signal in accordance with a nineteenth aspect of the present invention, the way of using the prediction memories for coding information source by utilizing the bidirectional prediction of the image signal and the DCT transformation, is transmitted as the information and is utilized on the side of decoding whereby the same operation is carried out in respect of the information on the side of coding and on the side of decoding. As a result, the amount of memory can be saved in a state where the deterioration of the image quality is made extremely small. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 illustrates a block diagram of a coding device of a digital image signal according to Embodiment 1 of the present invention and a coding unit of a coding and decoding device of a digital image signal according to Embodiment 3 thereof; Figures 2(A) and 2(B) are diagrams explaining a coding control of a digital image signal according to Embodiment 1 and a decoding control of a digital image signal according to Embodiment 2; Figure 3 is a diagram explaining the operation of a blocking circuit in the coding device of a digital image signal according to Embodiment 1 and the operation of a blocking circuit in a decoding device of a digital image signal according to Embodiment 2; Figure 4 is a diagram explaining the operation of a coder in respect of a difference from a prediction in the coding device of a digital image signal according to Embodiment 1 and the operation of a coder in respect of a difference from a prediction in the decoding device of a digital image signal according to Embodiment 2; Figure 5 is a diagram explaining the operation of a blocking circuit blocking with insignificant deterioration of image quality in the coding device of a digital image signal according to Embodiment 1 and the operation of a blocking circuit blocking with insignificant deterioration of image quality in the decoding device of a digital image signal according to Embodiment 2; Figure 6 is a diagram explaining the operation of the coder in respect of a dynamic range in the coding device of a digital image signal according to Embodiment 1 and the operation of the coder in respect of a dynamic range in the decoding device of a digital image signal according to Embodiment 2; Figure 7 is a diagram explaining the operation of the coder in respect of a distribution of image data in the coding device of a digital image signal according to Embodiment 1 and the operation of the coder in respect of a distribution of image data in the decoding device of a digital image signal according to Embodiment 2; Figure 8 is a diagram explaining an example of the operation of the blocking circuit in the coding device of a digital image signal according to Embodiment 1 and an example of the operation of the blocking circuit in the decoding device of a digital image signal according to Embodiment 2; Figure 9 is a diagram explaining an example of the operation of the blocking circuit in coding data from the dynamic range or the distribution of image data in the coding device of a digital image signal according to Embodiment 1 and an example of the operation of the blocking circuit in coding data from the dynamic range or the distribution of image data in the decoding device of a digital image signal according to Embodiment 2; Figure 10 is a diagram explaining an example of the operation in the case where a coder operating to replace representative values by a coding circuit in coding data from the dynamic range or the distribution of image data, is constituted in the coding device of a digital image signal according to Embodiment 1 and an example of the operation of the blocking circuit in the case where representative values are replaced by a coding circuit in coding data from the dynamic range or the distribution of image data in the decoding device of a digital image signal according to Embodiment 2; Figure 11 is a block diagram of a decoding device of a digital image signal according to Embodiment 2 and a block diagram of a decoding unit of the coding and decoding device of a digital image signal according to Embodiment 3; Figure 12 is a block diagram of a conventional coding device of a digital image signal; Figure 13 is a diagram explaining the operation of the conventional coding device of a digital image signal; Figure 14 is a block diagram explaining a total of a conventional coding and decoding system of a digital image signal; Figure 15 is a block diagram showing the outline of signal processing for conventional coding and decoding operation of a digital image signal; Figure 16 is a diagram of a conventional decoding device of a digital image signal; and Figure 17 is a diagram explaining time axis information multiplexing rule in the conventional coding device and the conventional decoding device of a digital image signal. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS EMBODIMENT 1 An explanation will be given of an embodiment of the present invention in reference to the drawings as follows. Figure 1 is a block diagram showing a digital image signal processing unit in a coding device of a digital image signal, constituting a stage prior to a step of forming a variable length code. In Figure 1 notations the same as those in Figure 12 designate respectively the same or the corresponding portions, numeral 24 designates a blocking circuit or a scan-transforming circuit, numeral 25 designates a coder, numerals 26 and 27 designate decoding circuits, and numerals 28 and 29 designate deblocking circuits or scan-inverse-transforming circuits. Next, an explanation will be given of the operation. In Figure 1 portions having notations the same as those in Figure 12 perform substantially the same operation and accordingly, the explanation will be omitted. However, the following explanation is based on MPEG 2. That is, the explanation deals with an interlace scanning image. Therefore, there also is a mode conducting field DCT transformation. Data once quantized in the frequency region of DCT, is outputted to form a variable length code with no deterioration of information. In the mean time, the data is dequantized, subjected to the inverse DCT transformation, processed into data in the original space region, decoded in respect of the motion compensating prediction at the adder 8 and is stored to the prediction memories 11 and 12 via the blocking circuit or scan-transforming circuit 24 and the coder 25. Data substantially equal to the original image data is outputted from the adder 8 at every DCT block. The data is further blocked, or scan-transformed, or blocked and scan-transformed by the blocking circuit or scan-transforming circuit 24. The data is compressed in a fixed code length by the coder 25 to thereby compress bits. For example, when a difference thereof in respect of a contiguous pixel in a block is calculated, since normally the contiguous pixel has almost the same value, the difference value approaches to 0. Therefore, the effective dynamic range of the difference value is deviated. Although the data before calculating the difference value necessitates all of 8 bits, if the data is replaced by the difference value, the difference value data is not so much influenced if it is quantized with the value of 5 bits or 6 bits. Although in this embodiment the pixel for calculating the difference is expressed as the contiguous pixel, this is because the value of the contiguous pixel is determined as the prediction value of the pixel and therefore, an average thereof in respect of other contiguous pixel may be the prediction value of the pixel. When only one pixel is provided as a pixel having a value for not calculating the difference value in a block, the pixel can be restored as an independent data in each block in the process of decoding. Therefore, this procedure is normally performed. In other words, even if quantization levels are distributed such that the nearer the levels to 0 the more densely they are distributed and the more remote the levels from 0 the more coarse they are distributed, no significant adverse influence is resulted. Furthermore, when the sign of the difference is determined and the negative difference value is calculated to subtract from the maximum value of the range, one bit of the dynamic range can further be saved. In this case it is necessary to devise such that the side of decoding reassigns the quantization level in the case where the range which becomes negative is subtracted from the maximum value in order to avoid the erroneous determination of the positiveness and negativeness of the range. When such a sign determining type difference quantization is conducted, it goes without saying that the nearer the quantization levels to 0 and the nearer the levels to the maximum value, the more densely the above-mentioned quantization levels are distributed and the nearer the levels to an intermediate range, the more coarsely the quantization levels are distributed. When such an operation is performed, the amount of data written to the prediction memories 11 and 12 is approximately halved whereby the memory can be saved. According to a simulation result by the inventors, it was found that even if the amount of information is halved by using such a method, the image quality is not so much influenced thereby. The quantized data having a fixed length is stored in the prediction memory 11 or the prediction memory 12 and is rendered a memory element of a reference image for calculating a motion vector or calculating motion compensating prediction. If the memory is normally in a one-to-one relationship with regard to the position of image, a circuit controlling the memory can be downsized. To restore the quantized value of the difference value to a value approximately equal to the original value by extracting the motion vector or by taking out data with regard to the position of the calculated motion vector from the memories 11 and 12, the data is processed by the decoding circuits 26 and 27 and the deblocking circuits or scan-inverse transforming circuits 28 and 29. In the decoding circuits 26 and 27 the decoding is started with the pixel in respect of which no difference calculation is performed in a block as a starting point. Firstly, the quantized data is replaced by a representative value corresponding to quantization levels and the difference value is restored to a value approximately equal to the original value by adding it to the value of the pixel of which difference value is not calculated. Next, the replacement and addition is repeated in the order of scanning. When the sign determining type reference quantization is conducted at this occasion, the value is replaced by a remainder calculation of the dynamic range if it exceeds the dynamic range as a result of the addition. The deblocking circuits or scan-inverse-transforming circuits 28 and 29 perform the operation inverse to the blocking circuit or scan-transforming circuit 27 and controls to transform the data such that the difference is formed at the difference former 2 where the timing is brought into alignment with that of the video input unit side. In the mean time, the nearest portions of the image data are searched to calculate the motion vector whereby the motion vector is calculated. The deblocking and the scan-inverse-transformation are carried out in compliance with the request of the search. In this way the coding device of a digital image signal capable of conducting equivalent compression while reducing the region of the memory, can be constituted. However, actually, image signal is normally transmitted along with audio signal and therefore, it is necessary to bring these two data into alignment with each other with considerable temporal accuracy. According to MPEG a time axis information as a timer counted at 90 kHz is multiplexed for this purpose. Therefore, the processing must be performed previously by that amount of time. Figures 2(A) and 2(B) indicate such a state. If the signal processing time centering on the coding and decoding operation in Embodiment 1 is designated by Δt sec. and the conventional processing timing is as illustrated in Figure 2(A), the memory control is carried out with regard to the processing timing in Embodiment 1 such that the reading from the memories is started earlier by Δt sec. as illustrated in Figure 2(B). Thereby, the coding device of a digital image signal can be constituted with no shift caused by the processing. The processing time can strictly be calculated in the case of forming a code having a fixed length. Therefore, it is advantageous as a coding system for the control of processing and time control to form a code having a fixed length. The processing time is allowable if it is smaller than a period of time during which the data of the motion vector in the search range has been written. Therefore, with regard to a large screen having about 720 pixels as in the NTSC level, the processing time is very much smaller than the time of one frame and therefore, there causes no contradiction in the processing. Next, with regard to the blocking operation, the reference of processing is constituted by a small block normally comprising 8 pixels × 8 pixels that is referred to as DCT, even if a macroblock is adopted, four DCT blocks are allocated to the luminance signal and two DCT blocks are allocated to the chrominance signal, the data disposed at the same position in a screen is rendered the unit of processing, four motion vectors are provided to a macroblock and accordingly, it is convenient to deal with the data in a blocked state although it is not indispensable. It is naturally allowable to deal with data in a single horizontal row as an aggregation as in the scanning line in NTSC. In order to deal with the data of DCT blocks by the unit of a scanning line, in the case of NTSC, the operation of the blocking circuit and scan-transforming circuit 24 may be constituted to conduct the raster-transforming operation as in vertical 1 pixel × horizontal 720 pixels. In this way the data can be stored in the prediction memory with data arrangement the same as those in the input screen. The raster-transformation may naturally be performed in respect of small divisions as in vertical 1 pixel × horizontal 16 pixels and similar operation may be performed by regarding the transformation result as a block. That is, it is not necessary to change the processing of calculating the difference in accordance with whether the block for calculating the difference is in a square form or in a horizontal linear form. When the prediction value is calculated from the above-mentioned contiguous pixel (the contiguous pixel may constitute the prediction value as it is), the difference value thereof in respect of the prediction value is calculated and the value is coded and stored in the prediction memories 11 and 12 whereby the region of the memory can be saved invariably to about a half thereof. Next, an explanation will be given of scanning operation. For example, consider a case where the DCT block is coded as it is as a block. When the scanning is performed in a block of 8 pixels × 8 pixels and coding is conducted, the scanning may be performed in zigzag with a left uppermost pixel as the pixel for not calculating the difference value as illustrated in Figure 3. The positional relationship among pixels arranged in the arrow mark direction constitute contiguous pixels. That is, when a contiguous pixel is rendered a pixel of the prediction value as it is, the difference value of a pixel A in Figure 3 is provided as a result of subtraction in respect of a pixel B. Furthermore, the prediction value may be calculated not only by adopting a pixel disposed in the direction inverse to the progressing direction of the arrow mark, but by including, for example, also a pixel having a positional relationship orthogonally intersecting with the progressing direction, or by setting a pixel in consideration of a two-dimensional arrangement as illustrated in Figure 4 and by performing an averaging calculation etc. In this case in scanning the data as illustrated in Figure 3, at an end point where such a pixel does not exist in the block, the value of a pixel orthogonally intersecting with the progressing direction may be rendered the same as the value of the pixel in the direction inverse to the progressing direction. Further, although the initial point in the block is rendered the point for not calculating the difference, it goes without saying that a difference in respect of 0 may be prepared whereby the quantization is performed. Next, an explanation will be given of the optimization of the scanning operation. The explanation deals with images centering on an interlace scanning image as in MPEG 2. That is, dynamic images are represented by constituting fields alternately by temporally different images and also by spatially different images. When the alternately emerging fields are classified into top fields and bottom fields, respectively, if the data is subjected to the inverse DCT transformation and the motion compensating prediction is decoded, the screen is constituted such that the scanning lines of bottom field are inserted among the scanning lines of the top field as illustrated in Figure 5. Therefore, if the scan-transformation is carried out fixedly in respect of the top field and the bottom field, when, for example, a motion is caused and the top field and the bottom field constitute images which are different by the amount of the motion, the difference values of the contiguous pixels are difficult to concentrate on 0. Therefore, the dynamic range of difference values is widened and portions magnifying the deterioration of the image quality emerge by the quantization. To prevent this phenomenon, the control of the blocking circuit or scan-transforming circuit 24 is changed and the contiguous pixels are seeked by performing the blocking operation as illustrated by the arrow marks of Figure 5. That is, the scanning is controlled with priority in respect of the same field. By this control the differences in respect of the prediction values concentrate in the proximity of 0 even if a motion is caused. Although the top field and the bottom field are mixed in one block in Figure 5, they may be separated into totally different blocks as illustrated in Figure 9. There is one location in Figure 5 where the top field and the bottom field constitute the positional relationship of contiguous pixels and if a motion is caused at this portion the problem the same as the above-mentioned problem remains. However, such a portion is extremely small in respect of area and the problem may be disregarded. Further, although the DCT block constitutes one block in Figure 3, the DCT block is scanned by frame as well as by field and the reading calculation from the memory is complicated. Meanwhile, the scanning operation illustrated in Figure 5 is very convenient since the operation is not influenced by the DCT block. Although the explanation has been given of the coding device of a digital image signal which compresses information by quantizing the differences in respect of the prediction values derived from the contiguous pixels and writing it to memories, an explanation will be given hereinafter of a coding device of a digital image signal compressing information with blocks as aggregations and writing it to memories. Figure 6 is a diagram for explaining the concept of a coding device of a digital image signal which compresses information with blocks as aggregations and writing it to prediction memories. A maximum value and a minimum value of all the pixels in each block are respectively calculated. The values of pixels in each block fall in a range specified by the respective maximum value and minimum value. The interval between the maximum value and the minimum value is rendered the dynamic range DR and quantization threshold values uniformly dividing DR are set. These are referred to as quantization reference values. Figure 6 illustrates the quantization procedure in which the interval from the maximum value to the minimum value is divided in four and representative values are normally calculated as averages of the quantization threshold values. The decoding is performed with respect to the maximum value, the minimum value and the quantization results of the respective pixels. An expression by 2 bits is given to the quantization results of the respective pixels each according to Figure 6. Also, instead of the maximum value and the minimum value, either one of the maximum value and the minimum value and the dynamic range DR may be coded. When 8 bits data of 8 pixels × 8 pixels is expressed by 8 bits of the maximum value and the minimum value and 2 bits of the quantization results, the compression rate is 9/32. Incidentally, according to this coding the scanning is necessary only for calculating the maximum value and the minimum value and accordingly, there is no problem of scan-transformation although the problem of optimizing the blocking remains. The data can be decoded by the maximum value and the minimum value (or data corresponding thereto) and the quantization results of necessary pixels. In the mean time, according to the way of calculation whereby the difference in respect of the prediction value derived from the contiguous pixel is calculated, it is necessary for decoding one pixel to decode all of the data which have been scanned prior to the one pixel and when the operation is used in the motion compensating prediction necessitating the reading of an arbitrary position, the control of the memory is complicated. However, in such a case, the quantization results for the respective pixels depend only on the maximum value and the minimum value (or data corresponding thereto) and accordingly, the reading control of the memory is simplified and the access frequency is reduced. Next, an explanation will be given of a case where the quantization reference values are determined not by determining the quantization reference values directly from the maximum value and the minimum value but through a further processing procedure. Normally, noises in some forms are often superposed on images. For example, there are noise at CCDs of a video camera and noise that is generated in converting an analog signal into a digital signal. These are random noises and a coding device of a digital image signal honestly codes also these noise components. However, the maximum value and the minimum value in the block are influenced thereby, which adversely influences on the quantization reference values. Therefore, in order to avoid the influence of noise an averaging operation is introduced in calculating the quantization reference values. For example, in the case of performing a quantization operation having four representative values, the maximum value in the block is designated by Lmx, the minimum value is designated by Lmn, a maximum representative value is designated by Pmx, a minimum representative value is designated by Pmn, a central quantization reference value is designated by Pa and other reference values are designated by P1 and P2 in a block shown by Figure 7. In this case Pmx, Pmn, Pa, P1 and P2 are calculated to establish the following relationships. Incidentally, a value of a pixel disposed at a location (i,j) is designated by Xij and a quantization result thereof is designated by Φi. Pmx = (ΣXij)/Nmx; where Xij designates a value of a pixel having the value of (3Lmx+Lmn)/4 or more and Nmx is a number of pixels in a block each having a value of (3Lmx+Lmn)/4 or more. Pmn = (ΣXij)/Nmn; where Xij designates a value of a pixel having the value of (Lmx+3Lmn)/4 or more and Nmn designates a number of pixels in a block each having a value of (Lmx+3Lmn)/4 or more. LD = Pmx - Pmn Pa = (Pmx + Pmn)/2 where i, j designate a sort in a block. {if(Xij ≦ P1) Φij = 00 elseif(Xij ≦ Pa) Φij = 01 elseif(Xij ≦ P2) Φij = 10 else Φij = 11} The coding operation in this case is with regard to Φij, Pa and LD. When certain threshold values are calculated from the maximum value and the minimum value and averages of values of pixels exceeding these threshold values are calculated in this way, variations of the quantization reference values due to noise are avoided and therefore, the image quality is not adversely influenced thereby. Also, these calculating operations are constituted by simple calculations based on the calculations of average values and therefore, the operations can be realized by a facilitated circuit structure. Additionally, a width between the quantization reference values of P2-Pa may be coded instead of Ld. P2-Pa is a value that is equal to or smaller than a half or less of LD and therefore the number of bits for coding can be reduced. The coding is conducted in this way and the coded data is written to the prediction memory 11 and the prediction memory 12 by which the motion vector is calculated or the reading of portions necessary for the motion compensating prediction is carried out. In this case, the read data comprises only Pa and LD (or data corresponding thereto) and the quantization results Φij of necessary pixels. When the data is read and decoded, the decoding is performed in accordance with the following equations. The decoded result of Φij is designated by Yij. if (Φij = 00) Yij = Pa - LD/2 if (Φij = 01) Yij = Pa - LD/6 if (Φij = 10) Yij = Pa + LD/6 if (Φij = 11) Yij = Pa + LD/2 The decoding is carried out in this way and therefore, the calculation thereof is significantly simplified in comparison with the calculation in coding and accordingly, which is very convenient in the case where two blocks of the decoding step are necessary as in the device shown in Figure 1. According to the way of calculating the difference in respect of the prediction value derived from the contiguous pixel, it is necessary for decoding one pixel to decode all of the data which has been scanned prior to decoding the one pixel and the control of the memory is complicated if it is used in the motion compensating prediction necessitating the reading of an arbitrary position. However, in such a case, the quantization results of the respective pixels are dependent on only the maximum value and the minimum (or data corresponding thereto) and accordingly, the reading control of the memory is simplified and the access frequency is reduced. Although the above explanation has been given with respect to 8 pixels × 8 pixels, when the operation is carried out in a smaller range such as 4 pixels × 4 pixels the dynamic range or LD is decreased and therefore, the deterioration of image quality is diminished which is preferable. That is, it goes without saying that it is not necessary to be particular about the size or the shape of the block and the block may be set freely, for example, the block may be constituted by 8 pixels × 2 pixels. Although the area of the block of 8 pixels × 2 pixels is the same as that of 4 pixels × 4 pixels, the size of the resistor (or memory) in the blocking operation may be reduced. Next, an explanation will be given of the optimization of the blocking in this case. For example, when one block is constituted by 4 pixels × 4 pixels, it is possible to divide the DCT block in four in a shape of aggregated squares as illustrated in Figure 8. However, if there causes a motion in the interlace scanning image, the correlation of data is lost among the fields and accordingly, it is preferable to block the data in the same field. That is, as illustrated in Figure 9 the blocking is conducted to constitute 4 pixels × 4 pixels in the top field and 4 pixels × 4 pixels in the bottom field. In this way it is possible to provide a coding whereby the dynamic range or LD is reduced and the deterioration of the image quality is minimized even if the image has a motion. The blocking may naturally be switched in accordance with the motion. In that case it is preferable not only to change the way of blocking in accordance with the motion but to code the information of the way of blocking. That is, the field blocking and the frame blocking are constituted to switch by the motion vector and the mode of the DCT blocking and the switching of the blocking means is coded. It goes without saying that the operation is not limited to the blocking of 4 pixels × 4 pixels but the blocking of 4 pixels × 4 pixels may be switched to that of 8 pixels × 2 pixels or vice versa to minimize the value of the dynamic range or LD. Next, a further countermeasure against image deterioration will be described. The above-mentioned quantization reference values or representative values are univalently determined from the maximum value, the minimum value, or Pa, LD or values corresponding thereto. If the respective pixels are pertinently distributed, such a quantization or calculation of representative values is appropriate. However, there actually is a deviation in the distribution. For example, when a white line is disposed in a darkish background, the pixels are distributed as illustrated in Figure 10. In this case the presentative value of the level 00 is changed by the influence of the surrounding of the line. The largest number of pixels are distributed centering on a level designated by a dotted line in respect of the representative value of the level 00 and the error of the pixels is minimized by selecting the level of the dotted line as a representative value. However, if the quantization reference values or the representative values are univalently determined from the maximum value and the minimum value, or Pa and LD or values corresponding thereto in the distribution, the determination will be performed irrespective of the frequency of the distribution, which may cause a deterioration of image quality such as distortion of block etc. Accordingly, by studying the difference between the representative value of a once quantized result and the original data, representative values having significant accumulation of error are changed and the number (00 in this example) of the representative value to be changed, the difference from the original representative value and the value of the new representative value as it is are coded and stored in the prediction memories 11 and 12 along with the data. In this way, when the decoder 26 or 27 decodes the data such that the replacement is performed based on the information of the replacement of the representative value and the original representative value (Pa-LD/2) is replaced by a new value in correspondence with the quantization result corresponding to the number of the representative value (Φ00 in this example), the decoding can be performed to produce an image having small error and the deterioration of image quality can be minimized. As a criteria for determining the largeness or smallness of error, there are a summation of absolute values of differences from the original data, a summation of squares of the differences and the like either of which may be used. Also, conversely, an integration of the difference values instead of the summation of absolute values or the like may be performed for each level or an integration of the summation of squares of the differences may be performed by attaching thereto the original sign based on the way of thinking that the optimization is achieved when the averaging of errors results in 0. With respect to the replacement operation of the level of the representative value having large error, a level of the representative value whereby a number of pixels having small error is increased the most or an average value of pixels constituting a quantization result which minimizes the error in view of a total of the quantization levels may be calculated. According to the above-mentioned explanation, the decoders 26 and 27 and the deblocking circuits or scan-inverse-transforming circuits 28 and 29 are independently provided with processing circuits at the output sides of the prediction memories 11 and 12. However, the processing can naturally be realized by a single circuit when an operation having a speed twice as high as that of the processing circuits is performed and a time shearing processing is conducted. EMBODIMENT 2 Next, an explanation will be given of Embodiment 2 of the present invention in reference to the drawings. Figure 11 is a block diagram showing a digital image signal processing unit in a decoding device of a digital image signal and a step of forming a decoded signal having a variable length and thereafter. In Figure 11 notations the same as those in Figure 16 designate respectively the same or the corresponding portions, numeral 30 designates a blocking circuit or scan-transforming circuit, numeral 31 designates a coder, numerals 32 and 33 designate decoding circuits and numerals 34 and 35 designate blocking circuits or scan-inverse-transforming circuits. Next, an explanation will be given of the operation. Portions in Figure 11 having notations the same as those in Figure 16 perform substantially the same operation and the explanation will be omitted. However, the following explanation will be based on MPEG 2. That is, the explanation deals with interlace scanning image. Accordingly, there also is a mode performing field DCT. Data which has been quantized once in the frequency region of DCT, is outputted to subject them to variable length coding with no deterioration of information, in the mean time, it is quantized, subjected to the inverse DCT forming, processed into data in the original space region, decoded in respect of the motion compensating prediction at the adder 16 and the data is stored in the prediction memories 18 and 19 via the blocking circuit or scan-transforming circuit 30 and the coder 31. Data substantially equal to original image data is outputted from the adder 16 at every DCT block. The data is further blocked, or scan-transformed, or blocked and scan-transformed by the blocking circuit or scan-transforming circuit 30. The data is compressed in a fixed code length by the coder 31 to compress bits. For example, when a difference value in respect of a contiguous pixel in a block is calculated, the difference value approaches 0 since normally the contiguous pixel has substantially the same value. Therefore, the effective dynamic range of the difference values is deviated and although the data necessitates all of 8 bits for the value thereof before calculating the difference, when it is replaced by the difference value, the difference value data is not so much influenced even if the difference value is quantized with the value of 5 bits or 6 bits. Although the pixel for calculating the difference value is expressed as the contiguous pixel, this is because the value of the contiguous pixel is determined as the prediction value of the pixel and therefore, an average thereof in respect of other contiguous pixel may be the prediction value of the pixel. When only one pixel is provided as a pixel having a value for not calculating the difference value in a block, the value of the pixel can be restored as an independent data for each block in the decoding operation. Therefore, this procedure is normally performed. That is, no significant adverse influence is resulted even if the nearer quantization levels to 0 the more densely they are distributed and the more remote the quantization levels from 0 the more coarse they are distributed. Furthermore, if the sign of the difference is determined and the calculation is performed such that the negative reference value is subtracted from the maximum value of the range, one bit of the dynamic range can further be saved. In this case, it is necessary to devise such that the decoding side reassigns the quantization levels when the range which becomes negative is subtracted from the maximum value in order to avoid the erroneous determination of the positiveness and negativeness of the range. When such a sign determining type difference quantization is performed, it goes without saying that the nearer the above-mentioned quantization levels to 0, or the nearer they are to the maximum value, the more densely they are distributed and the nearer they are to an intermediate range, the more coarsely they are distributed. In this way, the memory can be saved approximately to a half thereof. The quantized data having a fixed length is stored in the prediction memory 18 or the prediction memory 19 and is made a memory element of reference images for calculating a motion vector or calculating the motion compensating prediction. If the memories each is normally in a one-two-one relationship in respect of the position of the image, a circuit for controlling the memories can be downsized. The data is processed through the decoders 32 and 33 and the deblocking circuits or scan-inverse-transforming circuits 34 and 35 to extract the motion vector from the memories 18 and 19 or to restore a quantized value of the difference value to a value substantially equal to the original value by taking out the data of the position of the calculated motion vector therefrom. The decoding is started in the decoders 32 and 33 with a pixel for not calculating the difference in a block as a starting point. First, the quantized data is replaced by a representative value corresponding to the quantization level which is added to the value of a pixel for not calculating the difference whereby the difference value is restored to the value substantially equal to the original value. Next, the replacement and the addition are repeated in the order of scanning. In this case, when the sign determining type difference quantization is conducted, if the data exceeds the dynamic range as a result of addition, the value is replaced by a remainder calculation of the dynamic range. The operation inverse to that of the blocking circuit or scan-transforming circuit 30 is conducted at the deblocking circuits or scan-inverse-transforming circuits 32 and 33 and the circuits are controlled to transform the data such that a difference is formed in alignment with the timing of outputting the data at the inverse DCT formation at the adder 16. In this way the decoding device of a digital image signal capable of compressing the data equivalently while reducing the area of the memories, can be constituted. However, actually image data is transmitted normally along with audio signal and the alignment should be taken between the both data with significant temporal accuracy. For this purpose, according to MPEG, the data is transmitted by being multiplexed with time axis information as a timer counted at 90 kHz. The image and the audio signals must be outputted to monitors or speakers in accordance with the time axis information. Therefore, the processing must be conducted previously by that amount of time. Figures 2(A) and 2(B) illustrate this state. If a signal processing time centering on the coding and decoding operation of Embodiment 2 is designated by Δt sec., when the conventional processing time is as illustrated in Figure 2(A) with respect to the processing timing of Embodiment 2, the memory control is performed such that the reading from the memory is started earlier by Δt sec. as illustrated in Figure (B). In this way a decoding device of a digital image signal with no shift due to the processing can be constituted. With regard to processing timing, when a code having a fixed length is formed, the timing can be calculated strictly and therefore, the formation of a code having a fixed length as a coding system is advantageous in view of the control of processing and time control. Further, the processing time is allowable if it is smaller than a period of time within which data in the range of the motion vector has been written. Therefore, in the case of a large screen having approximately 720 pixels as in the NTSC level, the processing time is very small in comparison with a time period of one frame whereby the contradiction of processing is not caused. Next, an explanation will be given of the blocking operation. The reference of processing is constituted by a small block comprising normally 8 pixels × 8 pixels that is referred to as DCT, even if a macroblock is adopted, four DCT blocks are allocated to the luminance signal and two DCT blocks are allocated to the chrominance signal, the data disposed at same position in a screen is rendered the unit of processing, four motion vectors are allocated to one macroblock and accordingly, it is convenient to deal with the data in a blocked state although it is not indispensable. It is naturally allowable to deal with data in one horizontal row as an aggregation as in the scanning line in NTSC. In order to deal with the data of DCT blocks by the unit of a scanning line, in the case of NTSC, the operation of the blocking circuit or scan-transforming circuit 30 may be constituted to perform the raster-transforming operation as in vertical 1 pixel × horizontal 720 pixels etc. The raster-transformation may naturally be performed in small divisions as in vertical 1 pixel × horizontal 16 pixels and a similar operation may be conducted by regarding the transformation result as a block. That is, it is not necessary to change the processing of calculating the difference in accordance with whether the block for calculating the difference is in a square form or in a horizontal linear form. The prediction value is calculated from the above-mentioned contiguous pixel (the contiguous pixel may be the prediction value as it is), the difference value thereof in respect of the prediction value is calculated and the data is coded and stored in the prediction memories 18 and 19 whereby the region of the memory can be saved invariably to about a half thereof invariably. Next, an explanation will be given of scanning operation. For example, consider a case where the DCT block is coded as it is as a block. That is, when the coding is performed by scanning a block of 8 pixels × 8 pixels, the scanning may be performed in zigzag with a left uppermost pixel as the pixel for not calculating the difference value as illustrated in Figure 3. In this case the positional relationship among pixels arranged in the arrow mark direction constitute contiguous pixels. That is, when the contiguous pixel is rendered the prediction pixel as it is, the difference value of a pixel A in Figure 3 is provided as a result of subtraction in respect of a pixel B. Further, the prediction value may be calculated not by adopting a pixel arranged in the direction inverse to the progressing direction of the arrow mark but including, for example, also a pixel having a positional relationship, for example, orthogonally intersecting with the progressing direction, or by setting a pixel in consideration of a two-dimensional arrangement as illustrated in Figure 4 and by performing an averaging calculation etc. In this case in scanning the data as illustrated in Figure 3, at an end point where such a pixel does not exist in the block, the value of a pixel orthogonally intersecting with the progressing direction may be rendered the same as the value of the pixel arranged in the direction inverse to the progressing direction. Further, although the initial point in the block is made the point for not calculating the difference, it goes without saying that a difference in respect of 0 is prepared and the quantization is performed. Next, an explanation will be given of the optimization of the scanning operation. The explanation deals with images centering on an interlace scanning image as in MPEG 2 etc. That is, dynamic images are represented by constituting fields alternately by temporally different images and also by spatially difference images. When the alternately emerging fields are classified respectively into top fields and bottom fields if the data is subjected to the inverse DCT transformation and the motion compensating prediction is decoded, the screen is constituted such that the scanning lines of the bottom field are inserted among the scanning lines of the top field as illustrated in Figure 5. Therefore, when the scan-transformation is performed fixedly with respect to the top field and the bottom field, if, for example, a motion is caused and the top field and the bottom field constitute images which are different by the amount of the motion, the difference values of the contiguous pixels are difficult to concentrate on 0. Therefore, the dynamic range of difference value is widened and portions magnifying the deterioration of image quality emerge by the quantization operation. To prevent this phenomenon, the control of the blocking circuit or scan-transforming circuit 30 is changed and contiguous pixels are seeked by performing the blocking operation as designated by the arrow marks in Figure 5. That is, the scanning is controlled with priority in respect of the same field. In this way, the differences in respect of the prediction value concentrate in the proximity of 0 even if the motion is caused. Although the top field and the bottom field are mixed in one block in Figure 5, they may be separated into totally different blocks as illustrated in Figure 9. There is one location in Figure 5 where the top field and the bottom field constitute a positional relationship of contiguous pixels and if a motion is caused at that portion, the same problem as the above-mentioned problem remains. However, such a portion is extremely small in respect of area and accordingly, the problem may be disregarded. Further, although the DCT block constitutes one block in Figure 3, the DCT block is scanned by frame or by field and therefore, the reading calculation from the memory is complicated. Meanwhile, the scanning operation illustrated in Figure 5 is very convenient since the operation is not influenced by the DCT block. Although the explanation has been given of the decoding device of a digital image signal compressing information by quantizing the differences in respect of the prediction values derived from the contiguous pixels and writing it to memories, an explanation will be given hereinafter of a decoding device of a digital image signal compressing information with blocks as aggregations and writing it to memories. Figure 6 is a diagram for explaining the concept of a decoding device of a digital image signal compressing information with blocks as aggregations and the writing it to prediction memories. A maximum value and a minimum value of all the pixels in each block are respectively calculated. The values of the pixels in each block fall in a range specified by the respective maximum value and minimum value. The interval between the maximum value and the minimum value is rendered the dynamic range DR and quantization threshold values uniformly dividing DR are set. These are referred to as quantization reference values. Figure 6 illustrates the quantization procedure in which the interval from the maximum value to the minimum value is divided in four and representative values are normally calculated as averages of the respective quantization threshold values. The decoding is performed with respect to the maximum value, the minimum and the quantization results of the respective pixels. An expression by 2 bits is given to the quantization results of the respective pixels according to Figure 6. Instead of the maximum value and the minimum value either one of the maximum value and the minimum and the dynamic range DR may be coded. When 8 bits data of 8 pixels x 8 pixels is expressed by 8 bits of the maximum value and the minimum value and 2 bits of the quantization results, the compression rate is 9/32. Incidentally, according to this coding the scanning is necessary only for calculating the maximum value and the minimum value and therefore, there is no problem of scan-transformation although the problem of optimizing the blocking remains. This data can be decoded by the maximum value and the minimum value (or data corresponding thereto) and the quantization results of necessary pixels. In the meantime, according to the way of calculation whereby the difference in respect of the prediction value derived from the contiguous pixel is calculated, it is necessary for decoding one pixel to decode all of the data which have been scanned prior to the decoding of the one pixel and when the operation is used in the motion compensating prediction necessitating the reading of an arbitrary position, the control of the memory is complicated. However, in such a case, the quantization results for the respective pixels depend only on the maximum value and the minimum value (or data corresponding thereto) and therefore, the reading control of the memory is simplified and the access frequency is reduced. Next, an explanation will be given of a case where the quantization reference values are determined not by determining the quantization reference values directly from the maximum value and the minimum value but through a further processing procedure. Normally, noises in some forms are often superposed on images. For example, there are noise at CCDs of a video camera and noise that is generated in converting an analog signal into a digital signal. These are random noises and a coding device of a digital image signal transmits a coded bit stream after honestly coding these noise components. Therefore, an image including the noise components is decoded as a result of decoding the bit stream. However, the maximum value or the minimum value in the block is influenced by the noises, which adversely influences on the quantization reference values. Therefore, an averaging operation is introduced to calculate the quantization difference values in order to avoid the influence. For example, when a quantization operation having four representative values is performed, the maximum value in the block is designated by Lmx, the minimum value is designated by Lmn, a maximum representative value is designated by Pmx, a minimum representative value is designated by Pmn, a central quantization reference value is designated by Pa and other reference values are designated by P1 and P2 in a block shown by Figure 7. In this case Pmx, Pmn, Pa, P1 and P2 are calculated to establish the following relationships. Incidentally, a value of a pixel disposed at a position (i,j) is designated by Xij and a quantization results is designated by Φi. Pmx = (ΣXij)/Nmx where Xij designates a value of a pixel having the value of (3Lmx+Lmn)/4 or more and Nmx is a number of pixels in a block each having a value of (3Lmx+Lmn)/4 or more. Pmn = (ΣXij)/Nmn where Xij designates a value of a pixel having the value of (Lmx+3Lmn)/4 or more and Nmn designates a number of pixels in a block each having a value of (Lmx+3Lmn)/4 or more. LD = Pmx - Pmn Pa = (Pmx + Pmn)/2 where i, j designate a sort in a block. {if(Xij ≦ P1) Φij = 00 elseif(Xij ≦ Pa) Φij = 01 elseif(Xij ≦ P2) Φij = 10 else Φij = 11} The coding operation is performed with respect to Φij, Pa and LD. When certain threshold values are calculated from the maximum value and the minimum value and averages of pixels exceeding these threshold values are calculated in this way, variations of the quantization reference values due to noise are avoided and therefore, the image quality is not adversely influenced thereby. Furthermore, these calculations are constituted by simple calculations based on the calculations of average values and therefore, the operations can be realized by a facilitated circuit structure. Instead of LD a width between the quantization difference values of P2-Pa may be coded. The number of bits for coding can be reduced since P2-Pa is provided with a value of a half or less of LD. The coding is performed in this way, the coded data is written to the prediction memory 11 and the prediction memory 12 and portions necessary for decoding the motion compensating prediction are read. At this occasion the read data are Pa and Ld (or data corresponding thereto) and the quantization results Φij of necessary pixels. When the data is read and decoded, the decoding is performed in accordance with the following equations. The decoded results of Φij is designated by Yij. if (Φij = 00) Yij = Pa - LD/2 if (Φij = 01) Yij = Pa - LD/6 if (Φij = 10) Yij = Pa + LD/6 if (Φij = 11) Yij = Pa + LD/2 The decoding is conducted in this way and therefore, the calculation thereof is considerably simplified in comparison with the calculation in coding. Therefore, it is very convenient in the case where two blocks of decoding steps are necessary as in the device of Figure 1. According to the way of calculating where the difference in respect of the prediction value derived from the contiguous pixel, it is necessary for decoding one pixel to decode all of the data which has been scanned prior to decoding the one pixel and the control of the memory is complicated when it is used in the motion compensating prediction necessitating the reading of an arbitrary position. However, in such a case, the quantization results of the respective pixels are dependent on only the maximum value and the minimum value (or data corresponding thereto) and therefore, the reading control of the memory is simplified and the access frequency is minimized. Although the above explanation has been given with respect to 8 pixels × 8 pixels, the dynamic range or LD is decreased when the operation is performed with respect to a smaller region such as 4 pixels × 4 pixels and accordingly, it is preferable since the deterioration of image quality is reduced. That is, it goes without saying that it is not necessary to be particular about the size or the shape of the block and the block may be set freely, for example, the block may be constituted by 8 pixels × 2 pixels. Although the area of the block of 8 pixels × 2 pixels is the same as that of 4 pixels × 4 pixels, the size of the resistor (or memory) in the blocking can be reduced. Next, an explanation will be given of optimizing the blocking in this case. For example, when one block is constituted by 4 pixels × 4 pixels, the DCT blocks can be divided in four in a shape of an aggregated squares as illustrated in Figure 8. However, if there causes a motion in an interlace scanning image, the correlation of data is lost among the fields and therefore, it is preferable to block the data in the same field. That is, the blocking is performed to constitute 4 pixels × 4 pixels in the top field and 4 pixels × 4 pixels in the bottom field as shown by Figure 9. In this way the dynamic range or LD can be reduced even if the image has a motion whereby the data can be coded with extremely small deterioration of image quality. The blocking may naturally be controlled to switch according to the motion. In that case it is preferable not only to change the way of blocking in accordance with the motion but to code the information of the way of blocking. That is, the field blocking and the frame blocking are constituted to switch by the motion vector and the mode of the DCT blocking and the switching of the blocking means is coded. It goes without saying that this operation is not limited to the blocking of 4 pixels × 4 pixels but 4 pixels × 4 pixels and 8 pixels × 2 pixels may be switched to each other in order to minimize the value of the dynamic range or LD. Next, a further countermeasure against deterioration of image will be described. The above-mentioned quantization difference values and representative values are univalently determined from the maximum value and the minimum value, or Pa and LD or values corresponding thereto. When the respective pixels are pertinently distributed, such a quantization or calculation of representative values is appropriate. However, there actually is a deviation in the distribution. For example, in the case where a white line is disposed in a darkish background, the pixels are distributed as illustrated in Figure 10. In such a case the representative value of the level 00 is changed by the influence of the surrounding of the line. The largest number of pixels are distributed centering on a level designated by a dotted line in respect of the level 00 and the error of the pixels is minimized by selecting the level of the dotted line as a representative value. However, when the quantization reference values or the representative values are determined univalently from the maximum value and the minimum value, or Pa and LD or values corresponding thereto in the distribution, the determination will be performed irrespective of the frequency of the distribution, which may cause a deterioration of image quality such as block distortion etc. Accordingly, representative values having significant accumulation of error are changed by studying the difference between the representative value of a once quantized result and the original data and the number (00 in this example) of the representative value to be changed, the difference from the original representative value and the new representative value as it is are coded and stored in the prediction memories 18 and 19 along with the data. Thereby, when the decoder 26 or 27 decodes the data such that the replacement is performed based on the information of the replacement of the representative value and the original representative value (Pa-LD/2) is replaced by a new value in correspondence with the quantization result corresponding to the number of representative value (Φ00 in this example), the decoding can be performed to produce an image having small error thereby the deterioration of image quality can be minimized. As a criteria for determining the largeness or smallness of error, there are a summation of absolute values of differences from the original data, a summation of squares of the difference and the like either of which may be used. Conversely, an integration of the difference values may be performed for each level instead of the summation of absolute values etc. or an integration may be performed by attaching the original sign to the summation of the squares of the differences based on the way of thinking that the optimization is achieved when the average of errors results in 0. With respect to the replacement operation of the level of the representative value having large error, a level of the representative value whereby a number of pixels having small error is increased the most may be calculated or an average value of pixels constituting a quantization result which minimizes the error in view of a total of the quantization levels may be calculated. According to the above explanation decoders 32 and 33 and the deblocking circuits or scan-inverse-transforming circuits 34 and 35 are independently provided with processing circuits at the output sides of the respective prediction memories 18 and 19. However, it goes without saying that when an operation having a speed twice as fast as that of the processing circuits is performed and a time shearing processing is conducted, these processing circuits can be realized by a single circuit. The explanation has been given of the coding device of a digital image signal and the decoding device of a digital image signal such that they are constituted by circuit blocks. However, these devices may be constituted to utilize devices the operation of which is changeable as in a field programmable gate array (FPGA) or to operate a device by a software program by using a digital signal processor (DSP), or by a software programming using a microcomputer. Further, these devices can naturally constitute a system of a simple television conference when they are incorporated in personal computers. EMBODIMENT 3 An explanation will be given of Embodiment 3 of the present invention in reference to the drawings. According to Embodiment 3 a coding and decoding device of a digital image signal is constituted by a combination of the coding device as illustrated in Figure 1 and the decoding device as illustrated in Figure 11. According to Embodiment 3, in a combination in which information of a digital image signal is compressed and transmitted by the coding device of a digital image signal shown by Figure 1 and received data is decompressed and restored to the original data by the decoding device of a digital image signal shown by Figure 11, information showing what kind of blocking method, what kind of scan-transformation and what kind of coding method (referred to as a memory saving coding method including blocking etc.) are adopted by the blocking circuit or scan-transforming circuit 24 and the coder 25 at the coding device of a digital image signal, is transmitted in addition to the output signals shown in Figure 1, by multiplexing it to the coded data along with the quantization transforming coefficient etc., the information of the multiplexed memory saving coding method is separated and sent to the blocking circuit or scan-transforming circuit 30 and the coding circuit 31 and an operation thereof is performed to switch the information to the original one. Through this operation, for example, even if the coding method is changed and optimized at every block, the data can be stored in the memories by using coding methods which are brought into agreement in the coding device and the decoding device. That is, the motion compensating prediction and the decoding thereof are carried out at the difference former 2 and the adder 8 in the coding device and the operation is conducted such that a result the same as that by the decoding is provided at the adder 16 of the decoding device. Therefore, the deterioration of image due to coding and decoding in the motion compensating prediction loop can be minimized. When the operation is carried out such that the coding method differs at every block under such a constitution, it is preferable that the coding method is stored in the prediction memories 11 and 12 by expressing the coding method also between the coder 25 and the decoders 26 and 27 in the coding device. Similarly, it is preferable that the coding method is stored in the prediction memories 18 and 19 by expressing the coding method also between the coder 31 and the decoders 32 and 33 in the decoding device. In this case, it is the most pertinent that the coding method of the coder 31 is the same as the transmitted coding method of the coding device. There are various ways as methods of changing the coding method in accordance with blocks, such as selection of a coding method minimizing a total sum of error in a block in respect of the data before coding that is caused by the coding and decoding operation, selection of a coding method increasing the most the number of pixels in the block making smaller an error in respect of the data before coding that is caused by the coding and decoding operation than a certain threshold value, or a combination of these. Further, with respect to the errors, there are calculating methods such as calculating absolute values of differences, squared values etc. These are changed in accordance with more numerous images and the coding bit rate of the coding device and therefore, it is preferable to select them in accordance with cases.

Claims: A coding device for encoding image data using bi-directional motion compensation prediction and DCT transformation, the device comprising means (24) for blocking reference image data to form blocks of data corresponding to sub-groups of the reference image data, means (25) for coding the blocked data on a block basis in the spatial domain, means (3,9) for writing said coded data to a memory (11,12), wherein said memory (11, 12) stores coded data representing first and second reference images for use in bi-directional prediction, the device further comprising means for reading data from said memory, means (26, 27) for decoding said data read from said memory (11, 12), and means (28, 29) for de-blocking said decoded data to reproduce reference image data for use in bi-directional prediction the device further comprising averaging means (13) for averaging first and second reference image data output from said de-blocking means (28, 29). A decoding device for decoding image data coded using bi-directional motion compensation prediction and DCT transformation, the device comprising means (30) for blocking reference image data to form blocks of data corresponding to sub-groups of the reference image data, means (31) for coding the blocked data on a block basis in the spatial domain, means (21) for writing said coded data to a memory (18, 19), wherein said memory (18, 19) stores coded data representing first and second reference images for use in decoding using bi-directional prediction, the device further comprising means for reading data from said memory, means for decoding said data read from said memory (18, 19) and means (34, 35) for de-blocking said decoded data to reproduce reference image data for use in decoding using bi-directional prediction, the device further comprising averaging means (20) for averaging first and second reference image data output from said de-blocking means (34, 35). The coding or decoding device according to claim 1 or claim 2 for coding or decoding a digital image signal multiplexed with compressed digital audio signal data in respect of time axes wherein the means for reading reference data from the memory (11, 12) reads the reference data a processing time period before a predetermined time point so as to be in alignment with the multiplexed time axes data. The coding or decoding device according to claim 1 or claim 2, wherein the means (25, 31) for coding the blocked data comprises, for a given pixel: means for calculating a prediction value from at least a contiguous pixel; means for calculating the difference from the prediction value; and means for quantizing the difference. The coding or decoding device according to claim 4, wherein the prediction value relates to a spatially proximate contiguous pixel in the same field. The coding or decoding device according to claim 1 or claim 2, wherein the means (25, 31) for coding the blocked data comprises: means for calculating a dynamic range based on a maximum value and a minimum value of values of pixels in a block; means for calculating reference values from the dynamic range and means for quantizing the data in accordance with the reference values. The coding or decoding device according to claim 1 or claim 2, wherein the means (26, 27, 30) for coding the blocked data comprises: means for calculating quantization reference values from a distribution of values of pixels in a block; means for coding among the quantization reference values one level thereof; means for coding a quantization width information; and means for quantizing the data in accordance with the quantization reference values. The coding or decoding device according to claim 6, wherein the blocking means (24) blocks data in the same field in blocking the data. The coding or decoding device according to claim 6, wherein the means (25) for coding the blocked data codes the data such that in quantizing the data by calculating the quantization reference values from the values of the pixels in the block, if an error between a value of the data before quantizing the data and a value thereof quantized and transformed into a representative value is large, the representative value is replaced by a representative value reducing the error. A coding and decoding device comprising a coding device according to claim 1 or any of claims 3 to 9 dependent on claim 1 and a decoding device according to claim 2 or any of claims 3 to 9 dependent on claim 2. The coding and decoding device according to claim 10 comprising means for adding information indicating the method adopted by the means for coding the blocked data; means for inputting after transmission reference images for decoding images for the bi-directional prediction and blocking the data based on :he information indicating the method of coding the blocked data. A method of encoding and/or decoding mage data which is compressed using bi-directional motion compensating prediction and DCT transformation, in which data representing first and second reference images is stored and used for calculating or decoding prediction data, the method comprising blocking the reference image data to form blocks of data corresponding to sub-groups of the reference image data, coding the blocked data on a block basis in the spatial domain to compress the data writing the coded data representing first and second reference images to a memory (11, 12) for storage, the method further comprising reading and decoding data from the memory (11, 12), and de-blocking the decoded data to reproduce first and second reference image for use in bi-directional prediction, and averaging the first and second reference inage data. A method as claimed in claim 12 in which the compressed reference image data is arranged in blocks representing respective spatial areas.

Inventors: ASAMURA YOSHINORI, HATANO YOSHIKO, MISHIMI HIDETOSHI, ASAMURA, YOSHINORI, HATANO, YOSHIKO, MISHIMI, HIDETOSHI
Applicants: MITSUBISHI ELECTRIC CORP, MITSUBISHI DENKI KABUSHIKI KAISHA
Application year: 1996
Main classification: H04N7
IPC codes: H04N7, G06T9, H03M7