A moving image coding apparatus provided with encoding means for encoding a moving image using intra coding or inter coding for each macro block which is a part of a present image, wherein, in intra coding, image data are orthogonal-transformed, then image data after the orthogonal-transformation are quantized and variable-length coded, and wherein, in inter coding, a motion vector of the present image relative to a reference image is detected, motion compensation for the reference image using the motion vector is performed, differential data between the present image and the reference image after the motion compensation are orthogonal-transformed, then differential data after the orthogonal transformation are quantized and variable-length coded, and
- a reference image memory for storing, for purpose of the inter coding, a reference image of image frame next to the present image generated by reverse-quantizing and reverse-orthogonal-transforming image data after the quantization or differential data after the quantization, comprising:
- setting means for setting a maximum number of macro books that are inter-coded being a value smaller than the number of macro blocks configuring an image frame so as to reduce the capacity of a reference image memory;
- and
- determining means for determining position of a macro block which is intra-coded or inter-coded so as that the number of macro blocks which are inter-coded are within a range of the maximum number of macro blocks inter-coded in one image frame when an image which corresponds to Mth frame, wherein M≦N−1, prior to a present image which corresponds to Nth frame is coded,
- wherein the capacity of the reference image memory is smaller than a size of the number of macro blocks configuring an image frame.