The present invention relates to the field of video image decoding. More particularly, the invention relates to a method for preserving image edges and removing the ringing artifacts from decoded video data.
Over the years, various techniques of compression have been explored for compressing video signals. These techniques are typically lossy in their nature, that is, they attempt to use a lesser amount of bits to represent the most important information present in the image data, such that most viewers of the decoded video signal will find it difficult to detect the differences between the decoded video signal and the original non-coded signal.
One of the popular forms of compression is to apply transformation to the digital signal, effectively transforming the digital signal from the spatial domain to another domain (e.g. the frequency domain). The idea behind this is to exploit the energy compaction property of the transformation, so that redundancy in the image can be removed more efficiently in the transformed domain.
Various transformation techniques have been explored for the removal of redundancy in the spatial domain, and Discrete Cosine Transform (DCT) is found to be the best transformation, taking into account efficiency and implementation complexity. Thus, DCT has been the basic core technique of a few established International Standardization Organization (ISO) standards for the compression of images, which include JPEG (Joint Photographic Expert Group), MPEG (Moving Picture Expert Group) Phase-1, MPEG Phase-2, and h.261.
To compress an image using the DCT transform, the image is first divided into square blocks of pixels (e.g. 8×8 pixel blocks) and each of these blocks is then transformed using DCT into a transformed block which contains the DCT coefficients. As the neighboring pixels in an image are in general highly correlated, this enables the DCT to transform image pixel into coefficients that are energy concentrated around the top-left corner of the transformed block, which is the low frequency region. These transformed blocks are then quantified into quantized coefficients and then run-length and variable length coded to further reduce the statistical redundancy present into the run-length coded data.
As described above, the energy compaction property of DCT can be easily applied to a block of pixels that are highly correlated. However, in the case of a block displaying an edge, i.e. a block which contains sharp changes in intensity and/or color of neighboring pixels, referred to hereinafter as an edge block, the compaction of signal energy is not achieved efficiently. Furthermore, in order to compress more bits, the Quantization parameters are designed to preserve the low frequency coefficients at the upper left corner of the block, this design will generate error for an edge block when the edge block is transformed and coded. The error will cause a ringing effect (corona effect) appearing near the edge of the reconstructed block. This ringing effect infuses noise in the high frequency area of the decoded video signal, effectively adding unwanted distortions to the reconstructed image. In other words, ringing is a correlated noise appearing near distinctive edges.
Ringing occurs when coarse quantization of DCT coefficients, especially of high frequency AC coefficients, introduces noise. In higher quality (i.e. lower compression ratio) systems, ringing is the most visible artifact. Due to slight variations from frame to frame, ringing noise is visible in moving pictures as a local flickering near edges, as edge information is very sensitive to the human eyes compared to other high frequency pixel regions. This type of noise is also known as “mosquito noise”.
U.S. Pat. No. 6,993,191 describes a method applying a deringing filter for preserving image edges in video frames. The described method applies a 9-tap low-pass filter to an adaptive processing window. The filter window is initialized with the values in a 3×3 mask centered on the position whose output is computed. Then, all values that are very different from the central one are replaced with the central value before the filter is applied. However, the disclosed method grants a huge weight to the center value of the 3×3 mask as all the values that are very different from the center are replaced with this central value, this may cause in some of the cases a distortion in the image.
It is an object of the present invention to provide an efficient filter for edge blocks.
It is another object of the present invention to provide a filter for preserving image edges and eliminating the ringing artifacts in decoded images.
It is still another object of the present invention to provide a method for enhancing the view quality of the decoded image.
Other objects and advantages of the invention will become apparent as the description proceeds.
The present invention relates to a method for filtering ringing artifacts in a reconstructed pixel edge block comprising the steps of: (a) providing said edge block; (b) determining a threshold as a function of the pixel values in said edge block; (c) mapping each pixel, of said edge block, to a corresponding binary index according to its value and said threshold; (d) scanning using a window, a first binary index of said mapped edge block and its surrounding indices; (e) determining if all entrapped binary indices of said window are uniform; (f) if not all entrapped binary indices of said window are uniform, scanning using a sub window that entraps said first binary index, within said window, for determining if all entrapped binary indices of said sub window are uniform; and (g) if all entrapped binary indices of said sub window are uniform, filtering the pixel that corresponds to said first binary index with the pixel values that correspond to the binary indices entrapped in said sub window.
Preferably, the window is a square window of M*M.
In one embodiment, the window is a triangular window of M*N.
Preferably, the window is square window of 3*3.
Preferably, the sub window is a square window of M*M.
In one embodiment, the sub window is a triangular window of M*N.
Preferably, the sub window is square window of 2*2.
Preferably, the scanning using a sub window is applied more than once.
In one embodiment, the scanning using a sub window is applied using different sizes of sub windows.
In the drawings:
a depicts an example of scanning using a 2×2 sub window within a scanned 3×3 window, according to an embodiment of the invention.
b depicts an example of scanning using another 2×2 sub window within a scanned 3×3 window, according to an embodiment of the invention.
c depicts an example of a 2×2 filter, according to one of the embodiments.
The terms pixel(s) and pixel value(s) in all of their forms are used throughout the present specification and claims interchangeably.
a and 3b depict the method of scanning using 2×2 sub windows within scanned 3×3 windows, according to an embodiment of the invention. As described in relations to
As described above, the method of the invention not only provides a hierarchical process for resizing filters for specific matching; it also allows filtering a pixel with an exclusively selective group of pixels. The hierarchical process of the invention, as described, utilizes filters of different sizes in order to specifically match the right sized filter for smoothing each pixel of the decoded image. Thus some of the pixels in the image may be filtered using one size filter while other pixels of the same image may be filtered using a different size filter, in accordance with their different position and arrangement in the image. The second benefit of the method is received from the exclusive selecting of the pixels closer in value for the filter. The described process eventually causes the edge pixels, i.e. the pixels close to the edge, to be filtered with pixels that are physically close and closer in value, without processing the other physically close pixels on the other side of the edge which vary sharply in value. Thus the edge does not smear and the ringing artifacts can be filtered.
The window and sub window of the described scanning technique may belong to any square (M*M) or rectangle (M*N) arrangement as long as the sub window entraps a smaller area of the window. In other words: if the window's area is M*N (where M is the length of the window and N is the width of the window) and the sub window's area is I*J (where I is the length of the sub window and J is the width of the sub window) then the following condition has to be met:
M≧I and N≧J and (M*N>I*J).
In one of the embodiments, the invention may be carried out using different sizes and arrangements of pixel blocks, windows, sub windows, filters, and any number of stages. For example, after a certain size pixel block is binary mapped, a scanning using a 5×5 window can be applied around the binary indices, and thus a 5×5 filter may be used for better filtering. The 5×5 filter can then be used when all the binary indices in the 5×5 window are uniform, i.e. not on edge blocks. Thus a pixel value can be filtered with all 24 pixel values that surround it. However, the 5×5 edge windows are processed separately by scanning using sub windows within the 5×5 edge block. At first scanning using 4×4 sub windows may be tried. If a suitable 4×4 block is not found, i.e. that all four possible 4×4 blocks do not entrap uniform binary indices, then another stage of scanning using smaller sub windows may be applied, such as 3×3, and so on. The process may be repeated until a suitable sub window is found as long as the central binary index of the window is entrapped in the scanned sub window. When a suitable sub window is found a filter may be applied accordingly as described. Thus the hierarchical process may be utilized in any number of stages. In another embodiment, the scanning using 2×2 sub windows may be used first (as the second stage of the process) within the 5×5 edge window without first gradually downsizing the sub window of the scanning.
While some embodiments of the invention have been described by way of illustration, it will be apparent that the invention can be carried into practice with many modifications, variations and adaptations, and with the use of numerous equivalents or alternative solutions that are within the scope of persons skilled in the art, without departing from the invention or exceeding the scope of claims.