This commit clarifies integer value range for vairables used in several variance functions, also change to use proper type conversion to reflect the value ranges. Ported from libvpx/master: #a564b18d Change-Id: I94bf12a8567766003ec667b4ebe9b820596d54ca