Skip to main content

calculate_psnr

Function calculate_psnr 

Source
pub fn calculate_psnr(
    reference: &[u8],
    test: &[u8],
    width: usize,
    height: usize,
) -> f64
Expand description

Calculate PSNR between two images.

§Arguments

  • reference - Reference image pixel data (RGB8, row-major).
  • test - Test image pixel data (RGB8, row-major).
  • width - Image width in pixels.
  • height - Image height in pixels.

§Returns

PSNR value in decibels. Higher is better. Returns f64::INFINITY if images are identical.