Bit-stream allocating and restoring method for digital VCR and data compressing/decompressing apparatus using the same

Abstract: A method for allocating and restoring a bit-stream, in which when the code amount of the bit-stream generated as a result of variable-length encoding with respect to macro blocks included in a segment exceeds an allowable segment capacity, the excess bit amount is maintained at its maximum in a range where compatibility with a conventional SD-VCR is guaranteed, to thereby improve the quality of a reproduced image, and data compressing/decompressing apparatuse suitable for the methods is provided. The method for allocating the bit-stream includes the steps of: (a) allocating the bit-stream of each DCT block, generated as a result of quantizing and variable-length encoding the DCT coefficient of each DCT block, to DCT block within the macro block; (b) reallocating the bits remaining during the step (a) to another DCT block within macro block; (c) reallocating the bits remaining during the step (b) to another macro block within the segment; (d) reallocating the bits remaining during the step (d) to another segment having the macro block of the same content as that of previous or following frame. In this method for allocating the bit-stream, when a remaining bit amount in a segment unit is generated, the remaining bit amount is propagated to an adjacent segment and is recorded therein so that deterioration of the reproduced screen can be prevented.

Description: The present invention relates to an allocation of a bit-stream generated as a result of a variable-length encoding in a standard-definition videocassette recorder (SD-VCR), and more particularly, though not exclusively, to methods for allocating and restoring the bit-stream, in which, when the code amount of bit-stream generated as a result of the variable-length encoding with respect to macro blocks included in a segment exceeds an allowable capacity of the segment, the excessive bits are reserved within the limitation of compatibility with a conventional SD-VCR, to thereby improve the quality of a reproduced image, and to data compressing/decompressing apparatus suitable for such methods. With the development of digital signal processing technology, most information transfer media are being converted into digital form due to the advantages of digital processing compared with analog processing. Thus, a digital VCR providing a high quality image during a multi-dubbing operation can be realized. In a digital VCR, a DCT block of input image is classified into one of four classes according to the activity and the bit is adaptively allocated to each class so that the encoding capacity of the system is improved and the amount of data generated from each frame is constantly maintained. Thus, according to an image compressing method of a digital VCR, after dividing one frame into sub-frames (segments) having a predetermined size, each segment is independently encoded and the amount of data generated from each segment is maintained at a constant level. In the conventional digital VCR, the data is compressed until the quality of a reproduced picture is not lowered below a predetermined level. Thereafter, the remaining data is discarded, in order, from data whose effect with respect to the quality of the reproduced picture is least, so that the amount of data per segment is maintained at a constant level. Generally, as the activity of the input image is larger, the amount of generated data is greater. However, since the amount of data per segment is fixed in a conventional digital VCR, as the activity of the input image is larger, the quality of the reproduced image is lower. EP-A-616 497 discloses a method according to the precharacterising portion of claim 1 appended hereto. US-A-5 323 187 discloses an image compression system using the setting of fixed bit rates for compressing an image wherein image blocks are sorted into classes in accordance with the activities of the blocks, the activities being obtained by dividing an original image by a predetermined unit. Individual scale factors are given for each block, so that coding is carried out by fixing the allocating amount of bits to blocks to be coded. The system is operated by a method which detects activities according to a visual characteristic for each predetermined block unit, classifies blocks into corresponding classes based on the detected activities, sets a quantization scale factor corresponding to a sorted class by the average activity of the activities, controls the quantization by determining a quantization stepsize according to a predetermined value of a quantization table and a quantization scale factor, determines the pertinence of bit number of the quantized coefficient with respect to an allocated bit number per block, and repeatedly adjusts the block bit number to be output to carry out entropy coding. It is an aim of preferred embodiments of the present invention to provide a method for allocating a bit-stream, in which the quality of the reproduced image is maintained by maximally using the bit-stream resulting through a variable-length coding. It is another aim of preferred embodiments of the present invention to provide a method for restoring a bit-stream, suitable for the above bit-stream allocating method. It is still another aim of preferred embodiments of the present invention to provide a data compressing apparatus suitable for the above allocating method. It is yet another aim of preferred embodiments of the present invention to provide a data decompressing apparatus suitable for the above restoring method. According to a first aspect of the present invention, there is provided a method for allocating a bit-stream into a digital VCR tape having fixed-length segments comprising a plurality of macro blocks having a plurality of DCT blocks, wherein the bit-stream is generated as a result of quantizing and variable-length-encoding DCT coefficient of each DCT block, comprising the steps of: (a) allocating the bit-stream of each DCT block, generated as a result of quantizing and variable-length encoding the DCT coefficient of each DCT block, to DCT block within the macro block; (b) reallocating the bits remaining during the step (a) to another DCT block within said macro block; (c) reallocating the bits remaining during the step (b) to another macro block within the segment; characterised by (d) reallocating the bits remaining during the step (d) to another segment having the macro block of the same content as that of previous or following frame. Suitably, said step (d) comprises the steps of: searching a macro block having the same content as that of macro block being in the searching region of the currently encoded frame; error-processing a recording region corresponding to said searched macro block in the segment having the macro block searched during said macro block searching step; and reallocating the bits remaining during said step (c), to said error-processed recording region. Suitably, the size of said searching region is less than or equal to a super block. Suitably, a STA information is used in said error-processing step. Suitably, said STA information of said error-processing step has the value of "0010" or "1100". Suitably, the location information of the segment in which the remaining bit amount is generated is recorded in a region for recording a DC coefficient of the macro block in which the remaining bit amount is reallocated. Suitably, a STA signal other than "0000", "0010", "1010", "0100", "1100", "0110" and "0111" is used in said error-processing step. Suitably, at least one bit among bits composing said STA signal is used as a direction information bit representing the previous or following frame and the remaining bits are used as a location information bit representing an offset from the current segment to the reallocated segment. Suitably among bits s0, s1, s2 and s3 composing said STA signal, s0 is used as the direction information bit, and s1, s2 and s3 are used as the location information bits. According to a second aspect of the present invention, there is provided a method for restoring a bit-stream from a digital VCR tape having fixed-length segments, wherein the bit-stream is the result of quantizing and variable-length-encoding DCT coefficient of a DCT block in an allocated segment after being classified into the levels of a DCT block, a macro block and a segment, comprising the steps of: (a) determining whether the macro block having an incomplete bit-stream exists in the segment; (b) restoring the remaining bit-stream from another macro block in the segment when it is determined in the step (a) that the macro block having an incomplete bit-stream exists; (c) searching a segment having an error-processed macro block in the searching region when the macro block having an incomplete bit-stream is not completely restored during the step (b); and (d) restoring the incomplete bit-stream in the segment searched in the step (c), using the bit-stream included in the error-processed macro block. Suitably, said searching region is less than or equal to a super block. According to a third aspect of the present invention, there is provided a data compressing apparatus of a SD-VCR, for compressing a bit-stream generated as the result of quantizing and variable-length-encoding DCT coefficient of a DCT block in an allocated segment after being classified into the levels of a DCT block, a macro block and a segment, which comprises a frame memory, a DCT converter, a motion amount detector and DCT mode determiner, a quantizer, a bit amount controller, a variable-length encoder, a shuffler, a bit-stream allocater and a deshuffler, further comprising: a macro block searching means for searching a macro block having the same content in the searching region of a previous or following frame; and STA value setting means for calculating the location difference between the macro block searched in the macro block searching means and the currently processed macro block, for setting a STA value corresponding to the location difference and for providing the STA value to the bit-stream allocator. According to a fourth aspect of the present invention, there is provided a data decompressing apparatus of a SD-VCR, for decompressing a bit-stream generated as the result of quantizing and variable-length-encoding DCT coefficient of a DCT block in an allocated segment after being classified into the levels of a DCT block, a macro block and a segment, comprising: a shuffler for reconstructing a segment from the reproduced data; a bit-stream inverse allocator for extracting the variable-length-encoded data in a unit of a macro block and the STA information of the macro block in which the error is generated, from the segments output from the shuffler; a variable-length decoder for performing the variable-length decoding by receiving the variable-length-encoded data in a macro block unit, output from the bit-stream inverse allocator; inverse DCT means for restoring the image signal of a time region by performing the inverse DCT conversion with respect to the variable-length-decoded data provided from the variable-length decoder and outputting the restored image signal; a deshuffler for deshuffling the data of a macro block unit, inverse-DCT-converted by the inverse DCT portion, to return the inverse-DCT-converted coefficient to the initial position and outputting the result; a concealment processor for receiving STA information of a macro block in which error is generated, output from the bit-stream inverse allocator and for generating the location information of a macro block corresponding to the macro block in which an error is generated in a previous or following frame; and a frame memory for determining whether the error is generated in the macro block provided from deshuffler, using the location information provided from the concealment processor, for replacing the macro block in which an error is generated by the corresponding macro block of the previous or following frame when the error is generated, and outputting the result. According to a sixth aspect of the present invention there is provided a video apparatus provided with apparatus according to any one of the preceding apparatus of the present invention. The present invention will become more apparent by describing in detail preferred embodiments thereof, by way of example only, with reference to the attached drawings in which: Figure 1 is a block diagram showing the whole construction of a conventional SD-VCR; Figure 2 is a diagram showing a track structure of a conventional SD-VCR; Figures 3A and 3B are diagrams showing track structures where a 525/60Hz signal and a 615/50Hz signal are recorded, respectively (prior art); Figure 4 is a block diagram showing a detailed structure of the data compressor shown in Figure 1; Figure 5 is a diagram showing a process for generating an image signal of a 4:2:0 format according to the CCIR recommendation 601 (prior art); Figures 6A and 6B show a frame structure of a 4:2:2 format signal and a 4:2:0 format signal as a macro block unit, respectively (prior art); Figures 7A and 7B show a macro block of a 4:2:2 format signal and a 4:2:0 format signal, respectively (prior art); Figure 8 is a diagram showing a shuffling step in a 525/60Hz signal (prior art); Figure 9 is a diagram showing division of a region for constructing a segment (prior art); Figures 10A and 10B show an 8×8 DCT block and a 2×4×8 DCT block, respectively (prior art); Figures 11A and 11B show divided regions of an 8×8 DCT block and a 2×4×8 DCT block, respectively (prior art); Figure 12 is a flow chart for illustrating a method for allocating a bit-stream according to the present invention; Figure 13 is a flow chart for illustrating the step 1230 of Figure 12 for reallocating the bit-stream in another segment; Figure 14 graphically shows the method for allocating the bit-stream according to the present invention illustrated in Figure 12; Figure 15 is a diagram showing a data allocation in a macro block of a segment; Figure 16 is a diagram showing a method for constructing a STA code; Figure 17 is a block diagram showing a structure of a data compressor according to the present invention; and Figure 18 is a block diagram showing a structure of a data decompressor according to the present invention. Referring to Figure 1, a SD-VCR comprises an analog-to-digital (A/D) converter 10, a data compressor 12, an error correction encoder 14, a channel encoder 16, a reproducing portion 18, an error correction decoder 20, a data decompressor 22 and a digital-to-analog (D/A) converter 24. An input signal is provided to data compressor 12 via A/D converter 10. A sound signal is recorded as a pulse code modulation (PCM) signal without compression. The image digitized by A/D converter 10 has a sampling structure of a 4:4:2 format according to the CCIR recommendation 601. The image having a 4:4:2 format has a data rate of 167Mbps on the basis of a valid pixel. Data compressor 12 compresses screen data (cf. Table 1) using a discrete cosine transform (DCT) and a variable-length coding (VLC), to output the compressed-encoded image data having a data rate of 24.948Mbps. Error correction encoder 14 adds an error correction code to compressed video data, sound data, a subcode and auxiliary data, respectively. The data to which the error correction code is added is record-encoded by channel encoder 16 and is then recorded on magnetic tape. The data rate of recorded data is increased to 41.85Mbps by the error correction encoding and channel encoding. After an error generated during recording and reproducing is corrected on the data reproduced by reproducing portion 18, via error correction decoder 20, the image and sound signals are restored via data decompressor 22 and D/A converter 24. A specification of the SD-VCR is shown below. recording mode rotary azimuth recording image sampling frequency: image input format Y=13.5MHz, C r , C b =6.75MHz 4:1:1(525/60), 4:2:0(625/50) data compression method DCT, VLC, encoding within screen data rate after compressing: audio signal recording mode 24.948Mbps (PCM digital recording) sampling frequency/ bit number/channel 48KHz/16/2, 44.1KHz/16/2, 32KHz/16/2, 32KHz/12/4 error correction code Reed-Solomon product code recording code scrambled I-NRXI, 24-25 converting code recording data rate about 42Mbps detecting method partial response class 4 drum rotating speed 9000RPM track width 10µm Figure 2 is a diagram showing a track structure of a conventional SD-VCR. Here, the track of a SD-VCR is classified as an insert and track information (ITI) sector 200, an audio sector 202, a video sector 204 and a sub-code sector 206, in sequence, beginning from a track starting point where a head starts scanning, and gaps G1, G2, G3 are between each sector respectively. ITI sector 200 has an ITI pre-amble region 208, a start-sync block region 210, a track information region 212 and an ITI post-amble region 214. Audio sector 202 has an audio preamble region 216, 14 audio data sync block region 218 and an audio post-amble region 220. Video sector 204 has a video preamble region 222, 149 video data sync block region 224 and a video postamble region 226. Sub-code sector 206 has a sub-code preamble region 228, a sub-code region 230, a sub-code post-amble region 232 and an overwrite margin 234. The head helically scans from the lower end to the upper end of each track. When a tape is scanned at a speed of 18.831mm per second, the track slope is 9.1668°. One frame of a 525/60Hz image signal is recorded in ten tracks as shown in Figure 3A, and one frame of a 625/50Hz image signal is recorded in twelve tracks as shown in Figure 3B. ITI sector 200 provides track information and location information of data for editing. A time interval of detected information is calculated so that the location of image, sound and sub-code is detected. In the sub-code, auxiliary data such as a recording date and time is recorded. The sub-code sector is read in synchronization with the image and sound recorded in the tape. Also, a subtitle and screen commentary can be recorded, and high speed searching (200 times) can be performed using part of the sub-code. In a recording track, an azimuth recording is performed to prevent disturbance between neighbouring recording tracks. Here, the azimuth angle is ±20°. The necessary capacity of an input image signal having a 4:1:1 or 4:2:0 format is about five times as much as the recording capacity of a SD-VCR. Thus, a signal compressing or restoring technique is required. An image compression technique used in a VCR should reflect tape characteristics and guarantee editing and trick-play functions and minimum error propagation. In order to achieve these functions, since the tape is a sequentially accessed medium, the encoding should be independently performed by a small image unit within a screen. According to a current standard, a segment is an independent compression-encoding unit. One segment is composed of five macro blocks. During the decoding process, at least one macro block can be independently decoded so that error propagation is reduced and effective trick play can be performed since as much of the macro block as possible is restored. Figure 4 is a block diagram showing a detailed structure of the data compressor 12 shown in Figure 1. In Figure 4, the data compressor comprises a frame memory 30, a DCT converter 32, a motion amount detector and DCT mode determiner 34, a quantizer 36, a bit amount controller 38, a variable-length encoder 40, a shuffler 42, a bit-stream allocator 44 and a deshuffler 46. A SD-VCR uses a DCT VLC compression method. The image signal input to frame memory 30 has a 4:2:2 or 4:2:0 format. A luminance signal (Y) and color difference signals (C r and C b ) are sampled at 13.5MHz and 6.75MHz, respectively. In the case of a 525/60Hz signal, the color difference signals are 2:1 sub-sampled in the horizontal direction to become a 4:2:2 format, and in the case of a 625/50Hz signal, a scanning line of two color difference signals is reduced to one half according to line sequence in the vertical direction so that a signal having a 4:2:0 format is produced. Figure 5 is a diagram showing a process for generating an image signal of a 4:2:0 format according to the CCIR recommendation 601. In the case of a 525/60Hz (or 625/50Hz) signal, the size of the Y signal is 720 (or 720) pixels in width and 480 (or 576) lines in length, and the size of two color difference signals is 180 (or 360) pixels in width and 480 (or 288) lines in length. One DCT block is composed of 8×8 pixels. Since an incomplete 4×8 (half-size) block occurs at the right end of every line in the case of the color difference signal of 525/60Hz, one block is formed by using a signal pair (upper and lower). Thus, in the case of a 525/60Hz (or 625/50Hz) signal, the Y signal is composed of 90 (or 90) DCT blocks in width and 60 (or 36) DCT blocks in length. The color difference signals are composed of 22.5 (or 45) DCT blocks in width and 60 (or 36) blocks in length (see Figures 6A and 6B). As shown in Figures 7A and 7B, the macro block is composed of four Y blocks (which are located in the same position of the screen), one C r block, and one C b block. The macro block is a basic unit for the shuffling and for determining a quantized value. Figure 8 is a diagram showing a shuffling step in the case of a 525/60Hz signal. Five vertical regions from A to E are provided and each region is divided into ten sub-regions. Here, each sub-region is called a super block. Each super block is composed of 27 macro blocks. Thus, one frame screen is composed of 50 super blocks, ten vertically and five horizontally, and in the case of a 625/50Hz signal, 60 super blocks comprises one frame screen, twelve vertically and five horizontally. The super blocks included in the vertical region are sequentially recorded on the same track of the tape later. As shown in Figure 8, a segment is composed by taking one macro block from each vertical region after evenly dividing a one-frame screen into five regions in the vertical direction, in the order: C, B, D, A and E. This sequence is determined according to the visual importance of each vertical region. As many segments as the number of macro blocks included in the super block are generated. Since one segment is composed of the screen pieces distributed in the various positions, there is a high probability that the amount of information in each segment is about the same. When the amount of information is more constant, the code amount can be effectively fixed. The above process, whereby the whole screen is mixed by a macro block unit, is called "shuffling." The compression encoding is independently performed in a segment unit and the generated code amount is the same in each segment. When constructing a segment, the macro blocks are shuffled but the macro blocks return to the initial position just before recording. This is called deshuffling. The reason for deshuffling is for maximally allocating the data read during a high speed reproduction in sequence so as to construct a visually better picture. The picture in the high reproduction mode is mosaicked by the sub-pictures distributed into a plurality of tracks. The screen quality deterioration during trick-play can be prevented greatly by fixing the code amount per segment. In Figure 9, five super blocks of the horizontal direction are recorded in one track. Since ten rows exist in the vertical direction, one screen is recorded in ten tracks. 135 sync blocks in one track, for an image recording, are respectively matched with 135 macro blocks from five super blocks. In the SD-VCR, the DCT block size is varied according to the motion information. If the amount of motion is low, an 8×8 DCT block is taken. On the other hand, if the amount of motion is large, two 4×8 DCT blocks are taken by calculating the sum and difference between two vertically adjacent pixels. Figures 10A and 10B show an 8×8 DCT block and a 2×4×8 DCT block, respectively. The range value of each coefficient is differently reduced by multiplying each DCT block by the corresponding weight matrix. As the frequency component is higher, the value of the weight matrix is smaller. Each DCT block is classified into one of four classes. Class 0: A DCT block in which quantization noise is visible and the maximum absolute value of AC coefficients is less than or equal to 255. Class 1: A DCT block in which the visibility of the quantization noise is lower than Class 0 and the maximum absolute value of AC coefficients is less than or equal to 255. Class 2: A DCT block in which the visibility of the quantization noise is lower than Class 1 and the maximum absolute value of AC coefficients is less than or equal to 255. Class 3: A DCT block in which the visibility of the quantization noise is lower than Class 2 or the maximum absolute value of AC coefficients is greater than 255. The AC component in a DCT block is classified into four regions (region 0 to region 3) and the coefficients within the same region are quantized by the same quantization step. The class and regions in the DCT block are factors for determining the quantization step. Each quantization step is a power value of two (1, 1/2 , 1/4 etc). Figures 11A and 11B show classified regions of an 8×8 DCT block and a 2×4×8 DCT block, respectively. The quantized DCT coefficients are reallocated from lower frequency to higher frequency in one dimension. A direct current (DC) coefficient is encoded as nine bit and an alternating current (AC) coefficient is encoded as a two-dimensional Huffman code according to size. Thirty DCT blocks exist in one segment and the classified thirty recording regions are provided. All recording regions take the Huffman code generated from their own DCT block first. The remaining bit amount is recorded in the recording region of another DCT block in the same macro block. When the recording in the macro block is completed, the recording is performed among five macro blocks by properly giving and taking the bit according to an excess or short state. Even if the remaining recording region exists after the Huffman code of thirty blocks is received, the remaining recording region cannot be used again. On the other hand, if the recording region is short, the remaining bit is discarded. As described above, each segment is independently encoded. As described above, in the conventional SD-VCR, the bit amount of the currently encoded segment is excessive, the bit amount is reduced by changing the quantization step until the screen quality of a predetermined level is guaranteed, and the still remaining bits are discarded. Thus, the quality of the reproduced screen having a large bit amount, such as in the case of a high-activity screen, is lowered. Figure 12 is a flow chart for illustrating a method for allocating a bit-stream according to the present invention. As shown in Figure 12, the method for allocating a bit-stream according to the present invention comprises the steps of allocating the bit-stream in a DCT block (step 1200), reallocating the remaining bit amount in the macro block (step 1210), reallocating the remaining bit amount in the segment (step 1220) and reallocating the remaining bit in another segment (step 1230). In step 1200, the bit-stream of each DCT block generated as the result of quantizing and variable-length-encoding the DCT coefficient of each DCT block is allocated in a DCT block of the macro block. In step 1210, the bits remaining during step 1200 are reallocated in another DCT block of the macro block. In step 1220, the bits remaining during step 1210 are reallocated among macro blocks in the segment. In step 1230, the bits remaining during step 1220 is reallocated in another segment having the macro block of the same content as that of previous or following frame. Figure 13 is a flow chart for illustrating step 1230 of Figure 12. Step 1230 comprises the steps of searching the macro block (step 1300), error-processing the macro block (step 1310), and reallocating the remaining bit amount (step 1320). In step 1300, a macro block having the same content as the macro block being in the searching space of a currently encoded frame is searched in the searching space of a previous or following frame. In step 1310, the recording region corresponding to the searched macro block is error-processed in a segment including the macro block searched in step 1300. In step 1320, the bits remaining during step 1310 are allocated in the error-processed recording region in step 1310. Figure 14 graphically shows the method for allocating the bit-stream according to the present invention illustrated in Figure 12. In Figure 14, a first segment 140 and a second segment 150 are each composed of five macro blocks. Here, first segment 140 has a macro block 142 in which an excess bit amount is generated, and second segment 150 has a searched macro block 152. The excess bit amount of macro block 142 is recorded in searched macro block 152. An end-of-block (EOB) code is not attached to macro block 142 in which the excess bit amount is generated so that it is known that the excess bit amount exists therein. In searched macro block 152, the location information of corresponding macro block 142 is recorded by a special STA code. When the macro block without EOB code is generated in a data decompressor (not shown) during restoration, the macro blocks having the special STA code are searched among previous and following segments. The excess bit amount is taken from the searched macro block and is used to completely restore the data. On the other hand, the data of the searched macro block is restored by using the macro block which is located in the same position of the previous or following frame. According to the present invention, when there are excessive bits remaining in the currently encoded segment, the same macro block is searched in a previous or following frame and the remaining bit amount is allocated in the searched macro block. Here, STA information of the macro block is used in the searched macro block for normally restoring the original content to be recorded. Figure 15 is a diagram showing a data allocation in a macro block of a segment. In Figure 15, the macro block comprises a quantization number region 151, a STA region 153, a first luminance block region 154, a second luminance block region 156, a third luminance block region 158, a fourth luminance block region 160, a first color difference block region 162 and a second color difference block region 164. Quantization number region 151 and STA region 153 are each composed of four bits. First luminance block region 154, second luminance block region 156, third luminance block region 158 and fourth luminance block region 160 each have a recording capacity of fourteen bytes. Also, first color difference block region 162 and second color difference block region 164 each have a recording capacity of ten bytes. Finally, each macro block has a recording capacity of 77 bytes. The STA code is a four-bit code (s3,s2,s1,s0) which is provided for an error concealment. The SD-VCR prescribes the following STA codes. 0000 There is no error in this block. Error concealment is not proceeded. 0010 There is no remaining error in this block. This block is replaced with a unit of the same unit number in the immediate previous frame. The continuity of data processing sequence with another block in the same video segment is guaranteed. 1010 There is no remaining error in this block. This block is replaced with a unit of the same unit number in the immediately previous frame. The continuity of data processing sequence with another block in the same video segment is not guaranteed. 0100 There is no remaining error in this block. This block is replaced with a unit of the same unit number in the immediately next frame. The continuity of data processing sequence with another block in the same video segment is guaranteed. 1100 There is no remaining error in this block. This block is replaced with a unit of the same unit number in the immediately next frame. The continuity of data processing sequence with another block in the same video segment is not guaranteed. 0110 There is no remaining error in this block. This block is concealed, but the concealment method is not specified. The continuity of data processing sequence with another block in the same video segment is guaranteed. 1110 There is no remaining error in this block. This block is concealed, but the concealment method is not specified. The continuity of data processing sequence with another block in the same video segment is not guaranteed. 1111 An error exists in this block. The error position is unidentified. 0111 An error exist in this block. The error code is inserted in this block. This STA value is optional. (Other STA values are reserved.) According to the present invention, the searched macro block is error-processed using STA information, instead of recording the remaining bit amount therein, so that the error-processed macro block is replaced with the macro block of the previous or following frame, having the same content, during restoration. As a result, compatibility with the SD-VCR can be maintained. Here, the searching space for searching the macro block of a previous or following frame, having the same content, is limited to the space covered by the super block. As described in the shuffling method of Figure 10, since the neighbouring macro blocks in the same super block are shuffled into the neighbouring segments, the searching space is limited to within the super block for actively searching a matching macro block during decoding. According to the method for allocating the bit-stream in a preferred embodiment of the present invention, a STA code of "0010" or "0100" is used. When the macro block having the value ("0010" or "0100") is generated during decoding, a matching macro block for having the remaining bit amount is searched among the segments being in a predetermined searching range, on the basis of the location of the macro block having a STA code. For the efficiency of the search algorithm, the searching range may be limited, for example, to ±8 segments. According to the method for allocating the bit-stream in another preferred embodiment of the present invention, the location information of a macro block which is matched with the region of a DCT block in which the DC coefficient is recorded is recorded. That is, when the macro block having a STA code whose value is "0010" or "0100" is generated during decoding, the region in each DCT block, for recording the DC coefficient, is read so that the matching macro block is searched. In two preferred embodiments, compatibility with the conventional SD-VCR is guaranteed. However, since an error may really be generated in the macro block, a method for recording a special identification code on quantization number information (QNO) can be considered by the way of precaution against such error generation. According to the method for allocating the bit-stream in still another preferred embodiment of the present invention, the location of the matching macro block is designated using STA information. That is, the segment in which the matching macro block is located is designated by using STA information of the reserved region, other than "0010" and "0100," which is composed of a direction information bit and a location information bit, as described above with respect to the prescribed STA codes. Figure 16 is a diagram showing a method for constructing a STA code of still another preferred embodiment according to the present invention. Consider that the bits composing STA code are s3, s2, s1 and s0 from an upper significant bit. Here, the s3 bit is used as the direction information bit indicating the forward or reverse search and the s2 to s0 bits are used as the location information bits. In the case of still another preferred embodiment, compatibility with the conventional SD-VCR is guaranteed, but problems can be foreseen when an anticipated scale enlargement occurs in the future. Figure 17 is a block diagram showing a structure of a data compressor, suitable for the method for allocating the bit-stream according to the present invention. The data compressor shown in Figure 17 comprises a frame memory 170, a DCT converter 172, a motion amount detector and DCT mode determiner 174, a quantizer 176, a bit amount controller 178, a variable-length encoder 180, a shuffler 182, a VLC bit-stream allocator 184, a deshuffler 186, a macro block searching circuit 188 and a STA value setting circuit 190. Macro block searching circuit 188 searches a macro block having the same content in the searching region of a previous or following frame. STA value setting circuit 190 calculates the location difference between the macro block searched in macro block searching circuit 188 and the currently processed macro block, sets a STA value corresponding to the location difference, and provides the STA value to bit-stream allocator 184. When the remaining bit amount exists after allocating the bit-stream by a segment unit, bit-stream allocator 184 allocates the remaining bit amount in a corresponding macro block of a segment having a macro block searched by macro block searching circuit 188. The STA code of the corresponding macro block is recorded as a value set by STA value setting circuit 190. Figure 18 is a block diagram showing a structure of a data decompressor suitable for the data compressor shown in Figure 17. The data decompressor shown in Figure 18 comprises a shuffler 1800, a VLC bit-stream inverse allocator 1802, a variable-length decoder 1804, an inverse DCT (IDCT) circuit 1806, a deshuffler 1808, a frame memory 1810 and a concealment processor 1812. Shuffler 1800 reconstructs a segment from the data reproduced by the reproducing portion (not shown) and provides the reconstructed segment to VLC bit-stream inverse allocator 1802. VLC bit-stream inverse allocator 1802 extracts macro block information from the segments output from shuffler 1800, provides the extracted macro block information to variable-length decoder 1804 and outputs the STA information of each macro block. Variable-length decoder 1804 performs the variable length encoding by a macro block unit and provides the result to IDCT circuit 1806. IDCT circuit 1806 restores the image signal of a time region by performing the invert DCT conversion with respect to the variable-length-decoded data provided from variable-length decoder 1804 and provides the restored image signal to deshuffler 1808. Deshuffler 1808 returns the inverse-DCT-converted coefficient of a macro block unit to the initial position and provides the result to frame memory 1801. Concealment processor 1812 receives STA information of a macro block output from VLC bit-stream inverse allocator 1802 and generates the location information of a macro block corresponding to the macro block in which an error is generated, in the previous or following frame. Frame memory 1810 determines whether the error is generated in the macro block provided from deshuffler 1808, using information provided from concealment processor 1812. When an error is generated, the macro block in which the error is generated is replaced by the corresponding macro block of the previous or following frame. Frame memory 1810 outputs the error-corrected image data. VLC bit-stream inverse allocator 1802 determines whether a bit amount which is not restored exists in the macro block of the segment provided from shuffler 1800. The existence of the bit amount which is not restored is determined by checking whether the recording space of each macro block ends with the EOB code. If the recording space ends with the EOB code, it means that the data of corresponding macro block is completely restored. Otherwise, it is recognized that the remaining information is recorded in another segment. According to a first restoring method suitable for the method for allocating a bit-stream according to a preferred embodiment of the present invention, when the EOB code does not exist in the macro block of a segment, the macro block in which a STA code having the value of "0010" or "0100" is recorded is searched in the segment of the searching range. The insufficient bit amount is restored using the data recorded in the searched macro block. On the other hand, since the searched macro block does not have its own variable-length-encoded data, the macro block should be restored using the data of a corresponding macro block located in the previous or following frame. VLC bit-stream inverse allocator 1802 provides a segment number including the searched macro block and macro block number to concealment processor 1812. According to a second restoring method suitable for the method for allocating a bit-stream according to another preferred embodiment of the present invention, when the EOB code does not exist in the macro block of a segment, the macro block in which a STA code having the value of "0010" or "0100" is recorded is searched in the segment of the searching range. It is then determined whether the macro block is matched with the macro block in which the remaining bit amount is generated, using the location information recorded in the DC coefficient recording region of the searched macro block. When matched with the macro block in which the remaining bit amount is generated, the insufficient bit amount is restored using the data recorded in the AC coefficient recording region. According to a third restoring method suitable for the method for allocating a bit-stream according to still another preferred embodiment of the present invention, when the EOB code does not exist in the macro block of a segment, the macro block in which a reserved STA code is recorded is searched in the segment of the searching range. It is then determined whether the macro block is matched with the macro block in which the remaining bit amount is generated, using the STA information of the searched macro block. When matched with the macro block in which the remaining bit amount is generated, the insufficient bit amount is restored using the data recorded in the AC coefficient recording region. As described above, according to the method for allocating the bit-stream of the present invention, when the remaining bit amount is generated in a segment unit, the deterioration of the reproduced screen can be prevented by propagating the remaining bit amount to the neighbouring segment and recording the remaining bit amount in the neighbouring segment. According to the method for allocating the bit-stream of the present invention, the deterioration of the reproduced screen can be prevented since the macro block of the previous or following frame, having the same content, is selected as a macro block for recording the remaining bit amount. According to the method for allocating the bit-stream of the present invention, compatibility with the conventional SD-VCR can be maintained by designating the macro block for recording the remaining bit amount using STA information. In the method for allocating the bit-stream according to two of the preferred embodiments of the present invention, compatibility with the conventional SD-VCR can be maintained by using the already set STA information among STA information of the macro block. In the method for allocating the bit-stream according to still another preferred embodiment of the present invention, compatibility with the conventional SD-VCR can be maintained by using the reserved STA information among STA information of the macro block.

Claims: A method for allocating a bit-stream into a digital VCR tape having fixed-length segments comprising a plurality of macro blocks having a plurality of DCT blocks, wherein the bit-stream is generated as a result of quantizing and variable-length-encoding DCT coefficient of each DCT block, comprising the steps of: (a) allocating the bit-stream of each DCT block, generated as a result of quantizing and variable-length encoding the DCT coefficient of each DCT block, to a DCT block within said macro block; (b) reallocating the bits remaining during said step (a) to another DCT block within said macro block; (c) reallocating the bits remaining during said step (b) to another macro block within the segment; characterised by (d) reallocating the bits remaining during said step (c) to another segment having the macro block of the same content as that of previous or following frame. A method for allocating a bit-stream as claimed in claim 1, wherein said step (d) comprises the steps of: searching a macro block having the same content as that of macro block being in the searching region of the currently encoded frame; error-processing a recording region corresponding to said searched macro block in the segment having the macro block searched during said macro block searching step; and reallocating the bits remaining during said step (c), to said error-processed recording region. A method for allocating a bit-stream as claimed in claim 2, wherein the size of said searching region is less than or equal to a super block. A method for allocating a bit-stream as claimed in claim 2 or claim 3, wherein a STA information is used in said error-processing step. A method for allocating a bit-stream as claimed in claim 4, wherein said STA information of said error-processing step has the value of "0010" or "1100". A method for allocating a bit-stream as claimed in claim 4 or claim 5, wherein the location information of the segment in which the remaining bit amount is generated is recorded in a region for recording a DC coefficient of the macro block in which the remaining bit amount is reallocated. A method for allocating a bit-stream as claimed in claim 4, wherein a STA signal other than "0000", "0010", "1010", "0100", "1100", "0110" and "0111" is used in said error-processing step. A method for allocating a bit-stream as claimed in claim 7, wherein at least one bit among bits composing said STA signal is used as a direction information bit representing the previous or following frame and the remaining bits are used as a location information bit representing an offset from the current segment to the reallocated segment. A method for allocating a bit-stream as claimed in claim 8, wherein among bits s0, s1, s2 and s3 composing said STA signal, s0 is used as the direction information bit, and s1, s2 and s3 are used as the location information bits. A method for restoring a bit-stream from a digital VCR tape having fixed-length segments, wherein the bit-stream is the result of quantizing and variable-length-encoding DCT coefficient of a DCT block in an allocated segment characterised in that the bit stream has been classified into the levels of a DCT block, a macro block and a macro block in another segment having the same content as that of a macro block in a previous or following frame, comprising the steps of: (a) determining whether the macro block having an incomplete bit-stream exists in said segment; (b) restoring the remaining bit-stream from another macro block in the segment when it is determined in said step (a) that the macro block having an incomplete bit-stream exists; (c) searching a segment having an error-processed macro block in the searching region when the macro block having an incomplete bit-stream is not completely restored during said step (b); and (d) restoring the incomplete bit-stream in the segment searched in said step (c), using the bit-stream included in said error-processed macro block. A method for restoring a bit-stream of a SD-VCR as claimed in claim 10, wherein said searching region is less than or equal to a super block. A data compressing apparatus of a SD-VCR, for compressing a bit-stream generated as the result of quantizing and variable-length-encoding DCT coefficient of a DCT block in an allocated segment after being classified into the levels of a DCT block, a macro block and a segment, which comprises a frame memory (170), a DCT converter (172), a motion amount detector and DCT mode determiner (174), a quantizer (176), a bit amount controller (178), a variable-length encoder (180), a shuffler (182), a bit-stream allocater (184) and a deshuffler (186), further comprising: a macro block searching means (188) for searching a macro block having the same content in the searching region of a previous or following frame; and STA value setting means (190) for calculating the location difference between the macro block searched in said macro block searching means (180) and the currently processed macro block, for setting a STA value corresponding to the location difference and for providing the STA value to said bit-stream allocator (184), wherein said bit-stream allocator (184) allocates the remaining bit amount in a corresponding macro block of a segment having a macro block searched by said macro block searching means (188) and records a STA information of the corresponding macro block as a value set by STA value setting means (190), when the remaining bit amount exists after allocating the bit-stream by a segment unit. A data decompressing apparatus of a SD-VCR, for decompressing a bit-stream generated as the result of quantizing and variable-length-encoding DCT coefficient of a DCT block in an allocated segment after being classified into the levels of a DCT block, a macro block and a segment, comprising: a shuffler (1800) for reconstructing a segment from the reproduced data; a bit-stream inverse allocator (1802) for extracting the variable-length-encoded data in a unit of a macro block and the STA information of the macro block in which the error is generated, from the segments output from said shuffler (1800) ; a variable-length decoder (1804) for performing the variable-length decoding by receiving the variable-length-encoded data in a macro block unit, output from said bit-stream inverse allocator (1802); inverse DCT means (1806) for restoring the image signal of a time region by performing the inverse DCT conversion with respect to the variable-length-decoded data provided from said variable-length decoder (1804) and outputting the restored image signal; a deshuffler (1808) for deshuffling the data of a macro block unit, inverse-DCT-converted by said inverse DCT portion (1806), to return the inverse-DCT-converted coefficient to the initial position and outputting the result; a concealment processor (1812) for receiving STA information of a macro block in which error is generated, output from said bit-stream inverse allocator (1802) and for generating the location information of a macro block corresponding to the macro block in which an error is generated in a previous or following frame; and a frame memory (1810) for determining whether the error is generated in the macro block provided from said deshuffler (1808), using the location information provided from said concealment processor, for replacing the macro block in which an error is generated by the corresponding macro block of the previous or following frame when the error is generated, and outputting the result. Video apparatus provided with apparatus according to claim 12 or claim 13.

Inventors: PARK GOO-MAN, PARK, GOO-MAN, PARK, GOO-MAN, 6-301, DONGA APT.
Applicants: SAMSUNG ELECTRONICS CO LTD, SAMSUNG ELECTRONICS CO., LTD.
Application year: 1995
Main classification: H04N5
IPC codes: H04N5, G11B20, H04N7