1. A method of a digital processor for determining a region-based weighted prediction with improved global brightness detection, the method comprising: applying a global brightness change detection methods by computing the weighted prediction parameters; determining if the brightness change is different amount of change for the different regions; if the change is not different, calculate motion estimation and setting Refidx to 1 and setting Refidx is set to 0 when there is change. determining the best motion vector, motion vector cost and the best reference input. determining a region-based weighted prediction with improved global brightness detection based on th2 motion vector data.