Video encoder for encoding a first sequence of frames the sample values of which are represented in a first format covering a first dynamic range, comprising: a sample value converter configured to convert the sample values of the frames of the first sequence from the first format into a second format having a second dynamic range lower than the first dynamic range, using a mapping function which maps a portion out of the first dynamic range, which is settable by a mapping parameter, to the second dynamic range, so as to obtain a second sequence of frames; and a video encoding stage configured to encode the second sequence of frames by weighted temporal prediction of a first frame of the second sequence using a second frame of the second sequence or a reconstructed version of the second frame of the second sequence, weighted by a weighting parameter and offset by an offset parameter, as a reference; characterized by a parameter setter for setting the weighting parameter and the offset parameter depending on the mapping parameter for the second frame of the first sequence corresponding to the second frame of the second sequence, and setting the mapping parameter for a first frame of the first sequence corresponding to the first frame of the second sequence, depending on the the mapping parameter for the second frame of the first sequence, the weighting parameter and the offset parameter, by determining an occupied portion of the first dynamic range within which the sample values of the first frame of the first sequence are distributed, and setting the weighting parameter and the offset parameter and the mapping parameter for the first frame of the first sequence, corresponding to the first frame of the second sequence concurrently such that the weighting parameter and the offset parameter displace and scale the portion out of the first dynamic range as set by the mapping parameter for the second frame of the first sequence corresponding to the second frame of the second sequence, to result in an interval which captures the occupied portion, with the interval being the portion out of the first dynamic range set by the mapping parameter for the first frame of the first sequence. a sample value converter configured to convert the sample values of the frames of the first sequence from the first format into a second format having a second dynamic range lower than the first dynamic range, using a mapping function which maps a portion out of the first dynamic range, which is settable by a mapping parameter, to the second dynamic range, so as to obtain a second sequence of frames; and a video encoding stage configured to encode the second sequence of frames by weighted temporal prediction of a first frame of the second sequence using a second frame of the second sequence or a reconstructed version of the second frame of the second sequence, weighted by a weighting parameter and offset by an offset parameter, as a reference; characterized by a parameter setter for setting the weighting parameter and the offset parameter depending on the mapping parameter for the second frame of the first sequence corresponding to the second frame of the second sequence, and setting the mapping parameter for a first frame of the first sequence corresponding to the first frame of the second sequence, depending on the the mapping parameter for the second frame of the first sequence, the weighting parameter and the offset parameter, by determining an occupied portion of the first dynamic range within which the sample values of the first frame of the first sequence are distributed, and setting the weighting parameter and the offset parameter and the mapping parameter for the first frame of the first sequence, corresponding to the first frame of the second sequence concurrently such that the weighting parameter and the offset parameter displace and scale the portion out of the first dynamic range as set by the mapping parameter for the second frame of the first sequence corresponding to the second frame of the second sequence, to result in an interval which captures the occupied portion, with the interval being the portion out of the first dynamic range set by the mapping parameter for the first frame of the first sequence. determining an occupied portion of the first dynamic range within which the sample values of the first frame of the first sequence are distributed, and setting the weighting parameter and the offset parameter and the mapping parameter for the first frame of the first sequence, corresponding to the first frame of the second sequence concurrently such that the weighting parameter and the offset parameter displace and scale the portion out of the first dynamic range as set by the mapping parameter for the second frame of the first sequence corresponding to the second frame of the second sequence, to result in an interval which captures the occupied portion, with the interval being the portion out of the first dynamic range set by the mapping parameter for the first frame of the first sequence.