1. A method of coding a block of pixels, comprising: obtaining a block of pixels, wherein the block of pixels includes integer pixel values corresponding to integer pixel positions within the block of pixels; applying a first filtering operation to a group of integer pixel values to generate a first intermediate pixel value; adding a first offset to the first intermediate pixel value to generate a second intermediate pixel value, wherein adding the first offset causes the second intermediate value to have a smaller bitdepth than the first intermediate pixel value; storing the second intermediate pixel value; retrieving the second intermediate pixel value; adding a second offset to the retrieved second intermediate value; applying a second filtering operation to a group of intermediate pixel values comprising the retrieved second intermediate pixel value with the added second offset to compute a first pixel value for a sub-pixel location; generating a prediction block based on at least the first pixel value for the sub-pixel location.