A non-transitory computer-readable medium comprising a computer program stored thereon comprising instructions for implementing a method for encoding a digital image to be decoded by a decoding device, when executed by a processor of an encoding device, said image being divided into a plurality of blocks of pixels processed in a defined order, said method comprising the following acts, implemented for a current block, with preset size:
- predicting values of the current block from at least one block previously processed in a mode of prediction selected from a plurality of preset modes,
- calculating a residual block by subtracting the predicted values from the original values of the current block,
- obtaining a residual block transformed by applying a transform to pixels of the residual block, said transformed residual block comprising coefficients, the transform being part of a preset list of transforms;
- encoding the transformed residual block;
- calculating a value of at least one characteristic representative of at least one transformed residual coefficient of the current block;
- determining an initial identification data representative of a sub-list of at least one transform associated with said calculated value of the at least one characteristic, wherein knowledge of said sub-list is shared with the decoding device;
- and
- in response to the transform applied to the current block being part of the sub-list identified by the initial data, but not directly obtainable from said sub-list by the decoding device, encoding data complementary to the initial identification data allowing to identify said applied transform in the sub-list.