Fix PSNR formula

This commit is contained in:
jfmcarreira committed 2016-11-24 18:24:32 +00:00
1 parent 2aaeb9f6ed
commit 6d2f5eacdb
1 file changed
+3 -1
+3 -1
View File
@@ -1327,10 +1327,12 @@ Double PlaYUVerFrame::getMSE( PlaYUVerFrame* Org, Int component )
Double PlaYUVerFrame::getPSNR( PlaYUVerFrame* Org, Int component )
{
UInt uiMaxValue = ( 1 << Org->getBitsPel() );
Double uiMaxValueSquare = uiMaxValue * uiMaxValue;
Double dPSNR = 100;
Double dMSE = getMSE( Org, component );
if( dMSE != 0 )
dPSNR = 10 * log10( 65025 / dMSE );
dPSNR = 10 * log10( uiMaxValueSquare / dMSE );
return dPSNR;
}