Image decoding method and device using residual information in image coding system
An image decoding method, which is performed by a decoding device according to the present document, is characterized by including: a step for receiving a bitstream including residual information about the current block; a step for deriving a maximum value of the number of context-encoding bins for context syntax elements coded on the basis of context included in the residual information; a step for entropy-decoding the context syntax elements on the basis of the maximum value; a step for deriving conversion coefficients for the current block on the basis of the entropy-decoded context syntax elements; a step for deriving a residual sample for the current block on the basis of the conversion coefficients; and a step for generating a reconstructed picture on the basis of the residual sample for the current block.
1. An image decoding method performed by a decoding apparatus, comprising:
receiving a bitstream including residual information of a current block;
deriving a maximum number of context-coded bins for context-based coded context syntax elements included in the residual information;
entropy decoding the context syntax elements based on the maximum number;
deriving a transform coefficient for the current block based on the entropy decoded context syntax elements;
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 context syntax elements include a significant coefficient flag representing whether the transform coefficient is a non-zero transform coefficient, a parity level flag for parity of a transform coefficient level for the transform coefficient, a first transform coefficient level flag regarding whether the transform coefficient level is greater than a first threshold, and a second transform coefficient level flag regarding whether the transform coefficient level of a quantized transform coefficient is greater than a second threshold, and
wherein the maximum number is a maximum number of a sum of a number of context-coded bins of significant coefficient flags, a number of the context-coded bins of first transform coefficient level flags, a number of context-coded bins of parity level flags, and a number of context-coded bins of second transform coefficient level flags for transform coefficients related to a current subblock of the current block.
2. The image decoding method of claim 1 , wherein the maximum number is derived based on a length from a position of a start transform coefficient of the current block to a position of a last non-zero transform coefficient.
3. The image decoding method of claim 2 , wherein the bitstream includes position information representing the position of the last non-zero transform coefficient of the current block, and the position of the last non-zero transform coefficient is derived based on the position information.
4. An image encoding method performed by an encoding apparatus, comprising:
deriving a residual sample for a current block;
deriving a transform coefficient based on the residual sample for the current block;
deriving a maximum number of context-coded bins for context syntax elements for the transform coefficient;
entropy encoding the context syntax elements based on the maximum number; and
outputting a bitstream including residual information for the current block including the entropy encoded context syntax elements,
wherein the context syntax elements include a significant coefficient flag representing whether the transform coefficient is a non-zero transform coefficient, a parity level flag for parity of a transform coefficient level for the transform coefficient, a first transform coefficient level flag regarding whether the transform coefficient level is greater than a first threshold, and a second transform coefficient level flag regarding whether the transform coefficient level of a quantized transform coefficient is greater than a second threshold, and
wherein the maximum number is a maximum number of a sum of a number of context-coded bins of significant coefficient flags, a number of the context-coded bins of first transform coefficient level flags, a number of context-coded bins of parity level flags, and a number of context-coded bins of second transform coefficient level flags for transform coefficients related to a current subblock of the current block.
5. The image encoding method of claim 4 , wherein the maximum number is derived based on a length from a position of a start transform coefficient of the current block to a position of a last non-zero transform coefficient.
6. The image encoding method of claim 5 , wherein the bitstream includes position information representing the position of the last non-zero transform coefficient of the current block.
7. A transmission method of data for image, the method comprising:
obtaining a bitstream of image information comprising residual information for a current block including context syntax elements; and
transmitting the data including the bitstream of the image information comprising the residual information,
wherein the context syntax elements are entropy encoded based on a maximum number of context-coded bins for the context syntax elements,
wherein the context syntax elements include a significant coefficient flag representing whether a transform coefficient for the current block is a non-zero transform coefficient, a parity level flag for parity of a transform coefficient level for the transform coefficient, a first transform coefficient level flag regarding whether the transform coefficient level is greater than a first threshold, and a second transform coefficient level flag regarding whether the transform coefficient level of a quantized transform coefficient is greater than a second threshold, and
wherein the maximum number is a maximum number of a sum of a number of context-coded bins of significant coefficient flags, a number of context-coded bins of first transform coefficient level flags, a number of context-coded bins of parity level flags, and a number of context-coded bins of second transform coefficient level flags for transform coefficients related to a current subblock of the current block.