From 594b0eee1d90493ae87f741f6250668bf231ff7f Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 25 Nov 2016 09:53:05 +0000 Subject: [PATCH] Bugfix PSNR calculation --- lib/PlaYUVerFrame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PlaYUVerFrame.cpp b/lib/PlaYUVerFrame.cpp index 7a2325d..fc62f7e 100644 --- a/lib/PlaYUVerFrame.cpp +++ b/lib/PlaYUVerFrame.cpp @@ -1327,7 +1327,7 @@ Double PlaYUVerFrame::getMSE( PlaYUVerFrame* Org, Int component ) Double PlaYUVerFrame::getPSNR( PlaYUVerFrame* Org, Int component ) { - UInt uiMaxValue = ( 1 << Org->getBitsPel() ); + UInt uiMaxValue = ( 1 << Org->getBitsPel() - 1 ); Double uiMaxValueSquare = uiMaxValue * uiMaxValue; Double dPSNR = 100; Double dMSE = getMSE( Org, component );