Some optimization fixes. PSNR for three channels