(hevc-WeightedPred) Integration of weighted_pred_avg optimized function from openHEVC