1. A non-transitory computer-readable storage medium storing instructions for encoding image data, the instructions operable when executed by data processing apparatus to perform operations comprising: accessing an input data block including input data block values, wherein the input data block comprises a first data block X having a DC component (DC x ); accessing a prediction data block including prediction data block values, wherein the prediction data block comprises a second data block Y having a DC component (DC y ); generating a projection factor based on a projection of the input data block onto the prediction data block, wherein generating the projection factor comprises generating an AC (alternating current) projection factor for AC components of the prediction data block based on one or more DC (direct current) components of the input data block and the prediction data block, wherein the AC projection factor is represented by a scalar quantity (ρ); generating scaled input data block values by dividing the input data block values by the projection factor, wherein generating the scaled input data block values comprises calculating (X/ρ′), wherein (ρ′) is a reconstructed projection factor generated based on (ρ); and generating residual data block values based on a difference between corresponding scaled input data block values comprising (X/ρ′) and the prediction data block values comprising (Y).