A non-transitory computer-readable medium comprising a computer program comprising instructions for implementing a method for encoding a sequence of images, when this program is executed by a processor of an encoding device, wherein the instructions comprise:
- instructions configured to cause the processor to receive at least one current image and at least one reference image and to generate a prediction of the at least one current image by forward motion compensation from the at least one reference image, the current image being divided into a plurality of blocks, wherein forward motion compensation uses motion vectors pointing from the reference image towards the at least one current image, and wherein the processor implements:
- for at least one block of said current image, called an overlapped current block, a sub-step of forward projection of at least two blocks of the reference image on said current image, delivering at least two projected blocks at least partially overlapping said overlapped current block, and two motion vectors, each motion vector representing shift of one of the projected blocks in the current image;
- partitioning said overlapped current block into a plurality of sub-blocks, wherein at least one of the sub-blocks is at least partially overlapped by at least one of said projected blocks, called an overlapped sub-block;
- and
- at least one iteration of the following steps for at least one overlapped sub-block:
- checking that the overlapped sub-block complies with a predetermined allotting criterion that is based on overlap of the at least one projected block with respect to the overlapped sub-block;
- if the overlapped sub-block complies with the predetermined allotting criterion, allotting, to said overlapped sub-block, one of the projected motion vectors selected from among the projected motion vector or vectors associated with the projected block or blocks at least partially overlapping said overlapped sub-block;
- and
- if the overlapped sub-block does not comply with the predetermined allotting criterion, and so long as a predetermined minimum size is not reached for said overlapped sub-block:
- partitioning said overlapped sub-block into a plurality of new sub-blocks, wherein at least one new sub-block, called a new overlapped sub-block, is at least partially overlapped by at least one of said projected blocks.