Method and apparatus for decoding video, and method and apparatus for encoding video
AssigneeSamsung Electronics Co., Ltd.
InventorsAlexander Alshin, Elena Alshina
Life of this patent
Estimating the term…
Abstract
A video decoding and video encoding method of performing inter prediction in a bi-directional motion prediction mode, in which a prediction pixel value of a current block may be generated by not only using a pixel value of a first reference block of a first reference picture and a pixel value of a second reference block of a second reference picture, but also using a first gradient value of the first reference block and a second gradient value of the second reference block, in a bi-directional motion prediction mode. Accordingly, encoding and decoding efficiency may be increased since a prediction block similar to an original block may be generated.
Claims13
A video decoding method comprising:
- obtaining, from a bitstream, motion prediction mode information regarding a current block in a current picture;
- when the obtained motion prediction mode information indicates a bi-directional motion prediction mode, obtaining, from the bitstream, a first motion vector indicating a first reference block of the current block in a first reference picture and a second motion vector indicating a second reference block of the current block in a second reference picture;
- generating a gradient value of a first pixel in vertical direction from among pixels of the first reference block indicated by the first motion vector by applying a first one-dimensional gradient filter to a first neighboring region of the first pixel, generating a gradient value of the first pixel in horizontal direction by applying a second one-dimensional gradient filter to a second neighboring region of the first pixel, and generating a gradient value of a second pixel in vertical direction from among pixels of the second reference block indicated by the second motion vector by applying a third one-dimensional gradient filter to a first neighboring region of the second pixel, and generating a gradient value of the second pixel in horizontal direction by applying a fourth one-dimensional gradient filter to a second neighboring region of the second pixel;
- determining displacement vectors in a horizontal direction and a vertical direction;
- and
- generating a prediction pixel value of a current pixel in the current block by using a first value and a second value, wherein the current pixel corresponds to the first pixel and the second pixel, the first value is generated by using a pixel value of the first pixel and a pixel value of the second pixel, the second value is generated by using the gradient values of the first pixel in vertical direction and in horizontal direction, the gradient values of the second pixel in vertical direction and in horizontal direction, and the displacement vectors in the horizontal direction and the vertical direction,
- wherein when applying a one-dimensional gradient filter to a neighboring region, a weighted sum of pixel values of pixels included in the neighboring region is determined, wherein weights for the weighted sum correspond to filter coefficients of the one-dimensional gradient filter,
- wherein when applying a one-dimensional gradient filter to generate a gradient value of one of the first pixel and the second pixel in one of vertical direction and horizontal direction, de-scaling is performed based on a de-scaling bit number on a value generated after the one-dimensional gradient filter is applied to at least one pixel value included in the neighboring region and is not performed on at least one coefficient of a one-dimensional gradient filter and is not performed on the at least one pixel value included in the neighboring region,
- wherein the de-scaling comprises bit-shifting to right by the de-scaling bit number,
- wherein the displacement vectors are clipped based on a threshold value when an intermediate value used for determining the displacement vectors is greater than a predetermined value, and
- wherein the displacement vectors are 0 when the intermediate value used for determining the displacement vectors is smaller than or equal to the predetermined value.
A video encoding method comprising:
- determining a first reference block of a first reference picture corresponding to a current block in a current picture, and a second reference block of a second reference picture corresponding to the current block, and determining a first motion vector indicating the first reference block and a second motion vector indicating the second reference block;
- generating a gradient value of a first pixel in vertical direction from among pixels of the first reference block by applying a first one-dimensional gradient filter to a first neighboring region of the first pixel, generating a gradient value of the first pixel in horizontal direction by applying a second one-dimensional gradient filter to a second neighboring region of the first pixel, and generating a gradient value of a second pixel in vertical direction from among pixels of the second reference block by applying a third gradient one-dimensional filter to a first neighboring region of the second pixel and generating a gradient value of the second pixel in horizontal direction by applying a fourth one-dimensional gradient filter to a second neighboring region of the second pixel;
- determining displacement vectors in a horizontal direction and a vertical direction;
- generating a prediction pixel value of a current pixel in the current block by using a first value and a second value, wherein the current pixel corresponds to the first pixel and the second pixel, the first value is generated by using a pixel value of the first pixel and a pixel value of the second pixel, the second value is generated by using the gradient values of the first pixel in vertical direction and in horizontal direction, the gradient values of the second pixel in vertical direction and in horizontal direction, and the displacement vectors in the horizontal direction and in the vertical direction, and
- generating a bitstream comprising information about the first motion vector and the second motion vector and motion prediction mode information indicating that a motion prediction mode of the current block is a bi-directional motion prediction mode, and
- wherein when applying a one-dimensional gradient filter to a neighboring region, a weighted sum of pixel values of pixels included in the neighboring region is determined, wherein weights for the weighted sum correspond to filter coefficients of the one-dimensional gradient filter,
- wherein when applying a one-dimensional gradient filter to generate a gradient value of one of the first pixel and the second pixel in one of vertical direction and horizontal direction, de-scaling is performed based on a de-scaling bit number on a value generated after the one-dimensional gradient filter is applied to at least one pixel value included in the neighboring region and is not performed on at least one coefficient of a one-dimensional gradient filter and is not performed on the at least one pixel value included in the neighboring region,
- wherein the de-scaling comprises bit-shifting to right by the de-scaling bit number,
- wherein the displacement vectors are clipped based on a threshold value when an intermediate value used for determining the displacement vectors is greater than a predetermined value, and
- wherein the displacement vectors are 0 when the intermediate value used for determining the displacement vectors is smaller than or equal to the predetermined value.
A video decoding apparatus comprising:
- at least one processor configured to:
- obtain, from a bitstream, motion prediction mode information regarding a current block in a current picture, and when the obtained motion prediction mode information indicates a bi-directional motion prediction mode, obtain, from the bitstream, a first motion vector indicating a first reference block of the current block in a first reference picture and a second motion vector indicating a second reference block of the current block in a second reference picture,
- generate a gradient value of a first pixel in vertical direction from among pixels of the first reference block indicated by the first motion vector by applying a first one-dimensional gradient filter to a first neighboring region of the first pixel, generate a gradient value of the first pixel in horizontal direction by applying a second one-dimensional gradient filter to a second neighboring region of the first pixel, generate a gradient value of a second pixel in vertical direction from among pixels of the second reference block indicated by the second motion vector by applying a third one-dimensional gradient filter to a first neighboring region of the second pixel and generate a gradient value of the second pixel in horizontal direction by applying a fourth one-dimensional gradient filter to a second neighboring region of the second pixel, determine displacement vectors in horizontal direction and vertical direction, and generate a prediction pixel value of a current pixel in the current block by using a first value and a second value, wherein the current pixel corresponds to the first pixel and the second pixel, wherein the first value is generated by using a pixel value of the first pixel and a pixel value of the second pixel, the second value is generated by using the gradient values of the first pixel in vertical direction and in horizontal direction, the gradient values of the second pixel in vertical direction and in horizontal direction, and the displacement vectors in the horizontal direction and in the vertical direction, and
- wherein when the at least one processor applies a one-dimensional gradient filter to a neighboring region, a weighted sum of pixel values of pixels included in the neighboring region is determined, wherein weights for the weighted sum correspond to filter coefficients of the one-dimensional gradient filter,
- wherein when the at least one processor applies a one-dimensional gradient filter to generate a gradient value of one of the first pixel and the second pixel in one of vertical direction and horizontal direction, de-scaling is performed based on a de-scaling bit number on a value generated after the one-dimensional gradient filter is applied to at least one pixel value included in the neighboring region and is not performed on at least one coefficient of a one-dimensional gradient filter and is not performed on the at least one pixel value,
- wherein the de-scaling comprises bit-shifting to right by the de-scaling bit number,
- wherein the displacement vectors are clipped based on a threshold value when an intermediate value used for determining the displacement vectors is greater than a predetermined value, and
- wherein the displacement vectors are 0 when the intermediate value used for determining the displacement vectors is smaller than or equal to the predetermined value.
Dependencies are inferred from the claim text.