Method of applying edge offset
A method of post-processing a reconstructed image is discussed. The method according to an embodiment includes determining that a deblocking filtering process is performed per slice; when it is determined that the deblocking filtering process is performed, applying the deblocking filtering process to the slice; and applying an edge offset if a sample adaptive offset (SAO) type indicates an edge offset.
1. A method of post-processing a reconstructed image, the method comprising:
determining that a deblocking filtering process is performed per slice;
when it is determined that the deblocking filtering process is performed, applying the deblocking filtering process to the slice; and
applying an edge offset if a sample adaptive offset (SAO) type indicates an edge offset,
wherein the deblocking filtering process comprises sub-steps of:
determining a boundary strength for a 4-sample edge which is a prediction edge or a transform edge and lies on an 8×8 sample grid;
determining whether a deblocking filtering is applied on the 4-sample edge or not using the boundary strength and a boundary quantization parameter; and
filtering the 4-sample edge if the deblocking filtering is applied on the 4-sample edge,
wherein the boundary quantization parameter is an average of a quantization parameter of a P block containing sample p0 and a quantization parameter of a Q block containing sample q0, the quantization parameter of the P block is generated by using a quantization parameter predictor and a differential quantization parameter of the P block, and if two or more quantization parameters are available among a left quantization parameter, an above quantization parameter and a previous quantization parameter of the P block, the quantization parameter predictor of the P block is generated using two available quantization parameters which are determined according to an order of the left quantization parameter, the above quantization parameter and the previous quantization parameter,
wherein the step of applying an edge offset comprises the sub-steps of:
generating an edge index of a current sample; and
generating an edge offset corresponding to the edge index to the current sample,
wherein the edge index is generated using the following equation:
edgeIdx=2+sign3(recPicture( x )−recPicture( x −1))+sign3(recPicture( x )−recPicture( x +1)),
wherein the function sign3(y) is equal to 1 if the y is larger than 0, the function sign3(y) is equal to −1 if the y is smaller than 0, and the function sign3(y) is equal to 0 if the y is equal to 0, and
wherein the variable recPicture(x) represents the current sample value, the variables recPicture(x−1) and recPicture(x+1) represent two neighboring sample values.
2. The method of claim 1 , wherein the two neighboring samples are determined by an edge offset type of a current area.
3. The method of claim 1 , wherein the edge offset is set as negative or positive based on the edge index.
4. The method of claim 3 , wherein the edge offset is set as positive if the edge index is equal to 0 or 1.
5. The method of claim 3 , wherein the edge offset is set as negative if the edge index is equal to 3 or 4.
6. The method of claim 1 , wherein the edge offset is set to 0 if the edge index is equal to 2.
7. The method of claim 1 , wherein if one of the two neighboring samples belongs to another LCU, the edge offset is not applied to the current sample.
8. The method of claim 1 , wherein if one of the two neighboring samples belongs to another LCU, the neighboring sample belonging to another LCU is replaced with another sample within LCU.
9. The method of claim 1 , wherein if only one quantization parameter is available among the left quantization parameter, the above quantization parameter and the previous quantization parameter of the P block, the available quantization parameter is set as the quantization parameter predictor of the P block.