Abstract:
A device and method for compressing image data is disclosed. The device and method comprises a block dividing section for dividing each frame of the image data into a plurality of blocks; a block determining section for determining the types of divided blocks; and a compressing section for performing compression according to the types of divided blocks. The block types include motion blocks, static blocks and refresh blocks that avoid the accumulation of errors between frames.

Description:
PRIORITY  
         [0001]    This application claims the benefit under 35 U.S.C. § 119(a) to an application entitled “Method and device for compressing image data” filed in the Korean Intellectual Office on Jun. 4, 2003 and assigned Serial No. 2003-36084, the entire contents of which are incorporated herein by reference.  
         BACKGROUND OF THE INVENTION  
         [0002]    1. Field of the Invention  
           [0003]    The present invention relates to compression of image data. More particularly, the present invention relates to a device and a method by which image data can be effectively compressed.  
           [0004]    2. Description of the Related Art  
           [0005]    Motion Joint Photographic Expert Group (M-JPEG) is an industry standard for the compression of a moving image and is based on a Joint Photographic Expert Group (JPEG) format which was used for compressing a still image. M-JPEG is widely used in digital video editing and supports a variable compression factor, that is, it enables a compression factor to be freely established. In M-JPEG, each frame comprising a moving image is compressed and reproduced to a JPEG format.  
           [0006]    Since M-JPEG compresses image data using only a spatial compression method, frames are easy to access and thus digital video editing can be performed efficiently. M-JPEG Hardware supporting real-time compression has been released in the market. Because M-JPEG compresses objective image data regardless of the relationship of the current frame and the previous frame, unlike Moving Picture Expert Group (MPEG), each frame can be freely edited even after compression is performed. In addition, since M-JPEG does not use interframe information, it does not transfer a transmission error into the next frame. Also, in M-JPEG, since each frame is separately transmitted, it is possible to use a variable bandwidth, depending on network usage. In addition, an image quality superior to MPEG is provided.  
           [0007]    Although software methods using a high-performance Central Processing Unit (CPU) have recently been introduced, compression methods using a hardware chipset have a disadvantage in that it is impossible for even the same M-JPEG methods to be used compatibly when a chipset and a driver are different from each other. Since M-JPEG does not use interframe information, M-JPEG has a lower compression factor than MPEG, thereby requiring a wide bandwidth. Additionally, M-JPEG is more difficult to implement than MPEG for voice synchronization and requires a high-performance CPU.  
           [0008]    [0008]FIG. 1 is a block diagram illustrating a conventional M-JPEG encoder.  
           [0009]    Referring to FIG. 1, M-JPEG  100  includes a discrete cosine transform (hereinafter, referred to as “DCT”) section  101 , a quantization section  102 , and an entropy coder  103 . The DCT section  101  processes input images with each input image divided by a block which comprises 8×8 pixels. That is, by using a cosine signal as a basis function with respect to each block, image signals generally having a very high correlation among adjacent pixels are converted into frequency ranges having no correlation between each other. Therefore, DCT coefficients representing low-frequency components have large values, while DCT coefficients representing high-frequency components have very small values.  
           [0010]    The quantization section  102  reduces the number of effective bits, by dividing a DCT coefficient obtained through the DCT section  101  using a quantization coefficient according to each frequency. Therefore, high-frequency coefficients having relatively small values become nearly zero through quantization.  
           [0011]    The entropy coder  103  creates a bit string formed with “0” and “1” from values of DCT frequency coefficients having undergone the quantization step, in consideration of these generation probabilities. That is, the entropy coder  103  codes components in which spatial duplication is eliminated by the DCT and the quantization.  
           [0012]    [0012]FIG. 2 is a block diagram illustrating a conventional video encoder, that is, an MPEG encoder. MPEG has a very high compression factor, that is, a very low bit rate, as compared with M-JPEG. However, an MPEG encoder has a disadvantage in that it takes an excessive amount of time for compression because a motion estimation and compensation section  205  and an inverse DCT section  204  for performing a decoding step are included. Also, there is another disadvantage in that errors are accumulated because of interframe coding which is used to eliminating time duplication among frames.  
           [0013]    It should be appreciated by those skilled in the art that DCT  201 , Quantization block  202  and entropy coder  203  are similar in operation to that DCT  101 , Quantization block  102  and entropy coder  103 . Therefore, a description is not required.  
         SUMMARY OF THE INVENTION  
         [0014]    Accordingly, the present invention has been made to solve the above-mentioned problems occurring in the prior art, and an object of the present invention is to provide a compression device and a compression method capable of preventing an error from being accumulated, while reducing the size of image data and increasing a compression factor.  
           [0015]    To accomplish this object, in accordance with one aspect of the present invention, a device for compressing image data is provided. The device comprises a block dividing section for dividing each frame of the image data into a plurality of blocks; a block determining section for determining the types of divided blocks; and a compressing section for performing compression according to the types of divided blocks.  
           [0016]    In accordance with another aspect of the present invention, a method for compressing image data is provided. The method comprises dividing each frame of received image data into a plurality of blocks; determining the types of divided blocks; compressing a value of a present block when the present block is determined to be a refresh block; compressing a value of a present block when the present block is determined to be a motion block; and compressing a difference between blocks when the present block is determined to be a static block. 
       
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0017]    The above and other objects, features and advantages of the present invention will be more apparent from the following detailed description taken in conjunction with the accompanying drawings, in which:  
         [0018]    [0018]FIG. 1 is a block diagram illustrating a conventional Motion—Joint Photographic Expert Group (M-JPEG) encoder;  
         [0019]    [0019]FIG. 2 is a block diagram illustrating a conventional video encoder;  
         [0020]    [0020]FIG. 3 is a view illustrating refresh columns established in frames of image data according to an embodiment of the present invention;  
         [0021]    [0021]FIG. 4 is a block diagram illustrating a compression encoder according to an embodiment of the present invention;  
         [0022]    [0022]FIG. 5 is a flowchart for illustrating a compression process according to an embodiment of the present invention;  
         [0023]    [0023]FIGS. 6A through 6E are views and diagrams illustrating results of image data compressed according to the process shown in FIG. 5;  
         [0024]    [0024]FIGS. 7A through 7E are views and diagrams illustrating results of image data compressed according to the process shown in FIG. 5; and  
         [0025]    [0025]FIGS. 8A through 8E are views and diagrams illustrating results of image data compressed according to the process shown in FIG. 5. 
     
    
       [0026]    In the drawings, the same or similar elements are denoted by the same reference numerals even though they are depicted in different drawings.  
       DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS  
       [0027]    A device and a method for compressing image data according to embodiments of the present invention will be described with reference to the accompanying drawings. Although a number of specific features, such as the type of blocks, a reference value, location of refresh columns, a size of blocks, and so on, are given as examples, they are presented to provide a better understanding of the present invention only. Also, it should be clear to those skilled in the art that the present invention can be practiced without the specific exemplary features. In the following description of embodiments of the present invention, a detailed description of known functions and configurations incorporated herein will be omitted for conciseness.  
         [0028]    Regarding an embodiment of the present invention, a “motion block” refers to a block in which an energy difference between the present block and a corresponding block in the previous frame is larger than a predetermined reference value. That is, a motion block has a change of image from the previous block. Also, a “static block”, as opposed to a motion block, refers to an energy difference between the present block and the corresponding block in the previous frame that is smaller than a predetermined reference value. A static block represents a block in which the difference between the present block and the corresponding block in the previous frame is determined to be minimal.  
         [0029]    In addition, a “refresh block” refers to a block existing in a refresh column, wherein the refresh column is used to prevent errors from being accumulated. In general, a moving image coder includes a decoder. That is, in a practical coding, in order to reduce the amount of information to be transmitted, coding is performed after a difference between the present and the previous frame is obtained.  
         [0030]    In order to simplify hardware construction, the present invention omits the above-mentioned decoding process and calculates a difference between the present frame to be coded and the previous frame in the original moving image. Errors may be accumulated in a decoder which does not have information of the previous frame of the original moving image. Therefore, in order to prevent such a problem, an embodiment of the present invention includes an intra-coding process, which does not use a difference between frames, with respect to refresh blocks located within the refresh column. That is, in an embodiment of the present invention, in order to prevent accumulation of errors caused in the static blocks, each of which is coded with a difference calculated between the present block to be coded and a corresponding block in the previous frame of the original moving image, a refresh column is periodically established for each frame, and the intra-coding is performed with respect to blocks located within the refresh column, regardless of whether the respective blocks in the refresh column is a motion block or a static block. FIG. 3 is a diagram illustrating refresh columns established in frames of image data according to an embodiment of the present invention. A location of a refresh column is predetermined every frame input into a compression encoder according to an embodiment of the present invention. A horizontal and a vertical size of the refresh column are preferably 16 and “V” pixels, respectively, wherein “V” represents a vertical size of an image.  
         [0031]    [0031]FIG. 4 is a block diagram illustrating a compression encoder according to an embodiment of the present invention.  
         [0032]    Referring to FIG. 4, the compression encoder according to the present invention includes a block dividing section  410 , a block determining section  420 , and a compressing section  430 . The block dividing section  410  divides each frame of received image data into blocks, each of which preferably has a size of 8×8 pixels.  
         [0033]    The block determining section  420  includes a first block determining section  421 , a block calculating section  422 , and a second block determining section  423 . The first block determining section  421  determines whether or not the respective divided blocks are located within a refresh column. If a divided block is located within the refresh column, the divided block is determined to be a refresh block. In contrast, if a divided block is not located within the refresh column, the divided block is determined to be either a motion block or a static block. In addition, with respect to any present block determined to be a refresh block, the block determining section  420  transfers a value of only the refresh block to the compressing section  430 , without calculating a difference between the present block and a corresponding block in the previous frame.  
         [0034]    In contrast, when the first block determining section  421  determines a block to be either a motion block or a static block, the block calculating section  422  calculates a difference between the block and a corresponding block in the previous frame by means of equation 1, and then transfers the difference to the second block determining section  423 .  
               ∑     i   =   0       B   -   1              ∑     j   =   0       B   -   1              (         f   n          (     i   ,   j     )       -       f     n   -   1            (     i   ,   j     )         )     2               Equation                 1                               
 
         [0035]    where f n (i,j) represents a pixel value of a position (i,j) in an n th  frame, and f n−1 (i,j) represents a pixel value of a position (i,j) in an (n−1) th  frame.  
         [0036]    The second block determining section  423  compares the difference between the blocks, which is received from the block calculating section  422 , with a predetermined reference value. If the difference between the blocks is more than the predetermined reference value, the second block determining section  423  determines the present block to be a motion block and transfers only a value of the present block to the compressing section  430 . Also, if the difference between the present block and the corresponding block in the previous frame is equal to or less than the predetermined reference value, the second block determining section  423  determines the present block to be a static block and transfers the difference between the blocks to the compressing section  430 .  
         [0037]    The compressing section  430  includes a discrete cosine transform (hereinafter, referred to as “DCT”) section  431 , a quantization section  432 , and an entropy coder  433 . The compressing section  430  codes either a value of a block or a difference between a present block and a corresponding block in the previous frame, which is input according to the properties of a refresh block, a motion block, and a static block that was determined by the block determining section  420 . Each block is coded as either a refresh block or a motion block, while different components between a present block and a corresponding block within the previous frame are encoded with respect to each block being defined as a static block.  
         [0038]    [0038]FIG. 5 is a flowchart illustrating a compression process according to an embodiment of the present invention. Hereinafter, an embodiment of the present invention will be described in detail with reference to FIG. 4.  
         [0039]    Referring to FIG. 5, when a frame of image data is received, a controller detects this at step  501  and controls the block dividing section  410  to divide the frame into blocks of a predetermined size at step  502 . For illustrative purposes, it is assumed that the predetermined size of each block is 8×8 pixels. The first block determining section  421  determines whether or not a divided present block is located within a refresh column. If the present block is located within the refresh column, the first block determining section  421  detects this at step  503  and transfers the value of the present block to the compressing section  430  without calculating a difference between the present block and the previous block at step  504 .  
         [0040]    In contrast, if the present block is not located within the refresh column, the first block determining section  421  detects this at step  503  and determines the present block to be either a motion block or a static block. Then, the block calculating section  422  calculates a difference between the present block and the previous block and then transfers the calculated difference to the second block determining section  423 . The second block determining section  423  compares the difference between the blocks with a predetermined reference value. If the difference is more than the predetermined reference value, the second block determining section  423  determines the present block to be a motion block at step  505  and transfers only the value of the present block at step  506 . In contrast, if the difference is less than the predetermined reference value, the second block determining section  423  determines the present block to be a static block at step  505  and transfers only the difference between the blocks at step  507 .  
         [0041]    Blocks transferred through steps  504 ,  505 , and  506  undergo steps  508 ,  509 , and  510  in sequence. At step  508 , the block is converted from a spatial region to a frequency range by means of 64 DCT functions provided by the DCT section  431 . At step  509 , 64 DCT coefficients obtained though the DCT is divided by a quantization coefficient value by the quantization section  432 , thereby reducing the number of effective bits. At step  510 , the quantized DCT coefficients are coded in a bit form including ‘0’ and ‘1’ according to these probability distributions by the entropy coder  433 .  
         [0042]    If the block coded through step  510  is not the last block in a frame, the controller detects this at step  511  and returns to step  503 . In contrast, if the block coded through step  510  is the last block in a frame, the controller detects this at step  511  and then determines whether or not the present frame is the last frame. If the present frame is not the last frame, the controller detects this at step  512  and returns to step  501 . In contrast, if the present frame is the last frame, the controller detects this at step  512  and ends the compressing process.  
         [0043]    [0043]FIGS. 6A through 6E,  7 A through  7 E, and  8 A through  8 E are views and diagrams for showing results of image data compressed according to the process shown in FIG. 5.  
         [0044]    [0044]FIG. 6A shows an original image, and FIG. 6B shows an image having undergone conventional M-JPEG. FIG. 6C shows an image having undergone a compression method according to an embodiment of the present invention, and FIG. 6D shows a graph representing bit transmission rates of the images shown in FIGS. 6B and 6C. As shown in the above drawing, it should be understood that the image according to an embodiment of the present invention has a lower bit rate than the image having undergone the conventional M-JPEG. FIG. 6E shows a graph representing image qualities of the images shown in FIGS. 6B and 6C. In FIG. 6E, peak to peak signal noise ratio (PSNR) is a criterion for representing image quality of an image. Equation 2 is used to calculate the PSNR.  
             PSNR   =     10                 log          255   2         1   HV            ∑     i   =   0       H   -   1              ∑     j   =   0       V   -   1                       I   n          (     i   ,   j     )       -         I   ^     n          (     i   ,   j     )              2                       Equation                 2                               
 
         [0045]    where I n (i,j) represents a pixel value of an original image, I n−1 (i,j) represents a pixel value of a reproduced image, H represents a horizontal size of the image, and V represents a vertical size of the image.  
         [0046]    Referring to FIGS. 7A through 7E and  8 A through  8 E, which are similar to FIGS. 6A through 6E, it should be understood that an image according to an embodiment of the present invention has a lower bit rate than an image having undergone conventional M-JPEG with an approximately identical image quality.  
         [0047]    As described above, an embodiment of the present invention uses different compression methods according to the defined type of blocks, thereby reducing the amount of data input into a coder to increase a compression factor and prevent errors from being accumulated. Consequently, there are advantages in that the bit transmission rate is lower, and the amount of calculation and hardware construction is simplified.  
         [0048]    While the invention has been shown and described with reference to certain embodiments thereof, it should be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.