Variable length coding method

Abstract: A variable length coding method designed to assign a different number of coding bits in accordance with the information content a sample holds when an analog signal such as a television signal or the like is converted to a digital signal. An assigning method of coding bits used to a luminance signal is different from that used to a chrominance signal. A variable length coding method is further capable of selecting an optimum assigning method in accordance with contents of an original signal from a plurality of determined assigning methods of coding bits. The data related to the plurality of assigning methods of coding bits is recorded on a medium after it is added to a coded digital signal.

Description: BACKGROUND OF THE INVENTION Field of the Invention This invention relates to a variable length coding method intended to assign a different number of coding bits in accordance with the information content of a sample in converting an analog signal such as a television signal, etc. to a digital signal. Description of Related Art Most of the recent domestic digital video cassette recorders (referred to as a DVCR hereinafter) which are under farther development use a tape of 8mm width. Fig. 1 illustrates a recording format of the DVCR conceivable from the present magnetic recording technique. Assuming that the length of a video track 21 of a tape 1 is approximately 62.4mm, the width thereof is 6µm and the surface recording density is 2. 2µm 2 /bit, for example, in the case of recording by use of four recording heads while the drum is rotated at 3600rpm, the recording bit-rate becomes approximately 41.27Mbps. On the other hand, if a digital video signal is a signal of 4:2:2 component in compliance with an advice by CCIR, the recording bit-rate is about 216Mbps. Therefore, it is considerably difficult to record the signal real time on the tape of 8mm width as it is inputted, and it becomes necessary to compress the inputted signal. Meanwhile, a variable length coding method is considered as one method for compressing a signal. According to this coding method, when the analog signal is converted to a digital signal, a large number of coding bits is assigned to a sample having a large volume of information content, whereas a small number of coding bits is assigned to a sample having a small volume of information content. That is, a different number of coding bits is assigned corresponding to the volume of the information content. For example, an argument "ON ADAPTIVE DCT CODING TECHNIQUES FOR DIGITAL VIDEO RECORDING" (P.H.N.DE WITH and S.M.C. BORGERS, Philips) is revealed on IERE Proc. 7th Int. Conference on VIDEO, AUDIO and DATA RECORDING (March 1988). An example of the variable length coding method is discussed therein, which reads as follows: Each block of samples of size 8x8, for example, are considered, and correspondingly, the coefficients remaining after cosine transformation are denoted as F(u,v), where 0≦u, v≦7, The absolute address R of a coefficient is defined as the ranking number determined by the scanning function S of the coefficients (Fig. 2), thus R=S(u,v), 25 where 0<R<63. The coefficients are scanned before the coding starts and ℓ coefficients (with R>0) to be of non-zero amplitude are assumed. Correspondingly, a coefficient is uniquely determined by its amplitude F and its address R (ranking number after scanning). Step 1 (full sort): Select coefficients with R>0 and order them in an amplitude stack. For the k-th selected coefficient F k the following holds: F k (R k ) ≧ F k+1 (R k+1 ) ··· , F k (R k ) > 0 (1≦k≦ℓ) The corresponding addresses R k are stored in an address stack. If |F j (R j )|= |F k (R k )| and R j < R k , then j<k. Step 2 (construct-difference signal): Calculate the amplitude differences D k (R k ) defined by: D k (R k ) = F k-1 R( k-1 ) - F k (R k ) , 2≦k≦ℓ D 1 (R 1 ) = F 1 (R 1 ) , k=1 This difference signal D k is a non-negative sequence for each block. The original amplitude signs sign(F k ) are encoded separately. There are no changes in the address stack during this step. Step 3 (address calculation): Recalculate from each address R k an address T k according to: T k = R k -N k (1,R k ), D k > 0 T k = R k - R k-1 - N k (R k-1 , R k ), D k = 0 where N k (R 1 , R 2 ) refers to the number of (previously encoded) coefficients F j , 1≦j≦k-1 having R 1 ≦R<R 2 . The stack with amplitude differences is not changed during this step. Step 4 (bit mapping): Coding of the sequence D k and the corresponding addresses T k for 1≦k≦ℓ is performed here with two variable-length code tables, viz. VLC D (D k ) and VLC T (T k ). Furthermore, the DC coefficient F(0) is always transmitted and the sings of each selected coefficient F k as well. An example of a list of Huffman codewords for amplitudes and addresses is given in Fig. 3. The DC coefficient F(0) is coded with some codeword C. The coding terminates with an EOB (End of Block) codeword since the number of coded coefficients may vary from block to block. In addition, the efficiency can be improved slightly by coding only the first coefficient with |F k | = 1 and skipping all the codewords from VLC D related to equal-valued coefficients. Since the conventional variable length coding method is exerted as explained hereinabove, even if samples holding much information content or less information content concentrate in one block, the signals are successively coded one by one, regardless of the fact of the concentration, according to the method. As a result, the amount of data becomes not constant relative to the capacity of a recording medium, requiring some kind of manipulation such as suppression of the data which causes degradation of the image quality in reproducing the data. In "Proceedings SPIE, Vol. 1244, Image Processing Algorithms and Techniques, 12- 14 February 1990, Santa Clara, US, pages 389- 405, R. Plompen et al.: 'Motion video coding; An universal coding approach" there is disclosed a VLC technique where a first value indicating the number of consecutive zero DCT coefficients and a second value indicating an absolute value of a non- zero DCT coefficient are obtained. In "SYMPOSIUM RECORD BROADCAST SESSIONS, 16th International TV Symposium Montreux, Switzerland, 17-22 June 1989, pages 387-409; K. GROTZ et al.: Image Coding Techniques for 64 kbit/s Channels" there is described a method for coding images which are formatted into blocks using the discrete cosine transform. Different methods are described for coding the resulting coefficients, among them are scalar quantization, entropy coding, and adaptive Huffman coding. WO-A-89/03159 discloses a method for compressing, formatting for transmission or recording a color digital video signal. Thereby during compression regions of frames are individually analyzed to select optimum coding methods specific to each region. The data stream segments are individually variable length coded according to their respective statistical distributions and formatted to form data frames. SUMMARY OF THE INVENTION A variable length coding method according to the present invention is disclosed in claim 1. The dependent claim discloses a particular embodiment thereof. According to a variable length coding method, a different number of coding bits is assigned in accordance with the information content a sample holds when an analog signal such as a television signal, etc. is coded to a digital signal. The assigning method of coding bits is made different for the kind of the analog signal, for example, between a luminance signal and a chrominance signal. Moreover, a plurality of assigning methods of coding bits are determined, so that an optimum assigning method is selected corresponding to the contents of the original signal. The data related to the plurality of assigning methods of coding bits is added to the coded digital signal for recording onto a recording medium. The above and further objects and features of the invention will more fully be apparent from the following detailed description with accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a diagram showing the pattern of a track of a tape for a DVCR; Fig. 2 is a diagram showing the scanning pattern of a signal; Fig. 3 is a list of Huffman codewords; Fig. 4(a) and 4(b) are diagrams showing the structure of a macro-block and a field, respectively; Fig. 5, 6, 7 and 8 are bit maps of the numbers of coding bits; Fig. 9 is a block diagram showing the structure at the recording side of a DVCR to which is applied a variable length coding method of this invention; Fig. 10 is a block diagram showing the structure of a coding circuit of Fig. 9; Fig. 11 is a table showing the calculating result of transmission bit-rates when a different hit map is used for a luminance signal from that for a chrominance signal: Fig. 12 is a table showing the calculating result of transmission bit-rates when the same hit map is used for a luminance signal as that for a chrominance signal; Fig. 13 is a table of the numbers of coding bits to be assigned; Fig. 14 is a block diagram showing the other structure of the coding circuit of Fig. 9; Fig. 15 is a table of the calculating result of transmission bit-rates when the numbers of coding bits of Fig. 13 are assigned; Fig. 16 is a diagram showing an example of the structure within one track of a tape; and Fig. 17(a), 17(b) and 17(c) are diagrams showing the structure of an error correction code. DESCRIPTION OF THE PREFERRED EMBODIMENTS A variable length coding method according to one preferred embodiment of this invention will be discussed in detail hereinbelow with reference to the accompanying drawings. It is to be noted here that the following description of the embodiment is directed to the case where a television signal in NTSC system is converted to a digital signal and recorded on a tape of a DVCR. The structure of a macro-block (MB) which is a coding unit according to the present embodiment is illustrated in Fig. 4(a). Each sub-block of a luminance signal (Y) and chrominance signals (R-Y) and (B-Y) consists of 8 samples x 8 lines. There are two sub-blocks of Y and each one block of R-Y and B-Y in one MB. As indicated in Fig. 4(a), the sub-block of R-Y or B-Y is physically equal in size to two sub-blocks of Y. Fig. 4(b) indicates the structure of a field of a video signal which field consists of 720 samples x 241 lines, i.e., 1350MB according to the present embodiment. In coding, a digital signal is converted by the known DCT (Discrete Cosine Transform) method. Supposing that the inputted image signal in each block is expressed by x(i,j) (i,j=0, 1, ···, 7), DCT on 8 picture elements in horizontal direction is performed to the image signal based on the equations as below; (m=1, 2, ..., 7) (j=0, 1, ..., 7) Thereafter, DCT on 8 picture elements in vertical direction is conducted to the transformed image signal f(0,j) and f(m,j) as indicated below, whereby the image signal is expressed by coefficients F(m,n) (m, n=0, 1, ..., , 7); (n = 1, 2 ..., 7) (m = 0, 1, ..., 7) The obtained coefficients are coded, when each sub-block is scanned by the function S called as zigzag scanning, similar to that shown in Fig. 2. In Fig. 2, the left-upper coefficient is called the DC one, and the other coefficients are called the AC ones. The DC coefficient is coded with 8 bits, while AC coefficients are coded through run-length coding, wherein R is a number with consecutive coefficients of zero value and S is an absolute value of the coefficient not being zero, and Huffman codeword is assigned to each coefficient corresponding to these R and S. When scanning by the function S, for example, if a coefficient A of 1 value follows two consecutive coefficients having zero values, the coefficient A has the data R=2 and S=1. In the present embodiment, an assigning method of coding bits in the sub-block of the luminance signal (Y) is made different from that in the sub-blocks of the chrominance signals (R-Y) and (B-Y). Fig. 5 shows a bit map for use in the assigning method of coding bits of the luminance signal. Since the DCT is carried out with 8 bits or 9 bits depending on the kind of the image, the number of bits is more or less varied. Table Y in Fig. 5 is shown in Fig. 6. It is found out from the map of Fig. 6 that the aforementioned coefficient A which has the data R=2 and S=1 is assigned with 6 as the number of coding bits. Similarly, Fig. 7 shows a bit map for use in the assigning method of coding bits of the chrominance signals and Table C in Fig. 7 is shown in Fig. 8. The structure at the recording side of a DVCR for embodying this invention is illustrated in Fig. 9, wherein numerals 1 and 2 represent a tape and a rotary drum, respectively. An analog video signal inputted from an input terminal 5 is converted to a digital signal at an A/D converter 7 through a low-pass filter 6. An output from the A/D converter 7 is processed by DCT treatment in a compressing circuit 8 and then subjected to a variable length coding and a correction coding and the like in a coding circuit 9. After the coded signal is modulated in a modulating circuit 10, it is recorded on the tape 1 by recording heads 3A, 3B, 4A and 4B. Fig. 10 is a block diagram showing the inner structure of the coding circuit 9. The video signal after the DCT is scanned by the function S in a scanning circuit 11. R and S of each coefficient are determined in a run-length detecting circuit 12 and a level detecting circuit 13. Each coefficient is inputted to a first memory 14 by using each binary code in combination of R and S as an address. Codes corresponding to respective addresses are written in the first memory 14 beforehand. In response to the binary code, a code is outputted from the first memory 14. Since the largest number of bits of the code outputted at this occasion is 21 (or 22), the obtained values of R and S are inputted to a detecting circuit 15 for number of bits so as to determine the effective number of bits. After the effective number of bits is determined in the circuit 15, the code is written into a second memory 16, corrected in an error correction coding circuit 17 and inputted to the modulating circuit 10. Hereinbelow, it will be compared how much the amount of data is reduced between the case where all the signals are coded according to only one coding method as in the prior art and the case where the signals are coded by changing the coding method corresponding to the tendency of the signals as in the present embodiment. Coding is performed for standard image signals and the transmission bit-rate is calculated. It is to be noted here that an image used here is three kinds of standard static images, namely, 1 ○ weather forecast, 2 ○ mountain village in Switzerland and 3 ○ tulip garden, based on the ITE chart of Television Institution. In the first place, the calculating result is compared between the following two cases: A: The bit maps of Figs. 5 and 6 are used for the luminance signal (Y) and the bit maps of Figs. 7 and 8 are used for the chrominance signals (R-Y) and (B-Y); B: The bit maps of Figs. 7 and 8 are used for both the luminance signal and the chrominance signals. The calculating result in each of the above cases A and B is tabulated in Figs. 11 and 12, respectively. As is clear from the comparison between Figs. 11 and 12, the transmission bit-rate of the luminance signal is reduced more in any case of A than B. Accordingly, it is more effective to reduce the transmission bit-rate to change the bit maps between the luminance signal and chrominance signals in accordance with the tendency of the signals, rather than to apply only one kind of the bit map to all the signals as in the conventional method. This method may be further developed to form a bit map fit for every different field or every different image. That is, combinations P(R,S) of R and S are formed, and the existing probability of the coefficient for each P(R,S) to the total number of coefficients in one image field is obtained, thereby assigning coding bits from a smaller one in the order of the probability from a larger one. Fig. 13 shows the coding bits assigned according to the above-described developed method. The structure of the coding circuit 9 for practicing the developed method is indicated in Fig. 14. When the run length (R) and the value of the coefficient (S) are determined in the similar manner as in Fig. 10, the value of the coefficient is counted one to the corresponding P(R,S) by a counter 18. At the same time, the coefficient is once stored in the first memory 14. After the coefficients of one field are completely counted, the existing probability of the coefficient is obtained by an order detecting circuit 19, and a ranking number form the first to 60th is assigned to each P(R,S) in the order from the one having the coefficient of a larger probability. Then, the number of coding bits is given by the detecting circuit 15 and at the same time, the address of the memory is controlled by an addressing circuit 20. Signals in the first memory 14 are sequentially read out from the first of the ranking number to be written in the second memory 16. The subsequent process goes the same as in Fig. 10. The calculating result by this method is tabulated in Fig. 15, which makes it clear that the transmission bit-rate is much more reduced than in the case A of Fig. 11, that is, the coding method of this invention is remarkably improved as compared with the conventional method. Now, it will be explained how to record the signal assigned with the number of coding bits in accordance with the above bit map on the tape 1. As shown in Figs. 5 and 6 (or Figs. 7 and 8), there are 60 combinations of R and S in total in the bit map wherein 3-14 bits are assigned. By the other combinations of R and S, either 18 bits or 21 (22) bits are assigned, i.e, the numbe of coding bits assigned is virtually constant. Therefore, the following description is made on the assumption to record the data related to the 60 combinations (R,S) on the tape 1. The combinations (R,S) are ranked in the order of the number of coding bits from a smaller one. Taking the case of Figs. 5 and 6 by way of example, the first rank is (0,1), the second rank (0,2), the third rank (1,1), .... The rank of the combination and a binary code corresponding to the subject combination (R,S) are written in the first memory 14 as an address. In the meantime, the combination (R,S) is expressed by a ten-bit code, each of R and S by five bits. For example, the combination (0,1) is defined by "0000000001". This code has 10 × 60 = 600 (bits)=75 (bytes) for one field, and accordingly approximately 150 bytes for one field including those of the chrominance signals. As compared with the recording format shown in Fig. 1, since the linear recording density is about 28 kbpcm (70kbpi), the amount of data recordable in one track is about 21500 bytes. An example of the inner structure of the track is shown in Fig. 16. Supposing that 4-5% or so of the video signals are assigned to a subcode area, the amount of data recordable in one subcode area is 336 bytes, which is enough to record the data related to the combination (R,S). Since the inner structure of the track is not restricted to that of Fig. 16, for example, the data related to the combination (R,S) may be recorded in a portion of ID signals in a different structure. Furthermore, the data corresponding to the bit map may be superimposed with an error correction code for being recorded on the tape 1. The superimposion of codes is disclosed, e.g., in "New Classes of Binary Codes Constructed on the Basis of Concatenated Codes and Product Codes" (M. Kasahara, et al., IEEE Transactions on Information Theory, Vol. IT-22, No. 4, July 1976) or the like. By way of example, if the recording bit-rate of the image after it is compressed is about 25Mbps and one field is constructed of two tracks, the amount of data per one track is about 27,000 bytes. Fig. 17(a) shows an example of the structure of codes in the track, wherein one track is divided into two blocks, each block constituted of a product code of (241,225,17) RS code (Cl code) and (64,60,5) RS code (C2 code). On the other hand, Figs. 17(b) and 17(c) show the structure of codes, wherein besides the structure of Fig. 17(a), (64,48,17) RS code is constructed of four codewords and superimposed with a check code portion of the C1 code. C1 code and C3 code are called also as an LDC (Long Distance Code) and employed in an optical disc apparatus, etc., realizing an error correction LSI. The transmission of data is carried out in a direction of the C1 code. The efficiency can be strengthened to a burst error if two blocks in one track are interleaved. The presence or absence of the superimposed C3 code is determined by an ID number. Without the superimposed C3 code, 8 error corrections are conducted by the C1 code. If the C3 code is superimposed, the superimposed portion is regarded as an erasure, so that four erasures and six error corrections are carried out by the C1 code. The error in the position of the erasure has the pattern (C3 code data+true error), so that the C3 code can be separated. In the case where correction is impossible in decoding the C1 code, a flag is erected for the codeword, with the erasure correction performed by the C2 and C3 codes. Only the C1 code is used for correction during the high sped search or the like. Supposing that the data related to the 60 combinations (R,S) is superimposed for recording, when the combination (R,S) is expressed by a code of 10 bits, as described earlier, the code is 75 bytes for one field, resulting in about 150 bytes per one field including those of the chrominance signals. In contrast, since the area of the superimposing code is 48 × 4 = 192 bytes as shown in Fig. 17(b), the binary code of (R,S) of one field can be sufficiently recorded. Although the superimposing code is so constructed as shown in Fig. 17 in the present embodiment, the structure thereof is not limited, but be formed in any arbitrary fashion. The bit map is changed between the luminance signal and color signals, and an optimum bit map is selected for every unit of a field in the foregoing embodiment. However, the bit map may be changed in the other manners. Furthermore, the sub-block and macro-block of the signal may be formed in a different structure from that shown in Fig. 4(a). Also the structure of one field may be changed from that of Fig. 4(b). According to the foregoing embodiment, the variable length coding system is applied to the case where a television signal is recorded on the DVCR. The same effect can be achieved even if the system is applied to the other signals or apparatuses.

Claims: A variable length coding method for coding a television signal containing a luminance signal and two kinds of chrominance signal to a digital signal in variable length, said method comprising the steps of: obtaining blocks having a predetermined number of sample signals by sampling said luminance signal and said chrominance signal respectively at predetermined first, second and third sampling frequencies; executing a DCT for each said block and obtaining coefficients; scanning said coefficients in a predetermined order and obtaining a value R indicating a number of consecutive zero coefficients and a value S indicating an absolute value of each coefficient; computing the existing probability of the combination of said R and S values; forming a bit map indicating the number of coding bits to be assigned in each combination of said R and S values on the basis of the existing probability; and coding each coefficient according to said bit map, characterized in that said step of forming a bitmap is performed for every different field or every different image, respectively. The method according to claim 1, wherein said step of forming a bitmap comprises forming a first bitmap for said luminance signal and a second bitmap for said chrominance signals.

Inventors: ARANO YUKARI, ONISHI KEN, ARANO, YUKARI, ONISHI, KEN, ARANO, YUKARI, C/O DENSHI SHOHIN KAIHATSU, ONISHI, KEN, C/O DENSHI SHOHIN KAIHATSU
Applicants: MITSUBISHI ELECTRIC CORP, MITSUBISHI DENKI KABUSHIKI KAISHA
Application year: 1991
Main classification: H04N7
IPC codes: H04N9, H04N7