An optimal scanning method for coding/decoding an image signal is
provided. In a method of coding an image signal through a discrete cosine
transform, at least one is selected among a plurality of reference
blocks. A scanning order in which to scan blocks to be coded of the
reference blocks is generated and the blocks to be coded are scanned in
the order of the generated scanning order. The at least one selected
reference block is temporally or spatially adjacent to the block to be
coded. When the blocks to be coded are scanned, probabilities that
non-zero coefficients occur are obtained from the at least one selected
reference block, and the scanning order is determined in descending order
starting from the highest probability. Here, the scanning order is
generated to be a zigzag scanning order if the probabilities are
identical. The optimal scanning method increases signal compression
efficiency.