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, the image decoding method comprising:
determining (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, the neighboring block having a prediction signal different from a prediction signal of the block and a transform coefficient different from a transform coefficient of the block and (ii) a width of the filter when the filter is determined to be applied; and
filtering the boundary when the filter is determined to be applied, wherein
only results of comparing between a value calculated using pixel values and a threshold are used to determine whether or not the filter is to be applied, the pixel values being included in the block or the neighboring block, and
in calculating the value using the pixel values, 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 included in the block, and q0 and q1 being pixel values of a third pixel and a fourth pixel respectively 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. An image decoding apparatus for decoding an encoded image, the image decoding apparatus comprising:
processing circuitry, and
storage coupled to the processing circuitry;
wherein the processing circuitry, by using the storage, performs the following:
determining (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, the neighboring block having a prediction signal different from a prediction signal of the block and a transform coefficient different from a transform coefficient of the block and (ii) a width of the filter when the filter is determined to be applied; and
filtering the boundary when the filter is determined to be applied, wherein
only results of comparing between a value calculated using pixel values and a threshold are used to determine whether or not the filter is to be applied, the pixel values being in the current line and included in the block or the neighboring block, and
in calculating the value using the pixel values, 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 included in the block, and q0 and q1 being pixel values of a third pixel and a fourth pixel respectively 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.