1. A method comprising: generating, by a data processing system, a spatial vector for a target block of pixels, wherein the generating comprises performing a discrete cosine transform spatial prediction method comprising selecting a number of quantized coefficients as elements of the spatial vector; using the spatial vector to generate a matrix of quantized discrete cosine transform coefficients; applying an inverse quantization function to the matrix of quantized discrete cosine transform coefficients to produce a matrix of discrete cosine transform coefficients; applying an inverse discrete cosine transform function to the matrix of discrete cosine transform coefficients to generate a spatial reference block having a matrix of pixel values; using the spatial reference block to generate a spatial prediction of the target block; generating a spatial prediction error; comparing the spatial prediction error to a temporal prediction error; and encoding the spatial reference block if the spatial prediction error is less than the temporal prediction error.