1. A decoder, comprising: an input device configured to receive a datastream encoded with a low dynamic range image, a prediction function, and a residual image; a converter configured to apply the prediction function to the low dynamic range image to obtain a predicted high dynamic range image; and a combiner configured to combine the residual image with the predicted high dynamic range image to obtain a high dynamic range image; wherein the prediction function is based on the low dynamic range image and a reference high dynamic range image to which the low dynamic range image corresponds.