Patent ID: 7697770

Claim:
A coding method for coding an image on a block basis, the method comprising: determining a predictive value for a total number of non-zero coefficients included in a current block to be coded based on a total number of non-zero coefficients included in a coded block located above the current block and a total number of non-zero coefficients included in a coded block located to the left of the current block, wherein each non-zero coefficient is a transform coefficient having a level value other than “0”; selecting a variable length code table based on the determined predictive value; and coding the total number of non-zero coefficients included in the current block by using the selected variable length code table, wherein the predictive value is determined based on the total number of non-zero coefficients included in the coded block located to the left of the current block when an upper boundary of the current block is a boundary of a slice which is one of a plurality of sections into which the picture is divided, and a left boundary of the current block is not the boundary of the slice, and the predictive value is determined based on the total number of non-zero coefficients included in the coded block located above the current block when a left boundary of the current block is a boundary of a slice which is one of a plurality of sections into which the picture is divided, and an upper boundary of the current block is not the boundary of the slice.