Image decoding method and device
An image decoding method performed by a decoding device according to the present disclosure comprises the steps of: deriving a predicted number of signs of a current block; performing sign prediction of the current block to derive as many signs of residual coefficients as the predicted number of signs; deriving residual samples of the current block on the basis of the signs; and generating a reconstructed picture on the basis of the residual samples.
1 . A method for an image decoding, the method performed by a decoding apparatus and comprising:
deriving a number of prediction signs of a current block;
deriving signs of residual coefficients for the number of prediction signs by performing a sign prediction on the current block;
deriving residual samples of the current block based on the signs; and
generating a reconstructed picture based on the residual samples,
wherein the number of prediction signs is derived based on information on a position of a last effective coefficient of the current block.
2 . The method of claim 1 , wherein the number of prediction signs is derived based on information for whether the last effective coefficient of the current block is located in a specific area of the current block.
3 . The method of claim 2 , wherein the specific area is an effective sign prediction area of the current block.
4 . The method of claim 1 , wherein the number of prediction signs is derived based on information for whether a position index of the last effective coefficient of the current block is less than a certain threshold.
5 . The method of claim 1 , the method further comprising:
obtaining information on a sign prediction number through a bitstream,
wherein the number of prediction signs is derived based on the information on the sign prediction number.
6 . The method of claim 5 , wherein the information on the sign prediction number includes information representing a sign prediction number for a transform block of an intra slice and information representing a sign prediction number for a transform block of an inter slice,
wherein the information on the sign prediction number is signaled as a Sequence Parameter Set (SPS).
7 . The method of claim 6 , the method further comprising:
acquiring a sign prediction enabled flag representing whether the sign prediction is available through the bitstream,
wherein the information on the sign prediction number is signaled based on the sign prediction enabled flag representing that the sign prediction is available.
8 . The method of claim 5 , wherein the information on the sign prediction number includes information representing a sign prediction number for a luma block and information representing a sign prediction number for a chroma block,
wherein the information on the sign prediction number is signaled as a Sequence Parameter Set (SPS).
9 . The method of claim 5 , wherein the information on the sign prediction number is signaled through a slice header,
wherein the information on the sign prediction number represents a sign prediction number for a transform block within a slice.
10 . The method of claim 5 , wherein the information on the sign prediction number is signaled through a slice header,
wherein the information on the sign prediction number includes information representing a sign prediction number for a luma block within a slice and information representing a sign prediction number for a chroma block within the slice.
11 . The method of claim 5 , the method further comprising:
obtaining information on a sign prediction area through the bitstream,
wherein the information on the sign prediction area and the information on the sign prediction number are signaled through a slice header,
wherein the information on the sign prediction area represents the sign prediction area for a transform block within a slice, and
wherein the information on the sign prediction number represents a sign prediction number for the transform block.
12 . The method of claim 9 , wherein the information on the sign prediction number is signaled based on a value of information on a sign prediction area.
13 . A method for an image encoding, the method performed by an encoding apparatus and comprising:
deriving a number of prediction signs of a current block;
deriving signs of residual coefficients for the number of prediction signs by performing a sign prediction on the current block;
deriving residual samples of the current block based on the signs; and
encoding image information including residual information of the current block and information on the number of prediction signs,
wherein the number of prediction signs is derived based on information on a position of a last effective coefficient of the current block.
14 . A method for transmitting data for an image, the method comprising:
obtaining a bitstream of image information including information on a number of prediction sign and residual information of a current block; and
transmitting data including the bitstream of the image information including the information on the number of prediction sign and the residual information,
wherein the number of prediction signs is derived based on information on a position of a last effective coefficient of the current block.