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. A decoding apparatus for image decoding, the decoding apparatus comprising:
a memory; and
at least one processor connected to the memory, the at least one processor configured to:
receive a bitstream including residual information of a current block;
derive a maximum number of context-coded bins for context-based coded context syntax elements included in the residual information;
entropy decode the context syntax elements based on the maximum number;
derive a transform coefficient for the current block based on the entropy decoded context syntax elements;
derive a residual sample for the current block based on the transform coefficient; and
generate 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 for a sum of following numbers:
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.
2. The decoding apparatus 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 decoding apparatus 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 encoding apparatus for image encoding, the encoding apparatus comprising:
a memory; and
at least one processor connected to the memory, the at least one processor configured to:
derive a residual sample for a current block;
derive a transform coefficient based on the residual sample for the current block;
derive a maximum number of context-coded bins for context syntax elements for the transform coefficient;
entropy encode the context syntax elements based on the maximum number; and
output 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 for a sum of following numbers:
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.
5. The encoding apparatus 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 encoding apparatus 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. An apparatus for transmitting data for an image, the apparatus comprising:
at least one processor configured to obtain a bitstream of image information comprising residual information for a current block including context syntax elements; and
a transmitter configured to transmit 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 for a sum of following numbers:
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.