H.264/MPEG-4 Part 10 white paper translation (5) reconstruction filter

Source: Internet
Author: User
Tags border image

H.264/MPEG-4 Part 10 white paper translation (5) reconstruction filter

Recreate Filter

 

1. Introduction

The Joint Video Working Group (JVT) is finalizing a new natural video image encoding (compression) standard. The new standard is referred to as H.264 or MPEG-4 Part 10, "advanced video encoding (AVS )". This document describes how to filter reconstruction blocks in H.264 decoder. Note that draft H.264 standards have not yet been finalized, so readers are encouraged to refer to the latest standards.

 

2. What is a reconstruction filter?

Filters are applied to the decoded macro block to reduce block distortion. Block effect filter is used in the following two cases: (1) encoding process: Back-to-use (storing macro blocks before reconstruction and for later prediction) (2) decoding process: the Macro Block is displayed before reconstruction. Reconstruction filters have two functions: (1) smooth block edges and Improve the Quality of decoded images (especially in high compression ratios); (2) the filtered macro block is used for the motion compensation prediction of another frame in the encoder, and a smaller residual frame is generated after the prediction. (Note: Macro blocks of intra-frame encoding are filtered, while intra-Frame Prediction uses macro blocks of unfiltered d to generate prediction .) The image edge is not filtered.

 

Filter the vertical and horizontal edges of the 4x4 blocks in the macro block in the following sequence:

1. filter the four vertical boundaries of the brightness component (in the order of A, B, C, and D in Figure 1)

2. filter the four horizontal boundaries of the brightness component (in the E, F, G, and H orders in Figure 1)

3. filter the two vertical boundaries of each color component (I, j order)

4. filter the two horizontal boundaries of each color component (k, l order)

 

Each filtering operation can work at most three pixels on both sides of the boundary. Figure 2 shows four pixels (P0, P1, P2, P3, q0, Q1, q2, Q3) on both sides of the vertical or horizontal border between adjacent blocks p and q ). This can have multiple outputs, from (a) No pixels are filtered to (B) P0, P1, P2, q0, Q1, Q2 are filtered and the pixels P0, P1, p2, q0, Q1, q2, depending on the current quantizer, the encoding mode of adjacent blocks, and the gradient of cross-border image sampling.

 


3. Boundary strength

 

The output of the filter depends on the boundary intensity and the gradient of cross-boundary image sampling. Select the boundary strength coefficient BS according to the following rules:

 

P or Q adopts intra-frame encoding and the boundary is a macro block boundary (I .e., the outermost boundary of the macro block)

BS = 4 (maximum filtering intensity)

P or Q adopts intra-frame encoding and the boundary is not a macro block boundary.

BS = 3

Both p and q do not adopt intra-frame encoding, but P or Q contain encoding coefficients.

BS = 2

Both p and q do not adopt intra-frame encoding and do not contain encoding coefficients. p and q have different reference frames or have different motion vector values.

BS = 1

Both p and q do not adopt intra-frame encoding and do not contain the encoding coefficient. p and q have the same reference.

Frame and the same motion vector.

BS = 0 (not filtered)

 

Where there may be strong distortion, the filtering intensity is the maximum. For example, the boundary of some macro block encoding within a frame or the boundary between blocks containing the encoding coefficient.

 

5. Filter Decision-Making

 

Sampling in a set (P2, P1, P0, q0, Q1, q2) is filtered only when the following conditions are met:

(1) BS> 0 and

(2) | p0-q0 |, | p1-p0 | and | q1-q0 | are less than a threshold? Or? (? And? Defined in standard [1)

 

Threshold? And? The increase increases with the average value of the quantization parameter QP of block p and q. The filter policy aims to disable the filter when the gradient does not change significantly when the original image crosses the border. The definition of a significant change depends on QP. When QP is relatively small, except for very small cross-boundary gradients, others are regarded as image features that should be protected. What is the threshold? And? It is relatively small. When the QP is large, the block distortion may be obvious? And? In this case, more filters are generated.

5. Filter Implementation

(1) BS? {1, 2, 3 };

Use a 4-input linear filter for P1, P0, q0, and Q1. The filtered output is P0 and q0 (0 <BS <4)

 

Also, if | p2-p0 | ratio threshold? Small, P2, P1, P0, and q0 are filtered using a 4-input linear filter to filter out P1. If | q2-q0 | than threshold? Small, then Q2, Q1, q0, and P0 are filtered using a 4-input linear filter to filter out Q1. (P1 and Q1 are not filtered in the color component and are only used in the brightness component ).

 

(2) BS = 4:

If | p2-p0 | <? & | P0-q0 | <round (? /4) then:

Use a 5-input filter to filter P2, P1, P0, q0, and Q1, and output P0;

Use a 4-input filter to filter P2, P1, P0, and q0, and output P1;

(Only used for brightness) Use a 5-input filter to filter P3, P2, P1, P0, and q0, and output p2

Else:

Use a 3-input filter to filter P1, P0, and Q1 and output P0;

 

If | q2-q0 | <? & | P0-q0 | <round (? /4) then:

Filter Q2, Q1, q0, P0, and P1 using a 5 input filter, and output q0;

Filter Q2, Q1, q0, and P0 using a 4-input filter and output Q1;

(Only used for brightness components) filter Q3, q2, Q1, q0, and P0 using a 5-input filter, and output Q2

Else:

Filter Q1, q0, and P1 using a 3-input filter and output q0.

 

6. Filter instances

A qcif video clip uses the AVC reference program to encode fixed quantization parameter 32. Figure 3 shows the original frame of the video clip; Figure 4 shows the same frame after frame encoding and reconstruction when loop filter is disabled. Figure 5 uses a loop filter to display frames, greatly improving the effect. There is still some distortion here, but most of the block edges have disappeared or faded. Note that the boundary with obvious contrast is saved by the filter while the boundary of the image smoothing area is smoothed.

 

Figure 6 shows a decoded frame with a higher QP (36). The loop filter is disabled (note that a large number of pseudo images are added). Figure 7 shows the same frame and uses the loop filter.

 






 

 

7. References

 

1 ITU-T Rec. H.264/ISO/IEC 264-10, "advanced video coding", Final Committee draft, document JVT limit 50, March 11496

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.