Patent ID: 7555041

Claim:
A processing apparatus for controlling a code quantity comprising: a decoding unit that decodes information in accordance with a predetermined format, and outputs decoded compressed information and extracts information for carrying out encoding processing from said compressed information, wherein the compressed information is encoded using an external encoding process based on discrete cosine transformation and motion compensation, and includes at least an intraframe encoded picture, an interframe forward directional prediction encoded picture and a bi-directional prediction encoded picture; an encoding unit for encoding decoded information from said decoding unit; a code quantity control unit for controlling code quantity of said encoded information based on said extracted information; a virtual buffer for storing and updating occupation sizes of said intraframe, interframe forward directional prediction and bi-directional prediction encoded pictures determined based on information extracted from said compressed information; wherein said occupation sizes d j i , -d j p and d j b of said virtual buffer for said intraframe, interframe forward directional prediction and bi-directional prediction encoded pictures in said compressed information respectively are updated in accordance with the following equations: d j i = d o i + B j - 1 - ∑ k = 0 j - 1 ⁢ X i , k X i , total × T i d j p = d o p + B j - 1 - ∑ k = 0 j - 1 ⁢ X p , k X p , total × T p d j b = d o b + B j - 1 - ∑ k = 0 j - 1 ⁢ X b , k X b , total × T b where: notations d o i , -d o p and d o b denote initial occupation sizes of said virtual buffer for said intraframe, interframe forward directional prediction and bi-directional prediction encoded pictures respectively; notations and X i,k , X p,k and X b,k denote activities for macroblocks included in said intraframe, interframe forward directional prediction and bi-directional prediction encoded pictures respectively; notations X i,total , X p,total and X b,total denote total activities for all macroblocks included in one frame of said compressed information for said intraframe, interframe forward directional prediction and bi-directional prediction encoded pictures respectively; notations T i , T p and T b denote target code quantities per frame for said intraframe, interframe forward directional prediction and bi-directional prediction encoded pictures respectively; and notation B j denotes a quantity of code generated in the jth macroblock in a frame seen with a first macroblock in said frame regarded as a 0th macroblock.