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:
This application is a continuation, of application Ser. No. 07/665,581 filed on Mar. 5, 1991, now abandoned. 
    
    
     BACKGROUND OF THE INVENTION 
     1. 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. 
     2. Description of Related Art 
     Most of the recent domestic digital video cassette recorders (referred to as a DVCR hereinafter) which are under development use a tape of 8 mm 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.4 mm, the width thereof is 6 μm and the surface recording density is 2.2 μm 2  /bit, for example, in the case of recording using four recording heads while the drum is rotated at 3600 rpm, the recording bit-rate is approximately 41.27 Mbps. On the other hand, if a digital video signal is a signal of 4:2:2 component in compliance with CCIR, the recording bit-rate is about 216 Mbps. Therefore, it is considerably difficult to record the signal in real time on the tape of 8 mm 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 are 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 roll,me of the information content. For example, an argument &#34;ON ADAPTIVE DCT CODING TECHNIQUES FOR DIGITAL VIDEO RECORDING&#34; (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 (Mar. 1988). An example of the variable length coding method is discussed therein, which reads as follows: 
     Each block of samples of size 8×8, 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 l coefficients (with R&gt;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&gt;0 and order them in an amplitude stack. For the k-th selected coefficient F k  the following holds: 
     
         |F.sub.k (R.sub.k)|≧|F.sub.k+1 (R.sub.k+1)|. . . , 
    
     
         |F.sub.k (R.sub.k)|&gt;0(1≦k≦l) 
    
     The corresponding addresses R k  are stored in an a stack. If |F j  (R j )|=|F k  (R k )|and R j  &lt;R k , then j&lt;k. 
     Step 2 ( construct-difference signal ): Calculate the amplitude differences D k  (R k ) defined by: 
     
         D.sub.k (R.sub.k)=|F.sub.k-1 R(.sub.k-1)|-|F.sub.k (R.sub.k)|, 2≦k≦l 
    
     
         D.sub.1 (R.sub.1)=|F.sub.1 (R.sub.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.sub.k =R.sub.k -N.sub.k (1,R.sub.k), D.sub.k 22 0 
    
     
         T.sub.k =R.sub.k -R.sub.k-1 -N.sub.k (R.sub.k-1,R.sub.k), D.sub.k =0 
    
     where N k  (R 1 , R 2 ) refers to the number of (previously encoded) coefficients Fj, 1≦j≦k-1 having R 1  ≦R&lt;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≦l 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 as well as the sign of each selected coefficient F k . 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 performed as explained hereinabove, even if samples holding much information content or less information content 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 is 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. 
     SUMMARY OF THE INVENTION 
     An object of this invention is to provide a variable length coding method capable of averaging the information content in each block after coding even if the information content of the samples in the block is varied. 
     Another object of this invention is to provide a variable length coding method capable of preventing degradation of the data in recording and reproducing the same. 
     A further object of this invention is to provide a variable length coding method, whereby the data related to assigning method of coding bits is added to the coded digital signal, thereby preventing deterioration of the error correction capability or increase of the transmission bit-rate. 
     According to a variable length coding method of this invention, 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; 
     FIGS. 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 bit 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 bit 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 another 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 ×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 ×240 lines, i.e., 1350 MB 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; ##EQU1## Thereafter, DCT on 8 picture elements in vertical direction is performed on 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); ##EQU2## 
     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 number 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 &#34;0000000001&#34;. 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 70 kbpi, 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 &#34;New Classes of Binary Codes Constructed on the Basis of Concatenated Codes and Product Codes&#34; (M. Kasahara, et al., IEEE Transactions on Information Theory, Vol. IT-22, No. 4, Jul. 1976) or the like. 
     By way of example, if the recording bit-rate of the image after it is compressed is about 25 Mbps 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 (C1 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 code-words 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. 
     As this invention may be embodied in several forms without departing from the spirit of essential characteristics thereof, the present embodiment is therefore illustrative and not restrictive, since the scope of the invention is defined by the appended claims rather than by the description preceding them, and all changes that fall within the metes and bounds of the claims, or equivalence of such metes and bounds thereof are therefore intended to be embraced by the claims.