| CPC H04N 19/13 (2014.11) [H04N 19/176 (2014.11); H04N 19/46 (2014.11); H04N 19/1887 (2014.11)] | 2 Claims |

|
1. An encoding method, comprising:
in prediction residual coding of a current block,
encoding a plurality of flags by Context-Based Adaptive Binary Arithmetic Coding (CABAC), each of the plurality of flags relating to a coefficient included in the current block;
determining a base level;
calculating a prediction absolute value of the coefficient based on a sum of absolute values of five neighboring coefficients in the current block;
deriving a rice parameter based on a difference between the prediction absolute value and the base level, wherein
if the difference is below a first value, the rice parameter is set to zero, and
if the difference is equal to or larger than the first value and smaller than a second value, the rice parameter is set to one;
encoding a remainder value of the coefficient using the derived rice parameter, wherein the remainder value is obtained by using an absolute value of the coefficient and the base level; and
encoding a sign flag indicating whether the coefficient has a positive value or a negative value if the absolute value of the coefficient is more than zero.
|