A non-transitory tangible computer-readable storage medium having stored thereon a program for an image data processing method of encoding or decoding image data in units of macroblocks through execution by arithmetic processing means, the program comprising the steps of:
- storing data in a main memory of storing data necessary for the encoding and decoding in a main memory;
- storing data in a cache memory of storing the data stored in the main memory in the cache memory;
- and
- wherein slices of the image data are sequentially and cyclically assigned to the plural arithmetic processing sections and plural slices are set as objects of processing, respectively, the plural arithmetic processing sections process the data held in the cache memory and simultaneously encode or decode the image data in parallel in a sequence of processing macroblocks of the plural slices as the objects of processing in the order of raster scan to establish a consistent relationship of the processing of each slice with processing of the immediately preceding slice, and the consistent relationship is a relationship in which the current slice and the immediately preceding slice is simultaneously processed in parallel and the macroblock in processing in the current slice has a number of reference macroblocks and is at the raster scan start end side by a predetermined number of macroblocks from the macroblock in processing in the immediately preceding slice so that a particular reference macroblock of the macroblock in processing in the current slice partly overlaps with a reference macroblock of the macroblock in processing in the immediately preceding slice.