Patent ID: 9319682
Filing Date: 2016-04-19
CPC Classification: H04N

Claim Text:
1. A moving image encoding apparatus comprising an encoding unit configured to encode moving image data in unit of a group of pictures including a predetermined number of frames and generate an encoded stream; a holding unit configured to hold the encoded stream generated by the encoding unit, a write unit configured to write, in response to a recording start instruction, the encoded stream held by the holding unit in a recording medium and to combine the written encoded stream with an encoded stream which has already been written in the recording medium, wherein the holding unit holds, while the writing unit stops writing the encoded stream in the recording medium, the encoded stream of a predetermined number of the groups of pictures corresponding to a predetermined period, and the write unit starts recording, in response to the recording start instruction, the encoded stream from the group of pictures the predetermined numbers before the recording start instruction; a calculation unit configured to calculate an expected occupation amount of a virtual buffer when a picture contained in the encoded stream generated by the encoding unit is held for decoding processing; and a code amount control unit configured to control a generated code amount in said encoding unit based on information of the occupation amount, wherein said calculation unit sets a plurality of virtual buffers, each of which starts from each of the predetermined number of groups of pictures held in the holding unit and has an initial value equal to a virtual buffer occupation amount at an end of the encoded stream which has been written in the recording medium, and updates the occupation amount of the virtual buffer corresponding to each of the predetermined number of the groups of pictures based on a size of the picture contained in the encoded stream, and wherein the code amount control unit compares the generated code amount with a smallest occupation amount among the plurality of occupation amounts, which is calculated by the calculation unit, corresponding to the same picture in each of the plurality of virtual buffers starting from each of the predetermined number of the groups of pictures, and controls the generated code amount not to exceed the smallest occupation amount.