1. Field of the Invention
The present invention related to a method and related device for decoding video streams, and more particularly, to a method and related device capable of enhancing the efficiency of the de-blocking filtering process and saving system memory bandwidths by storing the macroblock information and the picture information generated by a video decoder into a memory buffer.
2. Description of the Prior Art
A wide range of new applications in visual communications have been made possible due to the rapidly evolving telecommunication and computer industries. Almost all the related applications, including video conferencing, mobile or PSTN video telephony, video over the Internet, and digital TV broadcasting, require very efficient data compression methods to fit a large amount of visual information into the narrow bandwidth of communication channels while preserving acceptable quality of the reconstructed data.
To efficiently compress a time variable video sequence, redundancy in the temporal domain as well as in the two dimensional spatial domain must be reduced. The Moving Picture Experts Group (MPEG) standards use a discrete cosine transform (DCT) for processing the steps of reducing the redundancy in the two dimensional spatial domain and a motion estimation method for processing the steps of reducing the redundancy in the temporal domain.
The prior art video compression technique performs DCT operations, if necessary, after input data is sampled into 8×8 units, and DCT coefficients are quantized with respect to a visual property using quantization parameters from a quantization table. Then, the data is compressed through a run length coding (RLC). The data processed with DCT is converted from a spatial domain to a frequency domain and compressed with the quantization parameters corresponding to the visual property of human beings, not to be visually recognized. For example, since human eyes are insensitive to high frequency images, a high frequency coefficient is quantized using a large step size. Thus, a quantization table is made according to external parameters, such as a display characteristic, watching distance, and noise, to perform an appropriate quantization.
Please refer to
In the traditional block-based video compression standards such as MPEG-2, the blocking artifact is the most noticeable artifact. Thus, various methods for reducing blocking artifacts in decoding systems that individually processes blocks have been developed. Generally speaking, among these methods, the decoding process and the de-blocking process are separately implemented when decoding a moving picture from a video stream. That is, after a picture construction process is performed for an entire decoded picture, a de-blocking process including de-blocking detection and recovery is then performed on each macroblock of the picture according to picture information and macroblock information corresponding to the picture. However, in reality, the picture information and the macroblock information corresponding to the picture is already decoded and discarded during the decoding process, and thus the de-blocking process costs extra system resources for decoding the related information again. Furthermore, if image quality of a decoded picture is acceptable enough, or most of the macroblocks of the decoded picture does not have significant blocking artifact, performing the de-blocking process for the decoded picture is not necessary.
Therefore, in a prior art image decoding system, since the MPEG decoding process and the de-blocking process are implemented separately, some information, such as the macroblock information and the picture information, is decoded repeatedly and more calculation time is consumed as well, so that the efficiency of the de-blocking process cannot be optimized. However, the demand for de-blocking filtering of MPEG-encoded video is increasing due to the wide acceptance of MPEG applications, such as digital versatile discs (DVDs) and digital TV.
It is therefore a primary objective of the present invention to provide a method and related device for decoding video streams.
The present invention discloses a method for decoding a picture of a video stream. The method includes decoding the video stream by a video decoder for generating a plurality of macroblocks corresponding to the picture, macroblock information corresponding to the plurality of macroblocks, and picture information corresponding to the picture; storing the macroblock information and the picture information into a memory buffer; and determining whether the picture is needed to be performed a de-blocking process by the video decoder according to the macroblock information and the picture information stored in the memory buffer.
The present invention further discloses a video-decoding device for decoding a picture of a video stream. The video decoding device includes a video decoder including a decoding unit for decoding the video stream to generate a plurality of macroblocks forming the corresponding picture and generate macroblock information and picture information corresponding to the plurality of macroblocks and the picture, and a determination unit for determining whether the picture needed to be performed a de-blocking process according to the macroblock information and the picture information; and a memory buffer for storing the macroblock information and the picture information.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
Please refer to
Step 200: start.
Step 210: decode the video stream by a video decoder for generating a plurality of macroblocks corresponding to the picture, macroblock information corresponding to the plurality of macroblocks, and picture information corresponding to the picture.
Step 220: store the macroblock information and the picture information into a memory buffer.
Step 230: determine whether the picture is needed to be performed a de-blocking process by the video decoder according to the macroblock information and the picture information stored in the memory buffer.
Step 240: perform the de-blocking process for the picture by a de-blocking filter when the picture is needed to be performed the de-blocking process.
Step 250: end.
According to the process 20, the present invention first decodes the video stream by the video decoder for generating a plurality of macroblocks corresponding to the picture, macroblock information corresponding to the plurality of macroblocks, and picture information corresponding to the picture. Certainly, the picture can be formed according to the plurality of macroblocks after the completion of a picture construction process. Then, the present invention stores the macroblock information and the picture information into a memory buffer, and thus the video decoder can determine whether the picture is needed to be performed a de-blocking process according to the macroblock information and the picture information stored in the memory buffer. When the decoded picture is needed to be performed the de-blocking process, the present invention then performs the de-blocking process for the picture by a de-blocking filter of the image decoding system, and outputs a processing result for display. Note that, the video stream can be a data stream read out from a digital versatile disc (DVD), and the video decoder can be an MPEG decoder.
Preferably, the macroblock information can include discrete cosine transform (DCT) types, quantization parameters, and macroblock (MB) error bits, among which the DCT types and the quantization parameters can be directly decoded from the video stream, while the MB error bits can be obtained when the video decoder performs an error detection process for each of the plurality of the macroblocks. On the other hand, the picture information can include parameters of picture structure, frame types, horizontal picture size and vertical picture size, and can all be directly decoded from the video stream as well.
Therefore, by storing the macroblock information and the picture information generated by the video decoder into the memory buffer, the present invention can obtain the related information for de-blocking detection and recovery through directly accessing the memory buffer when the decoded picture is needed to be performed the de-blocking process, and thus such information need not to be decoded repeatedly any longer, so as to enhance the efficiency of the de-blocking process. Besides, the present invention can determine whether the picture is needed to be performed the de-blocking process in advance according to the macroblock information and the picture information stored in the memory buffer, and the picture with high image quality can be saved an unnecessary de-blocking detection and recovery, so that the system resource such as memory bandwidths can be saved.
Please refer to
Therefore, through the video decoding device 30, the present invention can enhance the efficiency of the de-blocking process, and can save the system resource such as memory bandwidths as well.
Preferably, the video decoder can determine whether the picture is needed to be performed a de-blocking process according to the quantization parameters of the macroblock information stored in the memory buffer. When a picture having a high image quality (i.e. the quantization parameters of the picture are small) is performed the de-blocking filtering process, the image quality of the processed picture will not become better, but lose its original high quality, such as a blur image in the picture. Thus, to prevent a high image quality picture from an unnecessary de-blocking detection and recovery, there are two exemplary embodiments of the present invention in the following.
Please refer to
Step 400: start.
Step 410: determine if a quantization parameter corresponding to each of the plurality of macroblocks of the picture is greater than a predetermined value. If so, proceed to Step 420; and if not, proceed to Step 430.
Step 420: enable the de-blocking filtering process.
Step 430: end.
Therefore, according to the process 40, the present invention determines in order whether a quantization parameter of each of the macroblock is greater than a predetermined value. When the quantization parameter of one of the plurality of macroblocks is greater than the predetermined value, the present invention then enable the de-blocking filter to perform the de-blocking filtering process for the picture. In other words, if the quantization parameters corresponding to each of the plurality of macroblocks in the picture are all smaller than the predetermined value, meaning that the image quality of the decoded picture is good enough, the de-block filter will not process this picture, so as to save the related memory bandwidths. Please note that, those skilled in the art can set the predetermined value according to practical demands, and thus the predetermined value is not restricted to a specific value.
Please further refer to
Step 500: start.
Step 510: calculate the number of the quantization parameters, corresponding to each of the plurality of macroblocks and greater than an average value.
Step 520: determine whether the number is greater than a predetermined value. If so, proceed to Step 530, and if not, proceed to Step 540.
Step 530: enable the de-blocking filtering process.
Step 540: end.
According to the process 50, the present invention first calculates the number of the quantization parameters, corresponding to each of the plurality of macroblocks and greater than the average value of all of the quantization parameters corresponding to the plurality of macroblocks. When the number of the quantization parameters greater than the average value is greater than the predetermined value, the present invention then enables the de-blocking filter to perform the de-blocking filtering process for the picture. Conversely, when the number is smaller than the predetermined value, meaning that the image quality of the decoded picture is good enough, the de-block filter will not process this picture to save the memory bandwidths. In like manners, the predetermined value is adjustable, and can be set according to practical demands.
As mentioned above, the present invention can determine whether the picture is needed to be performed the de-blocking process in advance according to the quantization parameters of the macroblock information stored in the memory buffer. In addition, through directly accessing the memory buffer, the present invention can efficiently perform the de-blocking filtering process for the picture that is necessary to be performed the de-blocking filtering process according to the macroblock information and the picture information stored in the memory buffer. Therefore, the present invention not only can enhance the efficiency of the de-blocking filtering process, but can save the system resources such as memory bandwidths as well.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention.