Patent ID: 6931069

Claim:
A coding device comprising: a coder for coding an external input signal in a macroblock unit; a first storing unit for storing a code output from said coder; a second storing unit for storing an output from said first storing unit; and a code volume controller for controlling the transfer amount of said code stored in said first storing unit to said second storing unit based on a code volume of said code obtained by said coder such that a length of a video packet constituted by said code is predetermined length or less; wherein the code volume controller calculates a present code volume (Sc) for each video object (VOP) and decides whether a stuffing is to be inserted into said video packet or a new video packet constituted, based on a relationship between the present code volume (Sc) and a minimum code volume (Tmin); wherein, if decided, said code volume controller controls storage of a stuffing of a video packet in said second storing unit based on said minimum code volume obtained for each VOP unit image constituted by a video packet which is required for coding said unit image, such that said second storing unit does not cause an underflow.