The intra-predicting section 41 performs an intra-prediction (an in-screen prediction), for generating a predicted image using pixel values in the screen. The intra-predicting section 41 generates predicted image data in each of all intra-prediction modes, using the decoded image data generated by the operator 33 and stored as reference image data in the frame memory 37. Moreover, the intra-predicting section 41 calculates the cost of each intra-prediction mode (e.g., a rate distortion cost) using the original image data supplied from the screen rearranging buffer 21 and the predicted image data, and selects an optimum mode in which the calculated cost is minimum. After having selected an optimum intra-prediction mode, the intra-predicting section 41 outputs the predicted image data in the selected intra-prediction mode, a parameter such as intra-prediction mode information, etc. representing the selected intra-prediction mode, the cost, etc. to the prediction selector 43.
The motion predicting and compensating section 42 performs a motion prediction on an image to be inter-coded using the original image data supplied from the screen rearranging buffer 21 and the decoded image data filtered and stored as reference image data in the frame memory 37. Moreover, the motion predicting and compensating section 42 performs a motion compensation process depending on a motion vector detected by the motion prediction, generating predicted image data.