主权项 |
1. A moving image encoding apparatus that encodes moving images, comprising:
a dividing unit which divides a moving image that is made up of pictures arranged along a temporal axis into scenes, where each of the scenes is made up of a preset number of pictures; an encoding unit which encodes an inputted picture block by block, the block being configured of a plurality of pixels, according to a given quantization scale so as to generate encoded data; an encoded data amount calculation unit which calculates an encoded data amount of a picture generated by the encoding unit as well as a total encoded data amount of a scene; a distortion calculation unit which decodes the encoded data generated by the encoding unit, and calculate a distortion amount, at the boundary positions of the blocks, between a decoded picture and a picture before being encoded as a picture distortion amount as well as an average of picture distortion amounts of pictures that constitutes a scene; a surplus encoded data amount calculation unit which calculates a surplus encoded data amount with respect to an encoded data amount equally allocated to each scene from the encoded data amount of each picture calculated by the encoded data amount calculation unit; a scene target encoded data amount calculation unit which calculates an initial target encoded data amount for a subsequent scene based on the average calculated by said distortion calculation unit and the surplus encoded data amount calculated by the surplus encoded data amount calculation unit; a picture target encoded data amount calculation unit which, if a picture of interest is first in a scene of interest, compares the picture distortion of the picture of interest calculated by said distortion calculation unit with a predetermined threshold range, and calculates a target encoded data amount for subsequent pictures in the scene of interest by adjusting, according to the comparison result and the surplus encoded data amount calculated by the surplus encoded data amount calculation unit, the initial target encoded data amount of the scene of interest; and a quantization scale determination unit which determines a quantization scale to be set to said encoding unit for encoding a subsequent picture, based on the target encoded data amount calculated by said picture target encoded data amount calculation unit. |