In image data coding and decoding processing, in order to improve
efficiency by processing a plurality of factors in one cycle as long as
possible, the factors are rearranged, in coding or decoding processing,
in a predetermined scan sequence such that significant factors and 0s are
paired. In addition, an appropriate scan sequence is selected in
accordance with the distribution state of frequencies to further improve
the efficiency.