1. A method of encoding a coding unit of a digital video sequence, the method comprising: computing a brightness measure for each region in a plurality of regions in the coding unit, wherein the brightness measure indicates a relative brightness between the region in the coding unit and a corresponding region in a reference coding unit, wherein each region comprises a plurality of pixels; determining a number of regions in the plurality of regions with significant brightness change by comparing each brightness measure to a region brightness change threshold; wherein computing the brightness measure further comprises: computing a first mean pixel value of the region in the coding unit; computing a second mean pixel value of the corresponding region in the reference coding unit; and computing the brightness measure as an absolute difference between the first mean pixel value and the second mean pixel value, detecting whether there is global brightness change in the coding unit by comparing the number of regions to a global brightness threshold; and only when the global brightness change is detected, computing weighted prediction factors to be used for weighted prediction in encoding the coding unit, and only when the global brightness change is not detected, providing default values for weighted prediction factors that will have no effect when used for weighted prediction in encoding the coding unit, wherein a value of the global brightness threshold depends on a number of regions in the plurality of regions.