Patent ID: 7308149

Claim:
A decoding method for decoding coded data 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 decoded based on a total number of non-zero coefficients included in a decoded block located above the current block and a total number of non-zero coefficients included in a decoded 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 decoding the coded data obtained by 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 decoded block located to the left of the current block when a decoded block is found to the left of but not above the current block, and the predictive value is determined based on the total number of non-zero coefficients included in the decoded block located above the current block when a decoded block is found above but not to the left of the current block.