Video decoding method and apparatus, and video encoding method and apparatus
In video encoding and decoding process, provided are method and apparatus for determining whether a slice including an adjacent pixel located at upper-left or lower-right side of current pixel from among adjacent pixels used for adaptive loop filter of current pixel is different from a slice including current pixel, determining a value of adjacent pixel located at upper-left or lower-right side as a value of closest pixel in horizontal direction of adjacent pixel located at the upper-left or lower-right side from among pixels included in the slice including current pixel, determining an adaptive loop filter including a filter coefficient for the current pixel and adjacent pixels based on values of current pixel and adjacent pixels, correcting the value of current pixel by using the values of adjacent pixels, by applying the adaptive loop filter to the current pixel, and encoding/decoding a current block including the current pixel.
1 . A video decoding method comprising:
reconstructing a current block comprising a current pixel via a prediction and an inverse transformation;
obtaining, from a bitstream, information indicating whether an in-loop filtering by using at least one pixel located outside a boundary of a current slice is applicable;
when a slice comprising a first adjacent pixel located at an upper-left side of the current pixel is different from the current slice comprising the current pixel, and the information indicates that the in-loop filtering by using the at least one pixel located outside the boundary of the current slice is not applicable, padding a value of the first adjacent pixel as a value of a second adjacent pixel, from among pixels located in the current slice, at a closest location to a location of the first adjacent pixel in a horizontal direction of the location of the first adjacent pixel;
determining filter coefficients corresponding to locations of third adjacent pixels used for an adaptive loop filter (ALF) of the current pixel based on a value of the current pixel and values of the third adjacent pixels, wherein the third adjacent pixels include the first adjacent pixel and the locations of the third adjacent pixels are predetermined; and
obtaining a value of a filtered current pixel by adding the value of the current pixel and a value obtained by applying a filter coefficient from among the filter coefficients to a difference between a value of one adjacent pixel from among the third adjacent pixels and the value of the current pixel,
wherein when two adjacent pixels among the third adjacent pixels are symmetrically located vertically relative to the current pixel, filter coefficients corresponding to locations of the two adjacent pixels are same.
2 . A video encoding method comprising:
reconstructing a current block comprising a current pixel via a prediction and an inverse transformation;
generating information indicating whether an in-loop filtering by using at least one pixel located outside a boundary of a current slice is applicable;
when a slice comprising a first adjacent pixel located at an upper-left side of the current pixel is different from the current slice comprising the current pixel, and the information indicates that the in-loop filtering by using the at least one pixel located outside the boundary of the current slice is not applicable, padding a value of the first adjacent pixel as a value of a second adjacent pixel, from among pixels located in the current slice, at a closest location to a location of the first adjacent pixel in a horizontal direction of the location of the first adjacent pixel;
determining filter coefficients corresponding to locations of third adjacent pixels used for an adaptive loop filter (ALF) of the current pixel based on a value of the current pixel and values of the third adjacent pixels, wherein the third adjacent pixels comprise the first adjacent pixel and the locations of the third adjacent pixels are predetermined; and
obtaining a value of a filtered current pixel by adding the value of the current pixel and a value obtained by applying a filter coefficient from among the filter coefficients to a difference between a value of one adjacent pixel from among the third adjacent pixels and the value of the current pixel,
wherein when two adjacent pixels among the third adjacent pixels are symmetrically located vertically relative to the current pixel, filter coefficients corresponding to locations of the two adjacent pixels are same.
3 . A method for transmitting a bitstream, the method comprising:
generating the bitstream by the video encoding method of claim 2 and
transmitting the bitstream to a receiver.
4 . An apparatus comprising at least one processor configured to transmit a bitstream generated according to:
reconstructing a current block comprising a current pixel via a prediction and an inverse transformation;
generating information indicating whether an in-loop filtering by using at least one pixel located outside a boundary of a current slice is applicable;
when a slice comprising a first adjacent pixel located at an upper-left side of the current pixel is different from the current slice comprising the current pixel, and the information indicates that the in-loop filtering by using the at least one pixel located outside the boundary of the current slice is not applicable, padding a value of the first adjacent pixel as a value of a second adjacent pixel, from among pixels located in the current slice, at a closest location to a location of the first adjacent pixel in a horizontal direction of the location of the first adjacent pixel;
determining filter coefficients corresponding to locations of third adjacent pixels used for an adaptive loop filter (ALF) of the current pixel based on a value of the current pixel and values of the third adjacent pixels, wherein the third adjacent pixels comprise the first adjacent pixel and the locations of the third adjacent pixels are predetermined; and
obtaining a value of a filtered current pixel by adding the value of the current pixel and a value obtained by applying a filter coefficient from among the filter coefficients to a difference between a value of one adjacent pixel from among the third adjacent pixels and the value of the current pixel,
wherein when two adjacent pixels among the third adjacent pixels are symmetrically located vertically relative to the current pixel, filter coefficients corresponding to locations of the two adjacent pixels are same.