1. A method for encoding a digital image in a block-based manner into an encoded bitstream, the method comprising: performing by an encoder a prediction for a block to be coded with respect to a reference block, wherein displacement between the block to be coded and the reference block is represented by a horizontal displacement and a vertical displacement; defining by said encoder an ordered list of each possible horizontal and vertical displacements in a rank order; and providing by said encoder a signal, in the encoded bitsream, representative of the rank of the horizontal displacement and the vertical displacement in the ordered list.