Patent ID: 8526748

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 inside or outside of a slice that includes 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 mean value of 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 the first decoded block and the second decoded block are inside the slice including the target block, and predicting a predictive value for a total number of non-zero coefficients included in the target block to be decoded to be a value of “0” when the first decoded block and the second decoded block are outside the slice including the target 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 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.