modified HPSNR function