The present invention relates in general to video encoding and more particularly, video encoding using a loop filter.
An increasing number of applications today make use of digital video for various purposes including, for example, remote business meetings via video conferencing, high definition video entertainment, video advertisements, and sharing of user-generated videos. As technology is evolving, people have higher expectations for video quality and expect high resolution video with smooth playback at a high frame rate.
There can be many factors to consider when selecting a video coder for viewing digital video. Some applications may require excellent video quality where others may need to comply with various constraints including, for example, bandwidth or storage requirements. To permit higher quality transmission of video while limiting bandwidth consumption, a number of video compression schemes are noted including proprietary formats such as VPx (promulgated by On2 Technologies, Inc. of Clifton Park, N.Y.), H.264 standard promulgated by ITU-T Video Coding Experts Group (VCEG) and the ISO/IEC Moving Picture Experts Group (MPEG), including present and future versions thereof. H.264 is also known as MPEG-4 Part 10 or MPEG-4 AVC (formally, ISO/IEC 14496-10).
Many video coding techniques use block based prediction and quantized block transforms. With block based prediction, a reconstructed frame buffer can be used to predict subsequent frames. The use of block based prediction and quantized block transforms can give rise to discontinuities along block boundaries. These discontinuities (commonly referred to as blocking artifacts) can be visually disturbing and can reduce the effectiveness of the reference frame as a predictor for subsequent frames. These discontinuities can be reduced by the application of a loop filter. The loop filter can be applied to the reconstructed frame buffers. Some conventional loop filters apply different filtering strengths to different block boundaries. For example, some compression systems vary the strength of the loop filter based on, for example, whether the block has been inter-coded or intra-coded. Other compression systems apply a filter strength based on, for example, the difference between the extent of the discontinuity and threshold level. Further, for example, some compression systems may vary the strength of the loop filter by computing, for example, a difference value illumination change of a block compared to its neighboring block.
One embodiment of the invention is disclosed as a method for reducing blocking artifacts at the boundary between adjacent blocks reconstructed from a frame of compressed video information. The video information includes a prediction stage parameter with respect to at least one of the blocks. The method includes reconstructing the at least one block based on the prediction stage parameter, computing a residual error attribute from the reconstructed block, computing a filter strength value based on a baseline filter strength and at least one incremental value. The incremental value is selected from a plurality of preset values based at least on one of the prediction stage parameter and residual error attribute associated with the at least one block. The boundary adjacent to the at least one block is filtered using the selected filter strength value.
Other embodiments of the invention are described in additional detail hereinafter.
The description herein makes reference to the accompanying drawings wherein like reference numerals refer to like parts throughout the several views, and wherein:
Disclosed herein are embodiments of an adaptive loop filter that removes or reduces blocking artifacts. Further, disclosed herein are embodiments of an adaptive loop filter that either removes or reduces blocking artifacts using less overhead data and/or reduces computational complexity.
In the disclosed embodiments, block-based video compression operates on fixed-shaped groups of neighboring pixels, called a macroblock. In general, each frame of video can be divided into macroblocks, where each macroblock consists of a plurality of smaller-sized blocks. These pixel groups within the macroblocks and blocks can be compared with either data found in the current frame or in other frames in order to formulate motion data and error signals. In this embodiment, each macroblock can be a group of 16×16 pixels. In other embodiments, macroblocks can also be any other suitable size.
Although the description of embodiments of the adaptive loop filter innovations are described in the context of the VP8 video coding format, alternative embodiments of the present invention can be implemented in the context of other video coding formats. Further, the embodiments are not limited to any specific video coding standard or format.
To remove discontinuities at block boundaries, loop filtering can be applied to reconstructed frames during a reconstruction path. As explained in more detail below, the choice of loop filter and the strength of the loop filter can have a significant effect on image quality. A filter that is too strong may cause blurring and loss of detail. A filter that it is too weak may not adequately suppress discontinuities between adjacent blocks.
Referring to
Referring to
Next, still referring to
The reconstruction path in
Referring to
When compressed bitstream 26 is presented for decoding, the data elements can be entropy decoded by entropy decoding stage 25 to produce a set of quantized coefficients. Dequantization stage 27 dequantizes and inverse transform stage 29 inverse transforms the coefficients to produce a derivative residual that is identical to that created by the reconstruction stage in the encoder 14. Using header information decoded from the compressed bitstream 26, at intra/inter prediction stage 23, decoder 21 creates the same prediction macroblock as was created in encoder 14. At the reconstruction stage 31, the prediction macroblock can be added to the derivative residual to create a reconstructed macroblock. The adaptive loop filter 34 can be applied to the reconstructed macroblock to reduce blocking artifacts. A deblocking filter 33 can be applied to the reconstructed macroblock to further reduce blocking distortion and the result can be outputted to output video stream 35.
Although the description of embodiments of the adaptive loop filter innovations are described with reference to adaptive loop filter 34 in the encoder, the described filtering techniques are also implemented in adaptive loop filter 34 in the decoder. Reference to adaptive loop filter 34 in the decoder has been omitted throughout the disclosure only to aid in understanding of the invention. However, the filtering innovations are not limited to adaptive loop filter 34 in the encoder and can be applied to adaptive loop filter 34 in the decoder or any other unit incorporating filtering techniques.
Blocking artifacts can be created during the encoding process and can originate from, for example, intra/inter prediction stage 18, transform stage 19 or quantization stage 22. Since some conventional filters make filter strength dependent on block boundaries, computational processing can be complex and time-consuming.
Block attributes can include a prediction stage parameter 65 and a residual error attribute 66. Prediction stage parameter 65 can include a reference frame type 62 and a type of prediction mode 64. As discussed in more detail below, strength modifier 60 alters the levels of thresholds in adaptive loop filter 34.
Reference frame type 62 can be determined by, similar to the illustration in
If inter mode predictive coding is used, inter-frames can be used as a basis for formulating the prediction block. When using inter-frames, the prediction block can be formed, for example, from one or more previous frames, future frames or some combination thereof that have already been encoded and reconstructed. Accordingly, when using inter-frames, reference frame type 62 may include, for example, a last frame, a golden frame or an alternate reference frame. The last frame can be the previously encoded frame before the current frame. The golden frame can be a past frame chosen arbitrarily from the distant past to use as a predictor for subsequent frames. The alternate reference frame may include any frame that is not the last frame or the golden frame. For example, the alternate reference can be a past frame, a future frame, or a constructed reference frame. Further, for example, the constructed reference may be the reference frame as disclosed in patent application titled “System and Method for Video Encoding Using Constructed Reference Frame” that is assigned to the assignee of the present invention, is filed concurrently herewith and which is hereby incorporated by reference in its entirety.
Type of prediction mode 64 can be determined, similar to reference frame type 62, by whether intra mode or inter frame mode coding is used when constructing prediction blocks (as illustrated in
If inter mode predictive coding is used with non-split mode, residual error attribute 66 can be determined by whether the resulting motion vector is null or non-zero.
As discussed previously, a macroblock can be an array of 16×16 luminance pixels. In intra-coding, each macroblock can be further split into, for example, 4×4 luminance samples referred to as 4×4 sub-blocks. Accordingly, a macroblock can be made of 16 4×4 sub-blocks. This means that a prediction block may be formed for either a macroblock (i.e. non-split mode) or each of the 16 4×4 sub-blocks (i.e. split mode). Other sub-block sizes are also available such as 16×8, 8×16, and 8×8. Although the description of embodiments for intra-coding are described with reference to 4×4 sub-block split mode, any other sub-block size can be used with split mode, and the description of the embodiments are not limited to a 4×4 sub-block.
In intra-coding, non-split mode results in prediction of the whole 16×16 macroblock whereas split mode leads to separately predicting each 4×4 sub-block.
For intra-coding non-split mode, for example, one of four prediction modes can be utilized to reference neighboring pixel samples of previously-coded blocks which are to the left and/or above the 16×16 block to be predicted. The four selectable prediction modes may be vertical prediction, horizontal prediction, DC prediction and plane prediction.
For intra-coding split mode, for example, one of nine prediction modes can be utilized to reference neighboring pixel samples of previously-coded blocks which are to the left and/or above the 4×4 sub-block to be predicted. The nine selectable prediction modes may be vertical prediction, horizontal prediction, DC prediction, diagonal down-left prediction, diagonal down-right prediction, vertical-right prediction, horizontal-down prediction, vertical-left prediction and horizontal-up prediction.
In inter-coding, non-split mode results in calculating one or motion vectors based on displacing an area of a corresponding reference frame for prediction of the whole 16×16 macroblock. Alternatively, split mode results in calculating a motion vector based on displacing an area of a corresponding reference frame for prediction of a partition of the 16×16 macroblock. The 16×16 macroblock may be split into partitions of 16×8, 8×16, 8×8 or 4×4 each with its own motion vector. Other partition sizes are also available.
A motion vector can be calculated for each whole macroblock or each separate partition. In particular, motion compensation predicts the macroblock's (or the corresponding partition within the macroblock) pixel values from a translate of the reference frame. The motion vector for each macroblock or partition may either be null, which indicates there has been no change in motion or non-zero, which indicates there has been a change in motion.
Although the description of embodiments describe how adaptive loop filter 34 applies a different strength modifier 60 based on the prediction stage parameter 65 and residual error attribute 64, any other loop filter attribute may be varied such as the filter type, filter coefficients, and filter taps, and the description of the embodiments are not limited to varying strength modifier 60.
To adjust strength modifier 60 at the macroblock level, delta values 1-8 can be encoded in the bitstream. These delta values are, for example, added to baseline filter strength f. Other suitable procedures for combining baseline filter strength f and strength modifier 60 are also available. Delta values may also be incremental values or percentage increase/decrease values or the like. Delta values may also be positive, negative or zero. Application of the deltas according to the flowchart of
At decision block 102, control 61 determines whether the current macroblock being reconstructed has been intra-coded.
If the current macroblock has been intra-coded, delta 1 can be added to baseline filter strength f. Referring back to
At decision block 104, control 61 determines whether intra-coding split mode is being used. If intra-coding split mode is being used, delta 2 can be added to delta 1 and baseline filter strength f to yield strength modifier F2. Referring back to
If intra-coding split mode is not being used (i.e. non-split mode), only delta 1 can be added to baseline filter strength f to yield strength modifier F1. Referring back to
If the current macroblock has not been intra-coded, control 61 moves to decision block 106 to determine the type of inter-coded reference frame used. If the last frame is used, delta 3 can be added to baseline filter strength f. Referring back to
If a golden frame is used, delta 4 can be added to baseline filter strength f. Referring back to
If an alternate frame is used, delta 5 can be added to baseline filter strength f. Referring back to
As discussed previously, if the last frame is used, control 61 determines prediction mode 64 at decision block 108. If inter-coding split mode is being used, delta 8 can be added to baseline filter strength f and delta 3 to yield strength modifier F5. Referring back to
If inter-coding split mode is not being used, control 61 determines whether the calculated motion vector is null or non-zero. If the motion vector is null, delta 6 can be added to baseline filter strength f and delta 3 to yield strength modifier F3. Referring back to
As discussed previously, if a golden frame is used, control 61 determines prediction mode 64 at decision block 110. If inter-coding split mode is being used, delta 8 can be added to baseline filter strength f and delta 4 to yield strength modifier F8. Referring back to
If inter-coding split mode is not being used with the golden frame, control 61 determines whether the calculated motion vector is null or non-zero. If the motion vector is null, delta 6 can be added to baseline filter strength f and delta 4 to yield strength modifier F6. Referring back to
As discussed previously, if an alternate frame is used, control 61 determines prediction mode 64 at decision block 112. If inter-coding split mode is being used, delta 8 can be added to baseline filter strength f and delta 5 to yield strength modifier F11. Referring back to
If inter-coding split mode is not being used with the alternative frame, control 61 determines whether the calculated motion vector is null or non-zero. If the motion vector is null, delta 6 can be added to baseline filter strength f and delta 5 to yield strength modifier F9. Referring back to
Generally, different levels of strength modifier 60 are applied to blocking artifacts the extent of which are more or less likely to be present depending on reference frame type 62 and prediction mode 64. As illustrated in
Referring again to
If current frame is a key frame and the values have been set to default or if the current frame is not a key frame, adaptive loop filter 34 moves to decision block 130 to determine whether a filter condition is enabled at the frame level. Adaptive loop filter 34 can determine whether loop filter modifiers are enabled through a single bit, a byte, a flag or the like.
If loop filter modifiers are not enabled (i.e. a single loop filter condition has been detected), loop filtering in adaptive loop filter 34 stage can be skipped for the current frame. In other words, a single loop filter strength can be applied to all the blocks within the frame. A single loop filter strength can also include not applying a loop filter for any part of the frame.
Once loop filtering has been skipped for the current frame, adaptive loop filter will return to decision block 130 to determine whether loop filter modifiers have been enabled for the next frame. Adaptive loop filter 34 may choose to skip loop filtering based on one or more characteristics of the residual error signal, reference frame type 62, prediction mode 64 or some combination thereof. Other suitable factors to skip loop filtering in adaptive loop filter 34 are also available.
For example, loop filtering may be skipped when there is no AC component of the residual macroblock in transform stage 19 and where the macroblock is inter-coded with a null motion vector. In this manner, skipping loop filtering in this instance will prevent repeated loop filtering over several frames in regions of the image where there is no motion. Accordingly, blurring will be reduced and less computations will be involved reducing the overall computational complexity of the
Still referring to
If there are no updates to loop filter modifiers, adaptive loop filter 34 uses the preset loop filter modifiers from the previous frame to apply to the current frame. Once the previous values have been applied, adaptive loop filter will return to decision block 130 to determine whether loop filter modifiers have been enabled for the next frame.
If there are updates to loop filter modifiers, at block 140, adaptive loop filter will update the preset values of reference frame loop filter modifiers. Then, adaptive loop filter will move to block 142 to update the preset values of prediction mode loop filter modifiers. Once the values have been updated, adaptive loop filter will return to decision block 130 to determine whether loop filter modifiers have been enabled for the next frame.
Referring back to
Exemplary pseudo code for implementing the steps of the method in
The aforementioned pseudo code is not intended to be limited to any particular programming language and implementation thereof. It will be appreciated that a variety of programming languages and implementations thereof may be used to implement the teachings of embodiments of the invention as described herein.
Referring to
While the invention has been described in connection with certain embodiments, it is to be understood that the invention is not to be limited to the disclosed embodiments but, on the contrary, is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims, which scope is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures as is permitted under the law.
This application claims priority to U.S. provisional patent application No. 61/096,147, filed Sep. 11, 2008, which is incorporated herein in its entirety by reference.
Number | Date | Country | |
---|---|---|---|
61096147 | Sep 2008 | US |