A method for controlling encoding of a set of images where a first image and a second image overlap each other in an overlapping area, the method comprising: encoding macroblocks of a first area in the first image using a first set of base quantization parameter values, QP-values, and adding a base QP-value encoded for each macroblock to a header of that macroblock; encoding macroblocks of a second area in the first image using a set of first QP-values, and adding a modified set of the first QP-values to a header of each macroblock, wherein each modified first QP-value added to a macroblock header used for decoding is lower than a first QP-value used for encoding that macroblock; encoding macroblocks of a first area in the second image using a set of second QP-values, and adding a modified set of the second QP-values to a header of each macroblock, wherein each modified second QP-value added to a macroblock header used for decoding is lower than a second QP-value used for encoding that macroblock; encoding macroblocks of a second area in the second image using a second set of base quantization parameter values, QP-values, and adding a base QP-value encoded for each macroblock to a header of that macroblock; and wherein the overlapping area is the second area of the first image and the first area of the second image, and wherein the sets of QP-values and modified QP-values for the overlapping area is such that a difference between the sum of QP weights, 2 (-( QP encode -QP header )/6 , for the overlapping area and 1 is minimized, so as to minimize a difference in luminance between the overlapping area and non-overlapping areas, wherein QP encode is a QP-value in the first/second set of QP-values for encoding, and QP header is a QP-value in the modified first/second set of QP-values for decoding. encoding macroblocks of a first area in the first image using a first set of base quantization parameter values, QP-values, and adding a base QP-value encoded for each macroblock to a header of that macroblock; encoding macroblocks of a second area in the first image using a set of first QP-values, and adding a modified set of the first QP-values to a header of each macroblock, wherein each modified first QP-value added to a macroblock header used for decoding is lower than a first QP-value used for encoding that macroblock; encoding macroblocks of a first area in the second image using a set of second QP-values, and adding a modified set of the second QP-values to a header of each macroblock, wherein each modified second QP-value added to a macroblock header used for decoding is lower than a second QP-value used for encoding that macroblock; encoding macroblocks of a second area in the second image using a second set of base quantization parameter values, QP-values, and adding a base QP-value encoded for each macroblock to a header of that macroblock; and wherein the overlapping area is the second area of the first image and the first area of the second image, and wherein the sets of QP-values and modified QP-values for the overlapping area is such that a difference between the sum of QP weights, 2 (-( QP encode -QP header )/6 , for the overlapping area and 1 is minimized, so as to minimize a difference in luminance between the overlapping area and non-overlapping areas, wherein QP encode is a QP-value in the first/second set of QP-values for encoding, and QP header is a QP-value in the modified first/second set of QP-values for decoding. <EOS>