PURPOSE: To perform the encoding of image data and the restoring from code data to image data with the circuit smaller than the conventional one and at the speed faster than the conventional one in an image data encoder and an image data restoring device.
CONSTITUTION: A comparing part 104 performs the size comparison with a category SSSS' of a two-dimensional DCT coefficient to input from a first category counting part 103 and a value N of the index part of a corresponding quantizing threshold 2N to input from an M transmitter 111 and discriminates whether or not SSSS'>N is obtained. At the time of the SSSS'>N, a category counting part 112 counts a category SSSS(=SSSS'-N) of the quantizing coefficient, and a position information counting part 113 shifts (removes) the lower order N bit of the position information (binary value) in the category of the above-mentioned two-dimensional DCT coefficient and thus, counts the position information (binary value) in the category of the quantizing coefficient.
NODA TSUGUO