Image decoding method and device using residual information in image coding system
An image decoding method includes receiving residual information including first size related information for a first residual coefficient and second size related information for a second residual coefficient, setting a Rice parameter of the first size related information and the second size related information as a specific value, deriving available binary values based on the Rice parameter, deriving binary values of the first size related information and the second size related information by decoding the first size related information and the second size related information, deriving values of the first size related information and the second size related information by comparing the binary values and the available binary values, deriving the first residual coefficient and the second residual coefficient based on the values, and reconstructing a current picture based on the first residual coefficient and the second residual coefficient.
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:
obtain image information including a transform skip flag, prediction information and residual information for a current block, wherein the transform skip flag is a flag for whether transform is applied to the current block and the residual information includes size related information for a residual coefficient of the current block;
derive a prediction sample of the current block based on the prediction information;
set a Rice parameter of the size related information to a specific value based on the transform skip flag;
derive available binary values for the size related information based on the Rice parameter;
derive a binary value of the size related information by decoding the size related information;
derive a value of the size related information by comparing the binary value and the available binary values;
derive the residual coefficient based on the value of the size related information;
derive a residual sample of the current block based on the residual coefficient; and
generate a reconstructed picture based on the prediction sample and the residual sample.
2. The decoding apparatus of claim 1 , wherein based on a value of the transform skip flag being 1, the Rice parameter of the size related information is set equal to 1.
3. The decoding apparatus of claim 1 , wherein the Rice parameter is set based on a size of the current block.
4. The decoding apparatus of claim 3 , wherein based on the size of the current block being less than a specific size, the Rice parameter is set to 0, and
wherein based on the size of the current block being greater than or equal to the specific size, the Rice parameter is set to 1.
5. The decoding apparatus of claim 3 , wherein based on a sample number of the current block being less than 256, the Rice parameter is set to 1, and
wherein based on the sample number of the current block being greater than or equal to 256, the Rice parameter is set to 2.
6. The decoding apparatus of claim 1 , wherein the Rice parameter is set based on a ratio between a width and a height of the current block.
7. The decoding apparatus of claim 6 , wherein based on the ratio between the width and the height of the current block being greater than 2 and less than ½, the Rice parameter is set to 0, and
wherein based on the ratio between the width and the height of the current block being ½ or more and 2 or less, the Rice parameter is set to 1.
8. 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 transform skip flag for a current block, wherein the transform skip flag is a flag for whether transform is applied to the current block;
derive a prediction sample of the current block;
derive prediction information for the prediction sample;
derive a residual coefficient of the current block;
set a Rice parameter for the residual coefficient to a specific value based on the transform skip flag;
derive a binary value for size related information for the residual coefficient based on the Rice parameter; and
derive residual information including the size related information by encoding the binary value for the size related information; and
generate a bitstream including the transform skip flag, the prediction information and the residual information.
9. The encoding apparatus of claim 8 , wherein based on a value of the transform skip flag being 1, the Rice parameter of the size related is set equal to 1.
10. An apparatus for transmitting data for an image, the apparatus comprising:
at least one processor configured to obtain the bitstream of the image information including residual information, wherein the bitstream is generated by deriving a transform skip flag for a current block, wherein the transform skip flag is a flag for whether transform is applied to the current block, deriving a prediction sample of the current block, deriving prediction information for the prediction sample, deriving a residual coefficient of the current block, setting a Rice parameter for the residual coefficient to a specific value based on the transform skip flag, deriving a binary value for size related information for the residual coefficient based on the Rice parameter, deriving residual information including the size related information by encoding the binary value for the size related information and generating the bitstream including the transform skip flag, the prediction information and the residual information; and
a transmitter configured to transmit the data comprising the bitstream of the image information including the residual information.