A method for generating and using an alternate reference frame, ARF, comprising: selecting an anchor frame and video frames (1006, 1008) from a source input video stream, wherein the anchor frame comprises an anchor block, and the anchor block comprises anchor pixels; identifying, for the anchor block of the anchor frame, respective reference blocks (1012, 1014) in the video frames; for each anchor pixel of a plurality of the anchor pixels of the anchor block: determining, for the anchor pixel and using an anchor patch, respective distances between the anchor pixel and respective co-located reference pixels (1020, 1022) of the respective reference blocks (1012, 1014), wherein: the anchor patch comprises a set of pixels in the anchor frame in a neighbourhood of the anchor pixel, and a respective distance, of the respective distances, between the anchor pixel and a respective co-located reference pixel in the respective reference block is determined using a distance between the anchor patch and a co-located patch around the respective co-located reference pixel in the respective video frame, wherein the distance between the anchor patch and the co-located patch is determined using distances between each of the anchor patch pixels and a corresponding reference pixel of the co-located patch; determining, using the respective distances, respective weights; and determining, using the respective weights, the anchor pixel and the respective co-located reference pixels of the respective reference blocks, an ARF pixel within the ARF that is co-located with the anchor pixel; and encoding, in a compressed bitstream, the ARF. selecting an anchor frame and video frames (1006, 1008) from a source input video stream, wherein the anchor frame comprises an anchor block, and the anchor block comprises anchor pixels; the anchor frame comprises an anchor block, and the anchor block comprises anchor pixels; identifying, for the anchor block of the anchor frame, respective reference blocks (1012, 1014) in the video frames; for each anchor pixel of a plurality of the anchor pixels of the anchor block: determining, for the anchor pixel and using an anchor patch, respective distances between the anchor pixel and respective co-located reference pixels (1020, 1022) of the respective reference blocks (1012, 1014), wherein: the anchor patch comprises a set of pixels in the anchor frame in a neighbourhood of the anchor pixel, and a respective distance, of the respective distances, between the anchor pixel and a respective co-located reference pixel in the respective reference block is determined using a distance between the anchor patch and a co-located patch around the respective co-located reference pixel in the respective video frame, wherein the distance between the anchor patch and the co-located patch is determined using distances between each of the anchor patch pixels and a corresponding reference pixel of the co-located patch; determining, using the respective distances, respective weights; and determining, using the respective weights, the anchor pixel and the respective co-located reference pixels of the respective reference blocks, an ARF pixel within the ARF that is co-located with the anchor pixel; and encoding, in a compressed bitstream, the ARF. determining, for the anchor pixel and using an anchor patch, respective distances between the anchor pixel and respective co-located reference pixels (1020, 1022) of the respective reference blocks (1012, 1014), wherein: the anchor patch comprises a set of pixels in the anchor frame in a neighbourhood of the anchor pixel, and a respective distance, of the respective distances, between the anchor pixel and a respective co-located reference pixel in the respective reference block is determined using a distance between the anchor patch and a co-located patch around the respective co-located reference pixel in the respective video frame, wherein the distance between the anchor patch and the co-located patch is determined using distances between each of the anchor patch pixels and a corresponding reference pixel of the co-located patch; the anchor patch comprises a set of pixels in the anchor frame in a neighbourhood of the anchor pixel, and a respective distance, of the respective distances, between the anchor pixel and a respective co-located reference pixel in the respective reference block is determined using a distance between the anchor patch and a co-located patch around the respective co-located reference pixel in the respective video frame, wherein the distance between the anchor patch and the co-located patch is determined using distances between each of the anchor patch pixels and a corresponding reference pixel of the co-located patch; determining, using the respective distances, respective weights; and determining, using the respective weights, the anchor pixel and the respective co-located reference pixels of the respective reference blocks, an ARF pixel within the ARF that is co-located with the anchor pixel; and encoding, in a compressed bitstream, the ARF.