| CPC H04N 19/132 (2014.11) [H04N 19/12 (2014.11); H04N 19/159 (2014.11); H04N 19/176 (2014.11); H04N 19/70 (2014.11)] | 14 Claims | 

| 
               1. An image 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 prediction mode information and residual information through a bitstream; 
                derive a prediction mode of a current block based on the prediction mode information; 
                derive a prediction sample based on the prediction mode; 
                derive a current residual coefficient based on residual syntax elements for the current residual coefficient in the current block; 
                derive a residual sample based on the current residual coefficient; and 
                derive a reconstructed sample of the current block based on the residual sample and the prediction sample, 
                wherein the residual information includes the residual syntax elements for the current residual coefficient, 
                wherein a number of context coded residual syntax elements for residual coefficients prior to the current residual coefficient among residual coefficients of the current block is equal to a maximum number of context coded bins of the current block, 
                wherein the residual syntax elements for the current residual coefficient include coefficient level information for the current residual coefficient and a sign flag of the current residual coefficient, 
                wherein an absolute level of the current residual coefficient is derived as a value indicated by the coefficient level information for the current residual coefficient, and a sign of the current residual coefficient is derived as a sign indicated by the sign flag, 
                wherein the current residual coefficient is derived without performing level mapping, 
                wherein the residual coefficients prior to the current residual coefficient are derived by performing the level mapping, and 
                wherein the level mapping for a target residual coefficient comprises 
                deriving a maximum value among an absolute level of a left residual coefficient of the target residual coefficient and an absolute level of a top residual coefficient of the target residual coefficient; 
                comparing an absolute level of the target residual coefficient with the maximum value; and 
                deriving a modified absolute level of the target residual coefficient based on the comparison. 
               |