Added parsing for PSNR output and handling of infinite value