1. Field of Invention
The present invention relates to digital video compression and decompression with referencing frame buffer compression. And, more specifically to an efficient video bit stream compression/decompression method for an SoC, System-on-Chip design which sharply reduces the semiconductor die area and cost.
2. Description of Related Art
ISO and ITU have separately or jointly developed and defined some digital video compression standards including MPEG-1, MPEG-2, MPEG-4, MPEG-7, H.261, H.263 and H.264. The success of development of the video compression standards fuels wide applications which include video telephony, surveillance system, DVD, and digital TV. The advantage of digital image and video compression techniques significantly saves the storage space and transmission time without sacrificing much of the image quality.
Most ISO and ITU motion video compression standards adopt Y, U/Cb and V/Cr as the pixel elements, which are derived from the original R (Red), G (Green), and B (Blue) color components. The Y stands for the degree of “Luminance”, while the Cb and Cr represent the color difference been separated from the “Luminance”. In both still and motion picture compression algorithms, the 8×8 pixels “Block” based Y, Cb and Cr goes through the similar compression procedure individually.
There are essentially three types of picture encoding in the MPEG video compression standard. I-frame, the “Intra-coded” picture uses the block of 8×8 pixels within the frame to code itself. P-frame, the “Predictive” frame uses previous I-type or P-type frame as a reference to code the difference. B-frame, the “Bi-directional” interpolated frame uses previous I-frame or P-frame as well as the next I-frame or P-frame as references to code the pixel information. In principle, in the I-frame encoding, all “Block” with 8×8 pixels go through the same compression procedure that is similar to JPEG, the still image compression algorithm including the DCT, quantization and a VLC, the variable length encoding. While, the P-frame and B-frame have to code the difference between a target frame and the reference frames.
In compressing or decompressing the P-type or B-type of video frame or block of pixels, the referencing memory dominates high semiconductor die area and cost. If the referencing frame is stored in an off-chip memory, due to I/O data pad limitation of most semiconductor memories, accessing the memory and transferring the pixels stored in the memory becomes bottleneck of most implementations. One prior method overcoming the I/O bandwidth problem is to use multiple chips of memory to store the referencing frame which cost linearly goes higher with the amount of memory chip. Some times, higher speed clock rate of data transfer solves the bottleneck of the I/O bandwidth at the cost of higher since the memory with higher accessing speed charges more and more EMI problems in system board design.
The method and apparatus of this invention significantly speeds up the procedure of reconstructing the digital video frames of pixels without costing more memory chips or increasing the clock rate for accessing the memory chip.
The present invention is related to a method of digital video compression and decompression with the referencing frame buffer compression and decompression which reduces the semiconductor die area/cost sharply since the referencing frame buffer dominate he die area in an SoC design. The present invention reduces semiconductor die area compared to its counterparts in the field of video stream compression and decompression and reaches good image quality.
The present invention of this efficient video bit stream compression and decompression reduce the data rate of the digital video frame which are used as reference for other non-intra type blocks of image in motion estimation and motion compensation.
According to one embodiment of the present invention, each block of Y, luminance and U/V, chrominance of the referencing frame are compressed and decompressed separately.
According to one embodiment of the present invention, variable bit rate of each block of the Y and U/V components is reached for the pixels within a referencing image frame and come out of a fixed bit rate of a whole referencing frame.
According to one embodiment of the present invention, a predetermined time is set to reconstruct a macro-block of Y and pixel components for motion estimation in video compression and for motion compensation in video decompression.
According to one embodiment of the present invention, a pixel buffer is designed to temporarily store a predetermined amount of compressed macro-blocks of Y and Cr/Cb pixel components for motion estimation in video compression and for motion compensation in video decompression.
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.
There are essentially three types of picture coding in the MPEG video compression standard as shown in
In most applications, since the I-frame does not use any other frame as reference and hence no need of the motion estimation, the image quality is the best of the three types of pictures, and requires least computing power in encoding since no need for motion estimation. The encoding procedure of the I-frame is similar to that of the JPEG picture. Because of the motion estimation needs to be done in referring both previous and/or next frames, encoding B-type frame consumes most computing power compared to I-frame and P-frame. The lower bit rate of B-frame compared to P-frame and I-frame is contributed by the factors including: the averaging block displacement of a B-frame to either previous or next frame is less than that of the P-frame and the quantization step is larger than that in a P-frame. In most video compression standard including MPEG, a B-type frame is not allowed for reference by other frame of picture, so, error in B-frame will not be propagated to other frames and allowing bigger error in B-frame is more common than in P-frame or I-frame. Encoding of the three MPEG pictures becomes tradeoff among performance, bit rate and image quality, the resulting ranking of the three factors of the three types of picture encoding are shown as below:
In the encoding of the differences between frames, the first step is to find the difference of the targeted frame, followed by the coding of the difference. For some considerations including accuracy, performance, and coding efficiency, in some video compression standards, a frame is partitioned into macroblocks of 16×16 pixels to estimate the block difference and the block movement. Each macroblock within a frame has to find the “best match” macroblock in the previous frame or in the next frame. The mechanism of identifying the best match macroblock is called “Motion Estimation”.
Practically, a block of pixels will not move too far away from the original position in a previous frame, therefore, searching for the best match block within an unlimited range of region is very time consuming and unnecessary. A limited searching range is commonly defined to limit the computing times in the “best match” block searching. The computing power hungered motion estimation is adopted to search for the “Best Match” candidates within a searching range for each macro block as described in
The Best Match Algorithm, BMA, is the most commonly used motion estimation algorithm in the popular video compression standards like MPEG and H.26x. In most video compression systems, motion estimation consumes high computing power ranging from ˜50% to ˜80% of the total computing power for the video compression. In the search for the best match macroblock, a searching range, for example ±16 pixels in both X- and Y-axis, is most commonly defined. The mean absolute difference, MAD or sum of absolute difference, SAD as shown below, is calculated for each position of a macroblock within the predetermined searching range, for example, a ±16 pixels of the X-axis
and Y-axis. In above MAD and SAD equations, the Vn and Vm stand for the 16×16 pixel array, i and j stand for the 16 pixels of the X-axis and Y-axis separately, while the dx and dy are the change of position of the macroblock. The macroblock with the least MAD (or SAD) is from the BMA definition named the “Best match” macroblock. The calculation of the motion estimation consumes most computing power in most video compression systems.
While,
During motion compensation which is a macro-block based mechanism, the referencing frame buffer compression codec 63 reads the compressed frame pixels, decompresses and puts to a temporary pixels buffer 64 with the amount no less than a macro-block of pixels and to fill in a macro-block buffer 65 for the calculation of motion compensation 66. The referencing frame buffer compression codec gets information from the video decoding engine and decides which range of area is needed to be reconstructed for the next motion compensation calculation. Therefore, some pixels in the temporary pixel buffer 65 will be re-used again.
For saving the semiconductor die area and cost, the compressed referencing frame pixel information with variable bit rate each block in the video compression or decompression can be saved into the off-chip memory buffer 76. When compressing video stream, the memory controller 77 accesses the compressed referencing frame data in a pipelining mechanism and stores into a temporary buffer 79 before sending to the decompression engine 75 to reconstruct the pixels before storing in a temporary pixel buffer 74 as shown in
Similar to the video encoding depicted above, as shown in
There are several configurable register bits, CREG[0:3], which can be programmed to instruct the referencing frame compression codec the targeted compression rate, or said, bit rate per frame and the codec functions accordingly. For example: CREG[0:3]=1.0 compression rate, CREG[0:3]=1.5 compression rate, CREG[0:3]=1.8 compression rate, CREG[0:3]=2.0 compression rate, CREG[0:3]=2.4 compression rate, CREG[0:3]=2.7 compression rate, CREG[0:3]=3.0 compression rate, CREG[0:3]=4.0 compression rate. . . . etc.
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.