1. Field of Invention
The present invention relates to digital image frame compression, and, more specifically to an efficient image compression method that compresses image with mixture of homogenous area and complicated patterns in the neighboring location and results in good image quality.
2. Description of Related Art
The digital image and motion video have been adopted in an increasing number of applications, which include digital camera, scanner/printer/fax machine, video telephony, videoconferencing, 3G mobile phone, DVD, digital TV . . . etc. The success of development of the digital image and video compression standards including JPEG, a still image compression standard set by ITU and the MPEG, the motion video compression standard set by the ISO have played key role for the digital image and video applications. Both JPEG and MPEG are lossy algorithms which when being decompressed, the image data are different from the original ones. And the bit rate of each image frame is variable depending on the complexity of the image pattern.
In the television, DVD, STB, Set-Top-Box, 3G mobile phone or other portable devices, a decompressed video stream image will be temporarily saved into a storage device for other manipulation including scaling and de-interlacing before being sent to a display device. In these kind of applications, a fixed bit rate of compressed image is expected for convenience of allocating fixed density of the storage device or/and allocating fixed bandwidth of accessing the storage device during a pre-scheduled time slot.
Fixed bit rate of a compressed image frame provides necessary performance of random accessing pixels of any area with a fixed density of storage device which results in the saving of cost and power consumption. Since these image frames temporarily saved in the storage device will be used as references in the further image frames, keeping good quality is required. In some prior art compression algorithms including JPEG, MPEG and truncation, the loss of image quality might not be acceptable in some applications, especially when simple patterns and complicated patterns are shown in the neighboring location, though one can hardly visually tell the artifact in the region with complicated patterns, the error in the region with simple patterns, or said homogenous area can easily distinguished even a little error of said, 2 bits.
This present invention reduces the bit rate of an image frame while still keeps good image quality not only for images with complicated patterns or simple patterns, but also for images with mixture of simple and complicated pattern in the neighboring location.
The present invention is related to a method of compressing an image frame which reduces the memory density, speeds up the procedure of accessing the image frame buffer with less power consumption. The present invention detects the complexity of each segment of pixels and compresses the groups of pixels and results in higher image quality.
The present invention of this efficient of image buffer compression detects the complexity of each segment of pixels and partitions one segment of pixels into multiple sub-segments for compression.
The present invention applies variable image compression algorithms into each sub-segment of pixels and compresses each sub-segment separately.
According to one embodiment of the present invention, a lossless coding algorithm is applied to the sub-segment with simple pattern and a lossy coding algorithm is applied to the sub-segment with complex pattern.
According to one embodiment of the present invention, a predetermined bit rate is assigned to identify the starting point of the homogenous area and another predetermined length of bits is reserved to indicate the length of homogenous area.
According to one embodiment of the present invention, a DCT is applied to transform the time domain pixels into frequency domain for the sub-segment of pixels with complex pattern.
According to one embodiment of the present invention, a predetermined length of bit is applied to reduce data rate for the sub-segment of pixels with complex pattern.
According to another embodiment of the present invention, a shorter code is applied to represent “End of Segment” (EOS) and another shorter code is applied to represent “Begin of Segment” for the starting point.
According to another embodiment of the present invention, a segment could be partitioned into two or four smaller segment with fewer amount of pixels each segment.
It is to be understood that both the foregoing general description and the following detailed description are by examples, and are intended to provide further explanation of the invention as claimed.
The decompressed image generated from a MEPG/JEPG decoder or the captured images might be saved in a temporary buffer for future display or other manipulations which could result in high requirement of storage density. For reducing the requirement of density and accessing time, compression is one of efficient ways to achieve the goal. Most compression algorithms reach the goal of data rate reduction with more or less image quality degradation. Some compression algorithms reach good image quality under a predetermined data rate, but bad quality for images with mixture of homogenous area and complicated patterns in neighboring location.
This invention of the image frame compression reduces the bit rate of the image frame under a predetermined data rate and still keeps good image quality for images with mixture of homogenous area and complicated patterns in neighboring location.
In compressing an image frame, an image 11 is partitioned into a numbers of “lines” of pixels and each line 11 of pixels is comprised of multiple “segments” 12, 13 of pixels as shown in
As shown in
Since a segment with more complex patterns 49 than homogenous area as show in
1. A homogenous area 42 is sandwiched between two complex patterns 41, 43.
2. A complex area followed a homogenous pattern.
3. A homogenous area followed a complex pattern.
This invention compresses a segment with most pixels of complex pattern by using a lossy algorithm which might include truncation or DCT transfer plus quantization and a VLC coding. A segment of most homogenous area can also be compressed by a selected lossless compression algorithm. This invention also identifies the homogenous and complex areas and separates them and applies different compression algorithms, might be one lossless compression algorithm for the homogenous area and another lossy algorithm for the complex area. Under this mixture mode of homogenous and complex areas, the starting point 44 of homogenous is marked by a predetermined length of bits and another predetermined length 45 of bits, for example, said 4 bits are used to identify the length of homogenous area. So, in the bit stream of the compressed segment, will there be a pair of starting point 46 and length of homogenous area, said (StartPoint, Length). For saving bits, if the homogenous area lasts till the end of segment, a shorter code, for example a “0” is assigned to represent “End of Segment”, EOS 47. Another case is the homogenous area starts from the beginning of a segment which could be an extension of homogenous area from previous segment and a shorter code, for example, said “0” can be assigned to represent the starting point is from “Begin of a segment” 48. Separating homogenous area from complex area can let homogenous area to be compressed by a lossless compression algorithm and saves bits for complex area. And should the saved amount of bits in the homogenous area is not enough for the complex area to reach lossless compression due to large amount of pixels in the complex area, lossless algorithm of LSB bit truncation or DCT transfer which cause error only in the complex area which will not contaminate the image quality of the homogenous area and still keeps this homogenous area a good image quality.
The segment with partial homogenous area and partial complex pattern needs calculation to decide whether to separate the homogenous area from the complex area within one segment. The decision of separately compressing the homogenous and complex areas depends on the calculated image quality, the predicted accumulative bit rate till that corresponding segment.
Another mechanism of applying only one compression algorithm into a segment or a sub-segment is optionally selected to avoid error happened into the homogenous area as shown in
Most of this description of this invention is based on pixel has Y, U and V components. Actually, this method of invention applies to pixels with Red, Green and Blue component and other image composition. When compressing the segment of pixel components, the data rate of each segment can be fixed or can be variable from segment to segment by prediction.
It will be apparent to those skills in the art that various modifications and variations can be made to the structure of the present invention without departing from the scope or the spirit of the invention. In the view of the foregoing, it is intended that the present invention cover modifications and variations of this invention provided they fall within the scope of the following claims and their equivalents.