Patent ID: 8081679

Claim:
An image processing apparatus comprising: a quantizing unit configured to quantize an input moving image signal using a set quantization scale; a coding unit configured to perform variable length coding on an output of the quantizing unit; an activity detecting unit configured to detect an activity of the input moving image signal; a weighting determining unit configured to determine, based on the activity detected by the activity detecting unit, a weighting coefficient for determining an effect of the activity and variable range thereof with respect to each macroblock which is a unit for coding the input moving image signal; a quantization-scale determining unit configured to determine the quantization scale with respect to each macroblock on basis of an amount of variable length codes output from the coding unit; a filling level detecting unit configured to detect, on basis of the amount of variable length codes output from the coding unit, whether a filling level of codes in a virtual buffer in a decoder which decodes the coded moving image signal falls below a predetermined threshold value, and to set a control parameter to change the weighting coefficient with respect to each macroblock determined by the weighting determining unit; and a changing unit configured to change the weighting coefficient with respect to each macroblock based on the control parameter, and to change the quantization scale with respect to each macroblock determined by the quantization-scale determining unit in accordance with the changed weighting coefficient, wherein, when the filling level falls below the predetermined threshold value, the filling level detecting unit sets the control parameter so as to decrease an effect of the weighting coefficient for the quantization scale by narrowing the variable range of the weighting coefficient, and when the filling level does not fall below the predetermined threshold value, the filling level detecting unit sets the control parameter so as to keep an effect of the weighting coefficient for the quantization scale by keeping the variable range of the weighting coefficient.