Conversion factor level coding method and device therefor
A method for decoding an image by a decoding device according to the present disclosure comprises the steps of: receiving a bit stream including residual information; deriving a quantized conversion factor of a current block on the basis of the residual information included in the bit stream; deriving a residual sample of the current block on the basis of the quantized conversion factor; and generating a reconstructed picture on the basis of the residual sample of the current block.
1. An image decoding method performed by a decoding apparatus, the method comprising:
receiving a bitstream comprising residual information;
deriving quantized transform coefficients for a current block based on the residual information comprised in the bitstream;
deriving residual samples for the current block based on the quantized transform coefficients; and
generating a reconstructed picture based on the residual samples for the current block,
wherein the residual information comprises a significant coefficient flag, a parity level flag, a first transform coefficient level flag, a second transform coefficient level flag, an abs remainder syntax element, and a sign flag for a quantized transform coefficient for the current block, wherein the significant coefficient flag is related to whether the quantized transform coefficient is a non-zero significant coefficient, the parity level flag is for a parity of a transform coefficient level for the quantized transform coefficient, the first transform coefficient level flag is about whether the transform coefficient level is larger than a first threshold, the second transform coefficient level flag is about whether the transform coefficient level is larger than a second threshold, the abs_remainder syntax element is about a remaining value of the transform coefficient level, the sign flag is about a sign of the quantized transform coefficient,
wherein the first threshold is 1 and the second threshold is 3,
wherein the deriving of the quantized transform coefficients comprises determining a threshold related to a sum of a number of significant coefficient flags for the transform coefficients within the current block, a number of first transform coefficient level flags, a number of parity level flags, and a number of second transform coefficient level flags based on a size of the current block;
decoding the significant coefficient flag, the first transform coefficient level flag, the parity level flag, the second transform coefficient level flag, the abs_remainder syntax element and the sign flag; and
deriving the quantized transform coefficient based on a value of the decoded significant coefficient flag, a value of the decoded parity level flag, a value of the decoded first transform coefficient level flag, a value of the decoded second transform coefficient level flag, a value of the decoded abs remainder syntax element and a value of the decoded sign flag, and
wherein the decoding of the first transform coefficient level flag is performed prior to the decoding of the parity level flag,
wherein based on the transform coefficient level of the quantized transform coefficient being 1, the parity level flag and the second transform coefficient level flag are not decoded, and
wherein the sum of the number of significant coefficient flags for the quantized transform coefficients within the current block, the number of first transform coefficient level flags, the number of parity level flags, and the number of second transform coefficient level flags, which are comprised in the residual information, is the threshold or less.
2. The method of claim 1 , wherein the threshold is determined based on the size of the current block.
3. The method of claim 1 , wherein the current block is a transform block.
4. The method of claim 1 , wherein when the sum of the number of significant coefficient flags, the number of first transform coefficient level flags, the number of parity level flags, and the number of second transform coefficient level flags, which are derived based on a 0th quantized transform coefficient to the nth quantized transform coefficient determined by a coefficient scanning order, reaches the threshold, an explicit signaling of the significant coefficient flag, the first transform coefficient level flag, the parity level flag, and the second transform coefficient level flag is omitted with respect to an (n+1)th quantized transform coefficient determined by the coefficient scanning order, and a value of an (n+1)th quantized transform coefficient is derived based on the value of the coefficient level information comprised in the residual information.
5. The method of claim 4 , wherein the significant coefficient flags, the first transform coefficient flags, the parity level flags, and the second transform coefficient level flags, which are comprised in the residual information, are encoded based on the context, and wherein the coefficient level information is encoded on a bypass basis.
6. An image encoding method performed by an encoding apparatus, the method comprising:
deriving residual samples for a current block;
deriving quantized transform coefficients based on the residual samples for the current block; and
encoding residual information comprising information for the quantized transform coefficients,
wherein the residual information comprises a significant coefficient flag, a parity level flag, a first transform coefficient level flag, a second transform coefficient level flag, an abs remainder syntax element, and a sign flag for a quantized transform coefficient for the current block, wherein the significant coefficient flag is related to whether the quantized transform coefficient is a non-zero significant coefficient, the parity level flag for a parity of a transform coefficient level for the quantized transform coefficient, the first transform coefficient level flag about whether the transform coefficient level is larger than a first threshold, the second transform coefficient level flag is about whether the transform coefficient level is larger than a second threshold, the abs remainder syntax element is about a remaining value of the transform coefficient level, the sign flag is about a sign of the quantized transform coefficient,
wherein the first threshold is 1 and the second threshold is 3,
wherein the encoding of the residual information comprises,
determining a threshold related to a sum of a number of significant coefficient flags for the transform coefficients within the current block, a number of first transform coefficient level flags, a number of parity level flags, and a number of second transform coefficient level flags based on a size of the current block;
deriving a value of the significant coefficient flag, a value of the parity level flag, a value of the first transform coefficient level flag, a value of the second transform coefficient level flag, a value of the abs_remainder syntax element, a value of the sign flag based on the quantized transform coefficient; and
encoding the significant coefficient flag, the first transform coefficient level flag, the parity level flag, the second transform coefficient level flag, the abs remainder syntax element, the sign flag, and
wherein the encoding of the first transform coefficient level flag is performed prior to the encoding of the parity level flag,
wherein based on the transform coefficient level of the quantized transform coefficient being 1, the parity level flag and the second transform coefficient level flag are not encoded, and
wherein the sum of the number of significant coefficient flags for the quantized transform coefficients within the current block, the number of first transform coefficient level flags, the number of parity level flags, and the number of second transform coefficient level flags, which are comprised in the residual information, is the threshold or less.
7. The method of claim 6 , wherein the predetermined threshold is determined based on the size of the current block.
8. The method of claim 6 , wherein the current block is a transform block.
9. The method of claim 6 , wherein when the sum of the number of significant coefficient flags, the number of first transform coefficient level flags, the number of parity level flags, and the number of second transform coefficient level flags, which are derived based on the 0th quantized transform coefficient to the nth quantized transform coefficient determined by a coefficient scanning order, reaches the threshold, an explicit signaling of the significant coefficient flag, the first transform coefficient level flag, the parity level flag, and the second transform coefficient level flag is omitted with respect to the (n+1)th quantized transform coefficient determined by the coefficient scanning order, and a value of the (n+1)th quantized transform coefficient is derived based on the value of the coefficient level information comprised in the residual information.
10. The method of claim 9 , wherein the significant coefficient flags, the first transform coefficient flags, the parity level flags, and the second transform coefficient level flags, which are comprised in the residual information, are encoded based on the context, and wherein the coefficient level information is encoded on a bypass basis.
11. A non-transitory computer readable storage medium storing a bitstream generated by a method, the method comprising:
deriving residual samples for a current block;
deriving quantized transform coefficients based on the residual samples for the current block; and
encoding residual information comprising information for the quantized transform coefficients to generate the bitstream,
wherein the residual information comprises a significant coefficient flag, a parity level flag, a first transform coefficient level flag, a second transform coefficient level flag, an abs remainder syntax element, and a sign flag for a quantized transform coefficient for the current block, wherein the significant coefficient flag is related to whether the quantized transform coefficient is a non-zero significant coefficient, the parity level flag for a parity of a transform coefficient level for the quantized transform coefficient, the first transform coefficient level flag about whether the transform coefficient level is larger than a first threshold, the second transform coefficient level flag is about whether the transform coefficient level is larger than a second threshold, the abs remainder syntax element is about a remaining value of the transform coefficient level, the sign flag is about a sign of the quantized transform coefficient,
wherein the first threshold is 1 and the second threshold is 3,
wherein the encoding of the residual information comprises,
determining a threshold related to a sum of a number of significant coefficient flags for the transform coefficients within the current block, a number of first transform coefficient level flags, a number of parity level flags, and a number of second transform coefficient level flags based on a size of the current block;
deriving a value of the significant coefficient flag, a value of the parity level flag, a value of the first transform coefficient level flag, a value of the second transform coefficient level flag, a value of the abs remainder syntax element, a value of the sign flag based on the quantized transform coefficient; and
encoding the significant coefficient flag, the first transform coefficient level flag, the parity level flag, the second transform coefficient level flag, the abs remainder syntax element, the sign flag, and
wherein the encoding of the first transform coefficient level flag is performed prior to the encoding of the parity level flag,
wherein based on the transform coefficient level of the quantized transform coefficient being 1, the parity level flag and the second transform coefficient level flag are not encoded, and
wherein the sum of the number of significant coefficient flags for the quantized transform coefficients within the current block, the number of first transform coefficient level flags, the number of parity level flags, and the number of second transform coefficient level flags, which are comprised in the residual information, is the threshold or less.