To perform encoding that is not affected by constraints such as the processing time of a device, a memory and arithmetic cost as much as possible in situations in which image data is decomposed into frequency components, each of the frequency components is quantized, and encoded data obtained by applying prescribed entropy encoding to quantized data is decoded.
First, image encoded data are inputted to an image processor 1, and transformation coefficients of sub-bands are obtained. Next, a code string is generated by performing Golomb encoding of the transformation coefficients needed to decode from the front of an image by one line at a time with one line of the sub-band as a unit, and the code string is outputted to an image output device 2. The output device 2 decodes Golomb encoded data, performs coefficient inverse quantization and inverse discrete wavelet transformation, restores the image and outputs the image.