Efficient rounding for deblocking
The present disclosure relates to deblocking filtering which is applicable to smoothing the block boundaries in an image or video coding and decoding. In particular, the deblocking filtering is either strong or weak, wherein the clipping is performed differently in the strong filtering and the weak filtering.
1. An image decoding method for decoding an encoded image on a per block basis, the image decoding method comprising:
determining, on a per line basis, (i) whether or not a filter is to be applied to a boundary between a block and a neighboring block adjacent to the block, the block and the neighboring block being included in a reconstructed image corresponding to the encoded image, and (ii) a width of the filter when the filter is determined to be applied; and
filtering, on a per line basis, the block when the filter is determined to be applied, wherein
in the filtering, when the width of the filter is a first width, sample pixels in a second width are used, the first width being narrower than the second width,
in the filtering, when the width of the filter is a third width, the third width being narrower than the first width, sample pixels in a fourth width are used, the third width being narrower than the fourth width, and
in the determining, when determining whether or not the filter is to be applied to a current line, a first difference value between p0 and q0 and a second difference value between p1 and q1 are used, p0 and p1 being pixel values of a first pixel and a second pixel respectively in the current line included in the block, and q0 and q1 being pixel values of a third pixel and a fourth pixel respectively in the current line included in the neighboring block, the first pixel being closest to the boundary, the second pixel being next to the first pixel, the third pixel being closest to the boundary, and the fourth pixel being next to the third pixel.
2. The image decoding method according to claim 1 ,
wherein the filtering includes (i) filtering across a vertical boundary of the block and (ii) filtering across a horizontal boundary of the block, the filtering across the vertical boundary of the block being performed before the filtering across the horizontal boundary of the block.