Method and device for encoding/decoding residual block on basis of quantization parameter
An encoding/decoding device according to the present invention derives a residual coefficient of a residual block from a bitstream, calculates a quantization parameter for the residual block, performs inverse quantization on the residual coefficient by using the quantization parameter, and performs inverse conversion on the inversely quantized residual coefficient, thereby enabling restoration of a residual sample of the residual block.
1. A method of decoding an image, comprising:
decoding a residual coefficient of a current block in the image from a bitstream;
performing inverse-quantization on the residual coefficient by using a quantization parameter; and
reconstructing a residual sample of the current block by performing inverse-transform on the inverse-quantized residual coefficient,
wherein the inverse-transform is performed based on a transform candidate set determined from among a plurality of transform candidate sets including a first transform candidate set and a second transform candidate set, and
wherein each of the transform candidate sets includes at least one transform type being available for the inverse-transform of the current block,
wherein a number of transform types included in the first transform candidate set is different from a number of transform types included in the second transform candidate set,
wherein, in response to a maximum value of a width and a height of the current block being less than or equal to 32, the first transform candidate set among the plurality of the transform candidate sets is determined as the transform candidate set, and
wherein, in response to a maximum value of a width and a height of the current block being greater than 32, the second transform candidate set among the plurality of the transform candidate sets is determined as the transform candidate set.
2. The method of claim 1 ,
wherein the first transform candidate set includes DCT-VIII and DST-VII, and
wherein the second transform candidate set includes DCT-II, DCT-VIII, and DST-VII.
3. A method of encoding an image, comprising:
obtaining a residual coefficient of a current block in the image by performing transform on a residual sample of the current block;
performing quantization on the residual coefficient by using a quantization parameter; and
encoding the quantized residual coefficient of the current block,
wherein the transform is performed based on a transform candidate set determined from among a plurality of transform candidate sets including a first transform candidate set and a second transform candidate set, and
wherein each of the transform candidate sets includes at least one transform type being available for the transform of the current block,
wherein a number of transform types included in the first transform candidate set is different from a number of transform types included in the second transform candidate set,
wherein, in response to a maximum value of a width and a height of the current block being less than or equal to 32, the first transform candidate set among the plurality of the transform candidate sets is determined as the transform candidate set, and
wherein, in response to a maximum value of a width and a height of the current block being greater than 32, the second transform candidate set among the plurality of the transform candidate sets is determined as the transform candidate set.
4. A non-transitory computer-readable medium for storing a bitstream associated with an image,
wherein the bitstream includes a residual coefficient generated by encoding a residual sample of a current block in the image,
wherein the residual sample of the current block is decoded from the bitstream by performing inverse-quantization and inverse-transform on the residual coefficient,
wherein the inverse-quantization is performed by using a quantization parameter,
wherein the inverse-transform is performed based on a transform candidate set determined from among a plurality of transform candidate sets including a first transform candidate set and a second transform candidate set, and
wherein each of the transform candidate sets includes at least one transform type being available for the inverse-transform of the current block,
wherein a number of transform types included in the first transform candidate set is different from a number of transform types included in the second transform candidate set,
wherein, in response to a maximum value of a width and a height of the current block being less than or equal to 32, the first transform candidate set among the plurality of the transform candidate sets is determined as the transform candidate set, and
wherein, in response to a maximum value of a width and a height of the current block being greater than 32, the second transform candidate set among the plurality of the transform candidate sets is determined as the transform candidate set.