Video decoding method using residual information in video coding system, and apparatus thereof
A video decoding method performed by a decoding apparatus according to the present document comprises the steps of: receiving a bit stream including residual information of a current block; deriving a specific number of the number of context encoding bins for context syntax elements for a current sub-block of the current block; decoding the context syntax elements for the current sub-block included in the residual information on the basis of the specific number; deriving transform coefficients for the current sub-block on the basis of the decoded context syntax elements; deriving residual samples for the current block on the basis of the transform coefficients; and generating a reconstructed picture on the basis of the residual samples.
1 . An method for encoding an image by an encoding apparatus, the method comprising:
deriving residual samples for a current block of an image;
deriving transform coefficients in a current subblock of the current block based on the residual samples; and
deriving a specific value for a number of context-coded bins for context syntax elements for the current subblock;
upon determining that transform skip is applied to the current block, encoding one or more transform coefficients for the current subblock based on context until a number of encoded transform coefficients is equal to the specific value,
wherein encoding the one or more transform coefficients comprises encoding, for each transform coefficient, one or more context syntax elements comprising at least one of a significant coefficient flag for the transform coefficient, a sign flag for the transform coefficient, a first transform coefficient level flag, or a parity level flag;
encoding values of remaining transform coefficients based on values of respective bypass syntax elements; and
generating a bitstream comprising residual information on the current block, the residual information comprising the encoded context syntax elements and the bypass syntax elements.
2 . The method of claim 1 , wherein the significant coefficient flag indicates whether the transform coefficient is a non-zero transform coefficient, and
wherein encoding a significant coefficient flag comprises encoding a sig_coeff_flag of a right subblock (NB0) and a sig_coeff_flag of a left subblock (NB1) of the current subblock.
3 . The method of claim 2 , further comprising:
deriving a context model offset as a number of sig_coeff_flag[NB0]+sig_coeff_flag[NB1] of significant neighboring subblocks.
4 . The method of claim 1 , further comprising:
when a number of context syntax elements exceeds a cutoff value numGtFlags, encoding abs_remainder syntax elements using a binarization process according to a Rice parameter,
wherein numGtFlags is equal to 5.
5 . The method of claim 1 , wherein the sign flag for the transform coefficient indicates the sign of the transform coefficient, and
wherein encoding the sign flag comprises encoding a coeff_sign_flag.
6 . The method of claim 1 , wherein the first transform coefficient level flag indicates whether the level of the transform coefficient is greater than a first threshold, and
wherein encoding the first transform coefficient level flag comprises encoding a abs_level_gt1_flag.
7 . The method of claim 6 , wherein the parity level flag indicates the parity of the level of the transform coefficient, and
wherein encoding the parity level flag comprises encoding a par_level_flag.
8 . An method for decoding an image by a decoding apparatus, the method comprising:
receiving a bitstream comprising residual information, the residual information comprising encoded context syntax elements and bypass syntax elements of one or more subblocks corresponding to a block of an image;
deriving transform coefficients for the one or more subblocks corresponding to the block based on the residual information, wherein the deriving of the transform coefficients comprises, for a current subblock of the one or more subblocks:
determining a specific value for a number of context-coded bins for context syntax elements for the current subblock;
upon determining that transform skip is applied to the block, obtaining transform coefficients for the current subblock by decoding one or more context syntax elements corresponding to each transform coefficient until a number of decoded transform coefficients is equal to the specific value,
wherein the one or more context syntax elements comprise at least one of a significant coefficient flag for the transform coefficient, a sign flag for the transform coefficient, a first transform coefficient level flag, or a parity level flag;
decoding values of remaining transform coefficients based on values of respective bypass syntax elements; and
deriving residual samples for the block based on the transform coefficients; and
generating a reconstructed image based on the residual samples for the block.
9 . The method of claim 8 , wherein the significant coefficient flag indicates whether the transform coefficient is a non-zero transform coefficient, and
wherein decoding a significant coefficient flag comprises decoding a sig_coeff_flag of a right subblock (NB0) and a sig_coeff_flag of a left subblock (NB1) of the current subblock.
10 . The method of claim 9 , further comprising:
deriving a context model offset as a number of sig_coeff_flag[NB0]+sig_coeff_flag[NB1] of significant neighboring subblocks.
11 . The method of claim 8 , further comprising:
when a number of context syntax elements exceeds a cutoff value numGtFlags, decoding abs_remainder syntax elements using a binarization process according to a Rice parameter,
wherein numGtFlags is equal to 5.
12 . The method of claim 8 , wherein the sign flag for the transform coefficient indicates the sign of the transform coefficient, and
wherein decoding the sign flag comprises decoding a coeff_sign_flag.
13 . The method of claim 8 , wherein the first transform coefficient level flag indicates whether the level of the transform coefficient is greater than a first threshold, and
wherein decoding the first transform coefficient level flag comprises decoding a abs_level_gt1_flag.
14 . The method of claim 13 , wherein the parity level flag indicates the parity of the level of the transform coefficient, and
wherein decoding the parity level flag comprises decoding a par_level_flag.
15 . An image encoding apparatus comprising:
one or more processors; and
memory storing instructions that, when executed, are configured to cause the one or more processors to perform operations comprising:
deriving residual samples for a current block of an image;
deriving transform coefficients in a current subblock of the current block based on the residual samples; and
deriving a specific value for a number of context-coded bins for context syntax elements for the current subblock;
upon determining that transform skip is applied to the current block, encoding one or more transform coefficients for the current subblock based on context until a number of encoded transform coefficients is equal to the specific value,
wherein encoding the one or more transform coefficients comprises encoding, for each transform coefficient, one or more context syntax elements comprising at least one of a significant coefficient flag for the transform coefficient, a sign flag for the transform coefficient, a first transform coefficient level flag, or a parity level flag;
encoding values of remaining transform coefficients based on values of respective bypass syntax elements; and
generating a bitstream comprising residual information on the current block, the residual information comprising the encoded context syntax elements and the bypass syntax elements.
16 . The image encoding apparatus of claim 15 , wherein the significant coefficient flag indicates whether the transform coefficient is a non-zero transform coefficient, and
wherein encoding a significant coefficient flag comprises encoding a sig_coeff_flag of a right subblock (NB0) and a sig_coeff_flag of a left subblock (NB1) of the current subblock.
17 . The image encoding apparatus of claim 15 , further comprising:
when a number of context syntax elements exceeds a cutoff value numGtFlags, encoding abs_remainder syntax elements using a binarization process according to a Rice parameter,
wherein numGtFlags is equal to 5.
18 . The image encoding apparatus of claim 15 , wherein the sign flag for the transform coefficient indicates the sign of the transform coefficient, and
wherein encoding the sign flag comprises encoding a coeff_sign_flag.
19 . The image encoding apparatus of claim 15 , wherein the first transform coefficient level flag indicates whether the level of the transform coefficient is greater than a first threshold, and
wherein encoding the first transform coefficient level flag comprises encoding a abs_level_gt1_flag.
20 . The image encoding apparatus of claim 19 , wherein the parity level flag indicates the parity of the level of the transform coefficient, and
wherein encoding the parity level flag comprises encoding a par_level_flag.