Patent ID: 8265403

Claim:
A decoding method for decoding coded data on a block basis, the method comprising: determining whether a first decoded block located above a target block and a second decoded block located to the left of the target block are located outside a slice including the target block; predicting a predictive value for a total number of non-zero coefficients included in the target block to be decoded based on a total number of non-zero coefficients included in the first decoded block and a total number of non-zero coefficients included in the second decoded block when both the first decoded block and the second decoded block are inside said slice, and predicting the predictive value based on the total number of non-zero coefficients included in one of the first decoded block and the second decoded block when the other of the first decoded block and the second decoded block is outside said slice, 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 predictive value; and decoding the coded data by using the selected variable length code table to obtain an actual value of a total number of non-zero coefficients included in the target block.