Patent ID: 8107529

Claim:
A coding device that makes a GOP setting to input image data, and applies a coding process to the input image data on a macroblock basis successively by intra and inter prediction to output coded data, the device comprising: an orthogonal transform section configured to apply an orthogonal transform process to prediction error data of the input image data through the intra and inter prediction to generate coefficient data; a quantization section configured to apply a quantization process to the coefficient data to generate quantized data; a coding section configured to apply the coding process to the quantized data to generate the coded data; and a rate control section configured to exercise rate control over the coded data through control over a quantization scale of the quantization section using the coded data, the rate control section including: an activity detection section configured to detect an activity indicating a smoothness of the input image data; and a prediction residual detection section configured to detect a prediction residual with the inter prediction of the input image data; the rate control section calculating: in pictures configuring a GOP, a target code amount of any picture that has not yet been subjected to the coding process, and another target code amount for a macroblock of any of the pictures relating to the coding process from the target code amount of the picture not yet subjected to the coding process, and the quantization scale of the quantization section in which a generated code amount serves as the target code amount; and the rate control section correcting the calculated quantization scale based on the activity and the prediction residual for improving image quality, wherein the correcting includes: normalizing the activity detected in the activity detection section, and calculating a normalized activity; correcting the calculated quantization scale using the normalized activity, and calculating a first corrected quantization scale as a result of the correction using the normalized activity; normalizing the detected prediction residual, and calculating a normalized prediction residual; correcting the calculated quantization scale using the normalized prediction residual, and calculating a second corrected quantization scale as a result of the correction using the normalized prediction residual; and combining the first, corrected quantization scale and the second corrected quantization scale.