1. Field of the Invention
The invention relates to system for video decoding and deblocking and the method thereof, and more particularly for reducing buffer memory required by video decoding and deblocking.
2. Description of the Related Art
To solve the problem that video files are often too large for transmission, video decoding is adopted to minimize the file size and thus to reduce storage space required and transmission load. Also, the distortion of image quality should be controlled within an acceptable range.
Many video decode standard performs encoding and decoding on the basis of macroblock. Take H.264/AVC (Advanced Video Coding) as an example, a video frame is partitioned into a plurality of macroblocks, each macroblock is 16×16 pixels. When performing macroblock encoding, the original pixel values of the video frame is replaced by approximate values in order to reduce the data quantity. However, pixel values of neighboring macroblocks may have large differences after decoding, and thus causes the images become unnatural. Therefore, the video frame must undergo deblocking process in order to minimize the differences between neighboring macroblocks so that the video quality can be improved.
FIG. 1 depicts an example of two neighboring macroblocks. Macroblocks 10 and 20 comprise a plurality of pixels respectively. Pixels of macroblock 10 are denoted as P1 and pixels of macroblock 20 are denoted as P2. When performing deblocking, pixels belonging to different macroblocks like P1 and P2 can be performed with, for example, interpolation so as to soften the edge.
FIG. 2 depicts a block diagram of a video frame 200 having 256×64 pixels. The video frame 200 is partitioned in to 16×4 macroblocks, each macroblock comprises 16×16 pixels. The macroblocks are denoted as MB(0,0), MB(0,1) . . . MB(3,15) respectively. In the case that the video decoder performs decoding on the basis of macroblock and in sequence, deblocking of the edge C(0,1) between MB(0,0) and MB(0,1) can only be performed after decoding of MB(0,0) and MB(0,1) completes. Similarly, the edge R(0,1) can only be deblocked after MB(0,0) and MB(1,0) are both decoded.
The video decoder may not decode the macroblocks in order, but in random under some circumstances. For example, flexible macroblock ordering (FMO) mode or arbitrary slice ordering (ASO) mode in H.264/AVC. But video deblocking must be performed in order in conventional video processing. As a result, there is equipped with a deblock buffer for recording the decode status of each macroblock in conventional video processing system so that the deblocking process may cooperate with decoding process. FIG. 3 depicts a block diagram of a deblock buffer adopted in video processing. The deblock buffer 300 comprises 16×4 bits, each bit corresponds to the decode status of each one of the 16×4 macroblocks in video frame 200 respectively. For example, bit value 1 denotes that the corresponding macroblock has been decoded. It can be known from FIG. 3 that MB(0,0), (1,12), (2,0) . . . etc. have been decoded.
In addition, when the resolution of the video image goes higher, the deblock buffer space increases as well. For example, a full HD video frame comprises 1920×1080 pixels, that means the deblock buffer should have at least 8,160 bits, which is significantly large. As a result, there exists a need to evolve a solution that can reduce the buffer space required for video decoding and deblocking.