Picture coding method and picture decoding method
The method includes the following units: a coefficient number detecting unit ( 109 ) for detecting the number of coefficients which has a value other than 0 for each block according to the generated coefficient, a coefficient number storing unit ( 110 ) for storing the number of coefficients detected, a coefficient number coding unit ( 111 ) for selecting a table for variable length coding based on the numbers of coefficients in the coded blocks located on the periphery of a current block to be coded with reference to the selected table for variable length coding so as to perform variable length coding for the number of coefficients.
1. A decoding apparatus for decoding a coded block image, the coded block image being obtained by coding transform coefficients included in a block which show spatial frequency components, the transform coefficients being generated by transforming the block image, the apparatus comprising:
a memory;
a reading unit operable to obtain a total number of non-zero coefficients included in an above block located above a current block to be decoded and a total number of non-zero coefficients included in a left block located to the left of the current block to be decoded, by referring to information, previously stored in the memory, representing the total number of non-zero coefficients included in the above block and information, previously stored in the memory, representing the total number of non-zero coefficients included in the left block, wherein each non-zero coefficient is a transform coefficient having a level value other than “0”;
a predictive value determining unit operable to determine a predictive value of a total number of non-zero coefficients included in the current block to be decoded based on the obtained total number of non-zero coefficients included in the above block and the obtained total number of non-zero coefficients included in the left block;
a code table selecting unit operable to select a variable length code table based on the determined predictive value of the total number of non-zero coefficients included in the current block;
a decoding unit operable to decode the coded block image by using the selected variable length code table, to obtain an actual value of the total number of non-zero coefficients included in the current block; and
a storing unit operable to store the actual value of the total number of non-zero coefficients included in the current block, as information representing the total number of non-zero coefficients, in the memory.
2. The decoding apparatus according to claim 1 , wherein said storing unit stores said information representing the total number of non-zero coefficients in the case that the current block is a bottom block of a macroblock.
3. The decoding apparatus according to claim 1 ,
wherein said storing unit stores said information representing the total number of non-zero coefficients included in the current block in the memory until said decoding unit decodes a total number of non-zero coefficients in a below block located below the current block and a right block located to the right of the current block.
4. The decoding apparatus according to claim 1 , wherein said code table selecting unit is operable to select, based on the determined predictive value, one of a plurality of predetermined variable length code tables.
5. A decoding apparatus for decoding a coded block image, the coded block image being obtained by coding transform coefficients included in a block which show spatial frequency components, the transform coefficients being generated by transforming the block image, the apparatus comprising:
a memory;
a reading unit operable to derive a total number of non-zero coefficients included in an above block from information, previously stored in the memory, representing a level value of a transform coefficient included in the above block and a total number of non-zero coefficients included in a left block from information, previously stored in the memory, representing a level value of a transform coefficient included in the left block, wherein the above block is a block located above the current block to be decoded, the left block is a block located to the left of the current block to be decoded, and each non-zero coefficient is a transform coefficient having a level value other than “0”;
a predictive value determining unit operable to determine a predictive value of a total number of non-zero coefficients included in the current block to be decoded based on the derived total number of non-zero coefficients included in the above block and the derived total number of non-zero coefficients included in the left block;
a code table selecting unit operable to select a variable length code table based on the determined predictive value of the total number of non-zero coefficients included in the current block;
a first decoding unit operable to decode the coded block image by using the selected variable length code table, to obtain an actual value of the total number of non-zero coefficients included in the current block;
a second decoding unit operable to decode the coded block image to obtain a decoded level value of a transform coefficient included in the current block; and
a storing unit operable to store the decoded level value, as information representing a level value of a transform coefficient included in the current block, in the memory.
6. The decoding apparatus according to claim 5 ,
wherein said storing unit stores said information representing a level value of a transform coefficient included in the current block in the memory until said first decoding unit decodes a total number of non-zero coefficient in a below block located below the current block and a right block located to the right of the current block.
7. A decoding method for decoding a coded block image, the coded block image being obtained by coding transform coefficients included in a block which show spatial frequency components, the transform coefficients being generated by transforming the block image, the method comprising:
obtaining a total number of non-zero coefficients included in an above block located above a current block to be decoded and a total number of non-zero coefficients included in a left block located to the left of the current block to be decoded, by referring to information previously stored in a memory representing the total number of non-zero coefficients included in the above block and information previously stored in the memory representing the total number of non-zero coefficients included in the left block, wherein each non-zero coefficient is a transform coefficient having a level value other than “0”;
determining a predictive value of a total number of non-zero coefficients included in the current block to be decoded based on the obtained total number of non-zero coefficients included in the above block and the obtained total number of non-zero coefficients included in the left block;
selecting a variable length code table based on the determined predictive value of the total number of non-zero coefficients included in the current block;
decoding the coded block image by using the selected variable length code table, to obtain an actual value of the total number of non-zero coefficients included in the current block; and
storing the actual value of the total number of non-zero coefficients included in the current block, as information representing the total number of non-zero coefficients, in the memory.
8. A decoding method for decoding a coded block image, the coded block image being obtained by coding transform coefficients included in a block which show spatial frequency components, the transform coefficients being generated by transforming the block image, the method comprising:
deriving a total number of non-zero coefficients included in an above block from information previously stored in a memory representing a level value of a transform coefficient included in the above block, and a total number of non-zero coefficients included in a left block from information previously stored in the memory representing a level value of a transform coefficient included in the left block, wherein the above block is a block located above a current block to be decoded, the left block is a block located to the left of the current block to be decoded, and each non-zero coefficient is a transform coefficient having a level value other than “0”;
determining a predictive value of a total number of non-zero coefficients included in the current block to be decoded based on the derived total number of non-zero coefficients included in the above block and the derived total number of non-zero coefficients included in the left block;
selecting a variable length code table based on the determined predictive value of the total number of non-zero coefficients included in the current block;
decoding the coded block image by using the selected variable length code table, to obtain an actual value of the total number of non-zero coefficients included in the current block;
decoding the coded block image to obtain a decoded level value of a transform coefficient included in the current block; and
storing the decoded level value, as information representing a level value of a transform coefficient included in the current block, in the memory.
9. A coding method for coding, on a block basis, a transform coefficient included in a block, the transform coefficient being obtained by transforming a block image, the method comprising:
deriving an actual value of a total number of non-zero coefficients included in a current block to be coded, wherein each non-zero coefficient is a transform coefficient having a level value other than “0”;
storing the actual value of the total number of non-zero coefficients included in the current block, as information representing the total number of non-zero coefficients, in a memory;
obtaining a total number of non-zero coefficients included in an above block located above the current block and a total number of non-zero coefficients included in a left block located to the left of the current block, by referring to information previously stored in the memory representing the total number of non-zero coefficients included in the above block and information previously stored in the memory representing the total number of non-zero coefficients included in the left block;
determining a predictive value of the total number of non-zero coefficients included in the current block to be coded based on the obtained total number of non-zero coefficients included in the above block and the obtained total number of non-zero coefficients included in the left block;
selecting a variable length code table based on the determined predictive value of the total number of non-zero coefficients included in the current block; and
coding the actual value of the total number of non-zero coefficients included in the current block by using the selected variable length code table.
10. The coding method according to claim 9 , wherein said storing stores said information representing the total number of non-zero coefficients in the case that the current block is a bottom block of a macroblock.
11. The coding method according to claim 9 , wherein said storing stores said information representing the total number of non-zero coefficients included in the current block in the memory until a total number of non-zero coefficients in a below block located below the current block and a right block located to the right of the current block is coded.
12. The coding method according to claim 9 , wherein said selecting a variable length code table comprises selecting, based on the determined predictive value, one a plurality of predetermined variable length code tables.
13. A coding method for coding, on a block basis, a transform coefficient included in a block, the transform coefficient being obtained by transforming a block image, the method comprising:
deriving an actual value of a total number of non-zero coefficients included in a current block to be coded, wherein each non-zero coefficient is a transform coefficient having a level value other than “0”;
storing a level value of a transform coefficient included in the current block, as information representing a level value of a transform coefficient included in the current block, in a memory;
deriving a total number of non-zero coefficients included in an above block from information, previously stored in the memory, representing a level value of a transform coefficient included in the above block and a total number of non-zero coefficients included in a left block from information, previously stored in the memory, representing a level value of a transform coefficient included in the left block, the above block being a block located above the current block and the left block being a block located to the left of the current block;
determining a predictive value of the total number of non-zero coefficients included in the current block to be coded based on the derived total number of non-zero coefficients included in the above block and the derived total number of non-zero coefficients included in the left block;
selecting a variable length code table based on the determined predictive value of the total number of non-zero coefficients included in the current block; and
coding the actual value of the total number of non-zero coefficients included in the current block by using the selected variable length code table.
14. The coding method according to claim 13 ,
wherein said storing stores said information representing a level value of a transform coefficient included in the current block in the memory until a total number of non-zero coefficients in a below block located below the current block and a right block located to the right of the current block is coded.
15. A coding apparatus for coding, on a block basis, a transform coefficient included in a block, the transform coefficient being obtained by transforming a block image, the apparatus comprising:
a memory;
a calculation unit operable to derive an actual value of a total number of non-zero coefficients included in a current block to be coded, wherein each non-zero coefficient is a transform coefficient having a level value other than “0”;
a storing unit operable to store the actual value of the total number of non-zero coefficients included in the current block, as information representing the total number of non-zero coefficients, in the memory;
a reading unit operable to obtain a total number of non-zero coefficients included in an above block located above the current block and a total number of non-zero coefficients included in a left block located to the left of the current block, by referring to information, previously stored in the memory, representing the total number of non-zero coefficients included in the above block and information, previously stored in the memory, representing the total number of non-zero coefficients included in the left block;
a predictive value determining unit operable to determine a predictive value of the total number of non-zero coefficients included in the current block to be coded based on the obtained total number of non-zero coefficients included in the above block and the obtained total number of non-zero coefficients included in the left block;
a code table selecting unit operable to select a variable length code table based on the determined predictive value of the total number of non-zero coefficients included in the current block; and
a coding unit operable to code the actual value of the total number of non-zero coefficients included in the current block by using the selected variable length code table.
16. A coding apparatus for coding, on a block basis, a transform coefficient included in a block, the transform coefficient being obtained by transforming a block image, the apparatus comprising:
a memory;
a calculating unit operable to derive an actual value of a total number of non-zero coefficients included in a current block to be coded, wherein each non-zero coefficient is a transform coefficient having a level value other than “0”;
a storing unit operable to store a level value of a transform coefficient as information representing a level value of a transform coefficient included in the current block in the memory;
a reading unit operable to derive a total number of non-zero coefficients included in an above block from information, previously stored in the memory, representing a level value of a transform coefficient included in the above block and a total number of non-zero coefficients included in a left block from information, previously stored in the memory, representing a level value of a transform coefficient included in the left block, the above block being a block located above the current block and the left block being a block located to the left of the current block;
a predictive value determining unit operable to determine a predictive value of the total number of non-zero coefficients included in the current block to be coded based on the derived total number of non-zero coefficients included in the above block and the derived total number of non-zero coefficients included in the left block;
a code table selecting unit operable to select a variable length code table based on the determined predictive value of the total number of non-zero coefficients included in the current block; and
a coding unit operable to code the actual value of the total number of non-zero coefficients included in the current block by using the selected variable length code table.