Residual coding method and device for same
A method for decoding a picture performed by a decoding apparatus according to the present disclosure includes receiving a bitstream including residual information, deriving a quantized transform coefficient for a current block based on the residual information included in the bitstream, deriving a transform coefficient from the quantized transform coefficient based on a dequantization process, deriving a residual sample for the current block by applying an inverse transform to the derived transform coefficient, and generating a reconstructed picture based on the residual sample for the current block.
1 . An image decoding method performed by a decoding apparatus, the method comprising:
obtaining residual information from a bitstream;
deriving a quantized transform coefficient for a current block based on the residual information;
deriving a transform coefficient based on the quantized transform coefficient;
deriving a residual sample for the current block based on the transform coefficient; and
generating a reconstructed picture based on the residual sample for the current block,
wherein the residual information includes a significant coefficient flag representing whether a quantized transform coefficient is a non-zero significant coefficient, a parity level flag for a parity of a transform coefficient level for the quantized transform coefficient, a first transform coefficient level flag about whether the transform coefficient level is larger than a first reference value, a second transform coefficient level flag about whether the transform coefficient level is larger than a second reference value and remainder information of the transform coefficient level,
wherein the first reference value and the second reference value are predetermined specific values, and a predetermined specific value for the first reference value is 1 and a predetermined specific value for the second reference value is 3,
wherein deriving the quantized transform coefficient comprises:
deriving the quantized transform coefficient based on decoding the parity level flag and decoding the first transform coefficient level flag,
wherein the decoding of the first transform coefficient level flag is performed prior to the decoding of the parity level flag,
wherein the decoding of the parity level flag is performed based on a value of the first transform coefficient level flag being 1, and
wherein the quantized transform coefficient is derived based on a calculation of (a value of the significant coefficient flag+a value of the first transform coefficient level flag+a value of the parity level flag+(2*a value of the second transform coefficient level flag)+ (2*a value of the remainder information)).
2 . An image encoding method performed by an encoding apparatus, the method comprising:
deriving a residual sample for a current block;
deriving a transform coefficient for the current block based on the residual sample;
deriving a quantized transform coefficient based on the transform coefficient; and
encoding residual information comprising information related to the quantized transform coefficient,
wherein the residual information includes a significant coefficient flag representing whether a quantized transform coefficient is a non-zero significant coefficient, a parity level flag for a parity of a transform coefficient level for the quantized transform coefficient, a first transform coefficient level flag about whether the transform coefficient level is larger than a first reference value, a second transform coefficient level flag about whether the transform coefficient level is larger than a second reference value and remainder information of the transform coefficient level,
wherein the first reference value and the second reference value are predetermined specific values, and a predetermined specific value for the first reference value is 1 and a predetermined specific value for the second reference value is 3,
wherein the encoding of the residual information comprises:
encoding the parity level flag and encoding the first transform coefficient level flag,
wherein the encoding of the first transform coefficient level flag is performed prior to the encoding of the parity level flag,
wherein the encoding of the parity level flag is performed based on a value of the first transform coefficient level flag being 1, and
wherein a result of the encoding for the quantized transform coefficient is derived based on a calculation of (a value of the significant coefficient flag+a value of the first transform coefficient level flag+a value of the parity level flag+(2*a value of the second transform coefficient level flag)+(2*a value of the remainder information)).
3 . A transmission method of data for an image, the method comprising:
deriving a residual sample for a current block, deriving a transform coefficient for the current block based on the residual sample, deriving a quantized transform coefficient based on the transform coefficient, encoding residual information comprising information related to the quantized transform coefficient, and generating a bitstream for the image based on the encoded residual information; and
transmitting the data comprising the bitstream,
wherein the residual information includes a significant coefficient flag representing whether a quantized transform coefficient is a non-zero significant coefficient, a parity level flag for a parity of a transform coefficient level for the quantized transform coefficient, a first transform coefficient level flag about whether the transform coefficient level is larger than a first reference value, a second transform coefficient level flag about whether the transform coefficient level is larger than a second reference value and remainder information of the transform coefficient level,
wherein the first reference value and the second reference value are predetermined specific values, and a predetermined specific value for the first reference value is 1 and a predetermined specific value for the second reference value is 3,
wherein the encoding of the residual information comprises:
encoding the parity level flag and encoding the first transform coefficient level flag, wherein the encoding of the first transform coefficient level flag is performed prior to the encoding of the parity level flag,
wherein the encoding of the parity level flag is performed based on a value of the first transform coefficient level flag being 1, and
wherein a result of the encoding for the quantized transform coefficient is derived based on a calculation of (a value of the significant coefficient flag+a value of the first transform coefficient level flag+a value of the parity level flag+(2*a value of the second transform coefficient level flag)+(2*a value of the remainder information)).