Coding device

Abstract: There is provided a coding device characterized in that when a difference value between a sample value and a predictive value is quantized into a coding code of n bits, in the case of quantizing by a quantization unit which can output (2 n-1 - 1) coding codes correspond­ ing to positive quantization representative values, (2 n-1 - 1) coding codes corresponding to negative quantization representative values, and a coding code corresponding to the quantization representative value of the difference value 0, one remaining coding code is selectively made correspond to the positive and negative quantization representative values.

Description: BACKGROUND OF THE INVENTION Field of the Invention The present invention relates to a coding device and, more particularly, to a device for coding digital data such as audio signal, video signal, or the like having a correlation among data. Related Background Art Various kinds of coding methods have been proposed as a method of narrowing a transmission band, that is, a method of reducing an amount of transmission information in the case of digitally transmitting information such as video signal or audio signal. For instance, there has been known a predictive coding method (DPCM) for compressing an information amount by using the correlation between adjacent sample values. In the DPCM, a predictive value for a sample value to be coded is obtained from a decoded value of a coding code which is transmitted, a difference value (predictive error) between the predictive value and the sample value is quantized, and the coding code obtained by such a quantization is transmitted. Various predictive coding methods are provided in accordance with a method of producing the predictive value. Among them, Fig. 1 is a block diagram showing a fundamental construction of a coding device of the simplest previous value predictive coding method (predictive coding method which uses a preceding decoded value as a predictive value). In Fig. 1, a subtracter 12 subtracts a predictive value x ip (previous value decoded value in the embodiment) from a sample value x i which is input to an input terminal 10 and outputs a difference value e i . A quantization unit 14 quantizes the difference value e i and outputs a coding code y i . The coding code y i is transmitted from an output terminal 16 to a transmission path. The coding code y i is also supplied to an inverse quantization unit 18. The inverse quantization unit 18 converts the coding code y i into a difference value (quantization representative value Q(e i )). The predictive value is added to the quantization representative value Q(e i ) by an adder 20, so that the input sample value can be restored. Since the restored input sample value x i includes a quantization error, there is a possibility such that it exceeds a range of the original input sample value. Therefore, the range is amplitude limited by a limiter 22. An output of the limiter 22 is a local decoded value x i and is input to a D flip-flop (predictor) 24. In the example, since the previous value decoded value is set to a predictive value, the predictor is constructed by a D flip-flop, that is, a delay circuit having a delay time corresponding to one sample period (one clock cycle). In the next clock cycle, the D flip-flop 24 supplies the local decoded value x i as a predictive value to the subtracter 12 and adder 20. The predictive value for the sample value x i is written as x ip by adding a subscript "p". Generally, a probability distribution of the difference values between the predictive values and the input sample values is one-sided in a portion of a small value. The information amount can be compressed by finely setting quantization steps of a portion of a small difference and by coarsely setting (non-linear quantization) a portion of a large difference. However, in the conventional example, in the case where the difference value "0" is used as a quantization representative value and there are used midtread type quantization characteristics in which the quantization representative values are arranged symmetrically with respect to the positive and negative values, the number of quantization representative values is set to an odd number. On the other hand, since the number of quantization representative values which can be expressed by n bits is set to 2 n , in the case where the DPCM code is set to an n-bit fixed length, one code remains. Fig. 2 is a diagram showing such midtread type quantization characteristics. That is, for instance, assuming that an coding code consists of four bits, there are fifteen kinds of coding codes other than the coding code corresponding to the difference value "0". Every seven coding codes are assigned to the positive quantization representative values and the negative quantization representative values, respectively. Therefore, the quantization steps become coarse and in the case of coding the video signal, there is a large possibility such that a large quantization error is generated in the edge portion of an image, namely, what is called an edge business or the like occurs. On the other hand, when the quantization steps are substantially reduced, gradient overload noises or the like are generated. On the other hand, in the case of using midriser type quantization characteristics in which the difference value "0" is not used as a quantization representative value, every eight coding codes can be assigned to the positive quantization representative values and the negative quantization representative values, respectively, and the quantization steps themselves can be relatively decreased. However, on a flat screen, in the case where the difference value "0" is not used as a quantization representative value, the decoded value changes in spite of the fact that the screen is flat, so that what is called a granular noise or the like easily occurs. It is an concern of the invention to solve the above problems under such circumstances. An embodiment of the invention provides a coding device in which quantization steps can be reduced even in the case of forming coding codes on the basis of the midtread type quantization characteristics. In accordance with the present invention there is provided a coding device as set out in claim 1. The present invention will be more readily understood from the following detailed description given by way of example and with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a block diagram showing a construction of a conventional general predictive coding device; Fig. 2 is a diagram showing quantization characteristics of a midtread type; Fig. 3 is a block diagram showing an embodiment of a coding device according to the invention; and Fig. 4 is a block diagram showing a second embodiment of the invention. DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS An embodiment of the present invention will be described hereinbelow with reference to the drawings. Fig. 3 is a block diagram showing a coding device embodying the invention. Reference numeral 30 denotes an input terminal; 32 a subtracter; 34 a quantization unit; 36 an output terminal; 38 an inverse quantization unit; 40 an adder; 42 a limiter; 44 a D flip-flop serving as a predictor; and 46 an MSB extraction circuit to extract the most significant bit MSB of a predictive value. The operation of the device of Fig. 3 will now be described. The subtracter 32 subtracts the predictive value x ip from the sample value x i which is input to the input terminal 30 and outputs the difference value e i . In accordance with an MSB signal (the most significant bit MSB of the predictive value) which is output from the MSB extraction circuit 46, the quantization unit 34 selects first quantization characteristics in which the number of coding codes corresponding to the negative quantization representative values, which will be explained hereinlater, is large when the MSB signal is set to "1", and the quantization unit 34 selects second quantization characteristics in which the number of coding code corresponding to positive quantization representative values is large when the MSB signal is set to "0". Then, the quantization unit 34 quantizes the difference value e i and converts into the DPCM code. The DPCM code which is output from the quantization unit 34 is transmitted from the output terminal 36 to a transmission path and is also input to the inverse quantization unit 38. In response to the MSB signal output from the MSB extraction circuit 46, the inverse quantization unit 38 inversely converts the DPCM code into the quantization representative value (difference value) Q(e i ) by the inverse quantization characteristics corresponding to the quantization characteristics in the quantization unit 34. The adder 40 adds the predictive value to the quantization representative value and the limiter 42 amplitude limits the addition signal from the adder 40. An output of the limiter 42 corresponds to the local decoded value x i and is delayed until the next clock cycle by the D flip-flop 44 and is used as a predictive value of the next sample value and is supplied to the subtracter 32, MSB extraction circuit 46, and adder 40. The reason why the quantization characteristics are selected by the MSB signal output of the MSB extraction circuit 46 will now be described on the basis of numerical values. Table 1 shows an example of the quantization characteristics (first quantization characteristics) in the case where the MSB of the predictive value is set to "0". Table 2 shows an example of the quantization characteristics (second quantization characteristics) in the case where the MSB of the predictive value is set to "1". In this case, it is assumed that the input sample value consists of seven bits (0 to 127) and the DPCM code consists of three bits. As mentioned above, assuming that the difference value "0" was first assigned as a representative value and the same number of positive and negative representative values were assigned, one code remains ("100" in Tables 1 and 2). Therefore, in the embodiment, an attention is paid to the predictive value and the following processes are executed. That is, assuming that the predictive value for the input sample value x i is set to x ip and the predictive error (difference value) is set to e i and the maximum value and the minimum value of the input sample value are set to x max and x min , respectively, x min - x ip ≦ e i ≦ x max - x ip When x ip which satisfies the following equation x ip - x min = x max - x ip is obtained, x ip = (1/2) (x max + x min ) Now, assuming that x max = 127 and x min = 0, x ip = 63.5 from the equation (2). Therefore, it will be understood that when x ip ≧ 64, the negative range of the predictive error e i is larger and when x ip < 64, the positive range is larger. (MSB = "0") Range Representative value Code ∿ 33 42 100 32 ∿ 17 23 011 16 ∿ 7 10 010 6 ∿ 2 3 001 1 ∿ -1 0 000 -2 ∿ -6 -3 101 -7 ∿ -16 -10 110 -17 ∿ -23 111 On the other hand, it is known that assuming that the maximum value of the difference value is set to e max and the maximum value of the quantization representative value is set to Q(e max ), the gradient overload can be almost ignored if Q(e max ) ≧ (1/3)e max . In the above example, since e max = 127, Q(e max ) ≧ 127/3 ≈ 42. In order to eliminate the influence by the gradient overload, a quantization representative value of 42 is necessary. On the other hand, the gradient overload easily occurs in a larger range of the difference value. Therefore, when x ip ≧ 64, the negative quantization representative value (-42) is assigned to a code "100". When x ip < 64, the positive quantization representative value (42) is assigned to a code "100". The predictive value consists of seven bits. When 64 is expressed by a binary number, it is expressed by "1000000". Therefore, the above discrimination can be performed on the basis of the most significant bit (MSB) of the predictive value. (MSB = "1") Range Representative value Code ∿ 17 23 011 16 ∿ 7 10 010 6 ∿ 2 3 001 1 ∿ -1 0 000 -2 ∿ -6 -3 101 -7 ∿ -16 -10 110 -17 ∿ -32 -23 111 -33 ∿ -42 100 In the case of the video signal, since the signal of a certain level or less is used as a sync signal, the minimum value is not always set to 0. In this case, if the last quantization representative value is assigned by the MSB of the predictive value, there is a possibility such that the quantization representative value is assigned to a narrow range. Fig. 4 is an arrangement block diagram of the second embodiment of the invention which copes with such a situation. In Fig. 4, the same components as those shown in Fig. 3 are designated by the same reference numerals. The second embodiment differs from the first embodiment of Fig. 3 with respect to a point that a comparison circuit 48 is used in place of the MSB extraction circuit 46. A different point from Fig. 3 will now be described. Both of the predictive value x ip and a central value M of the range of the input sample value are input to the comparison circuit 48. The comparison circuit 48 outputs "1" when x ip is larger than M. The comparison circuit 48 outputs "0" when x ip is equal to or smaller than M. An output of the comparison circuit 48 is supplied to the quantization unit 34 and inverse quantization unit 38 in a manner similar to the output of the MSB extraction circuit 46. The quantization unit 34 and inverse quantization unit 38 select the characteristics on the side in which the range of the negative quantization representative values is wide when the output of the comparison circuit 48 is set to "1", while they select the characteristics on the side in which the range of the positive quantization representative values is wide when the output of the comparison circuit 48 is set to "0". The operation will now be practically explained hereinbelow. From the equation (2), when x min = 16, x ip = (127 + 16)/2 = 71.5. When the predictive value x ip is 72 or more, the negative range of the predictive error e i is large. When the predictive value x ip is smaller than 72, the positive range of e i is large. Therefore, it is sufficient that the assigning method of the last quantization representative value is determined on the basis of the comparison between the magnitudes of the predictive value x ip and the above value 72. Therefore, both of the predictive value x ip and the central value M of the input sample value, that is, (1/2)(x max + x min ) are input to the comparing circuit 48 and are compared. On the basis of the result of the comparison, the last quantization representative value, that is, the quantization representative value corresponding to the coding code "100" in the example of Tables 1 and 2 is assigned. Although the embodiment has been described above with respect to the case where the positive and negative quantization representative values were symmetrically assigned, the invention is not limited to the above example. A similar effect is obtained if the range of the quantization representative values in the wider range of the difference values is widened when the last representative value was assigned. On the other hand, in the above embodiment, the previous value prediction has been used as a predicting method. However, the invention is not limited to such a predicting method but can be also applied to other predicting methods such as two-dimensional prediction, three-dimensional prediction, adaptive prediction, and the like. As will be easily understood from the above description, according to the invention, the picture quality (particularly, the gradient overload characteristics) after completion of the decoding can be remarkably improved without increasing an amount of information to be transmitted at all.

Claims: A device for encoding a signal comprising: subtracting means (32) for forming a difference value (ei) between a sample value of the signal and its predictive value; quantizing means (34) for encoding the difference value using coding codes; and inverse quantizing means for decoding encoded codes encoded by the quantizing means; and means (40,42,44) for determining predictive value on the basis of the predictive value of the preceding cycle and the output of the inverse quantizing means, CHARACTERISED IN THAT the device additionally comprises means (46,48) responsive to the predictive value to discriminate whether or not the range of a value to which the difference value can be set is wide for either positive or negative values and for causing in accordance with the result of the discrimination the quantizing means either to operate in a mode in which the number of coding codes corresponding to the positive quantization representative values is larger than the number of coding codes corresponding to negative quantisation representative values or a mode in which the number of coding codes corresponding to the negative quantization representative values is larger than the number of coding values corresponding to positive quantization representative values. A device according to claim 1, wherein the responsive means comprises switching means selecting the mode of the quantizing means in accordance with whether the predictive value is a predetermined value or not. A device according to claim 2, including means (46) for extracting the most significant bit of the predictive value, said most significant bit being used for selection of the mode of the quantizing means. A device according to claim 2, including means (48) for comparing the predictive value and the predetermined value, the result of said prediction being used for selection of the mode of the quantizing means. A device according to any one of claims 1 to 4 wherein the quantizing means outputs the encoded code corresponding to either a predetermined quantization representative value and/or a special code selectively representative values in accordance with the positive and negative symmetrical midtread-type quantization characteristics. A device according to any one of claims 1 to 5, wherein in the first and second modes all of the coding codes, excluding the special code, correspond to common absolute quantization representative values.

Inventors: ISHIKAWA HISASHI C O CANON KAB, ISHIKAWA, HISASHI, C/O CANON KABUSHIKI KAISHA
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1990
Main classification: H03M7
IPC codes: H03M7, H04N7, H04N1, H03M3