1. A computerized method to encode image data comprising: determining a motion vector for each block of pixels in a target frame of image data having multiple blocks, wherein each pixel is associated with a value for the motion vector of the corresponding block; grouping each pixel in the target frame into a plurality of groups based on the value of the associated motion vector, wherein one group of pixels contains disconnected pixels that are from different blocks having similar motion vector values; assigning each group of pixels to a one of a plurality of different motion classes; assigning a filter to each motion class, wherein coefficients of the filter are trained using pixels from the motion class to which the filter is assigned, wherein a first filter assigned to a first motion class has a first filter shape and a second filter assigned to a second motion class has a second filter shape, and wherein the first filter shape is different than the second filter shape; generating an initial set of coefficients for each filter using the group of pixels assigned to the motion class to which a filter is assigned; predicting, by a computer, values for the group of pixels assigned to each motion class using the filter assigned to the motion class and a reference frame; calculating prediction error values for the predicted values, wherein the filter, motion vectors and prediction error values represent the group of pixels in the encoded image data; identifying each pixel in each motion class having a corresponding prediction error value that exceeds a prediction error value threshold; and generating at least one subsequent set of coefficients for each filter using pixels in the motion class to which the filter is assigned, wherein the identified pixels are excluded from the generation of the at least one subsequent set of coefficients.