From: Jason Garrett-Glaser Date: Wed, 2 Jun 2010 22:47:26 +0000 (-0700) Subject: Display SSIM measurement in db as well X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=2d2abd8286f3744d79349a162e506f6502c52c56;p=x264.git Display SSIM measurement in db as well --- diff --git a/encoder/encoder.c b/encoder/encoder.c index 9c89eeb8..238f2b62 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -58,6 +58,11 @@ static float x264_psnr( int64_t i_sqe, int64_t i_size ) return -10.0 * log10( f_mse ); } +static float x264_ssim( float ssim ) +{ + return -10.0 * log10( 1 - ssim ); +} + static void x264_frame_dump( x264_t *h ) { FILE *f = fopen( h->param.psz_dump_yuv, "r+b" ); @@ -3069,9 +3074,8 @@ void x264_encoder_close ( x264_t *h ) if( h->param.analyse.b_ssim ) { - x264_log( h, X264_LOG_INFO, - "SSIM Mean Y:%.7f\n", - SUM3( h->stat.f_ssim_mean_y ) / i_count ); + float ssim = SUM3( h->stat.f_ssim_mean_y ) / i_count; + x264_log( h, X264_LOG_INFO, "SSIM Mean Y:%.7f (%6.3fdb)\n", ssim, x264_ssim( ssim ) ); } if( h->param.analyse.b_psnr ) {