1. A method for selecting a sequence of quantization parameter values in a video encoder, the video encoder being arranged to encode a video frame as a sequence of n macroblocks and to assign a quantization parameter value for each macroblock of the video frame, the method characterized in that it includes steps ( 23 24 25 ) in which quantization parameter values assigned to at least a sub-set of said sequence of n macroblocks are optimized in such a way as to minimize a cost associated with their encoding.