The invention provides a
video encoding and decoding method and a related device. The
video encoding and decoding method comprises: receiving input data related to a current block in a current picture, the input data comprising residual data of the current block for encoding at an
encoder end or transform coefficients of the current block for decoding at a decoder end, the prediction data of the current block is generated by applying intra block
copying or intra
template matching prediction; applying a target transform pattern to the current block to derive a final transform coefficient at the
encoder side or to derive reconstructed residual data at the decoder side, where the target transform pattern includes a sub-
block transform or a partial transform, and wherein the sub-
block transform divides the current block into a plurality of sub-blocks and applies transform
processing to one or more sub-blocks that are target portions of the current block, or the partial transform applies transform
processing only to the target portions of the current block; and providing the final transform coefficient at the
encoder side or the reconstructed residual data at the decoder side. According to the video coding and decoding method and the related device, the coding and decoding efficiency can be improved.