Display SSIM measurement in db as well
authorJason Garrett-Glaser <darkshikari@gmail.com>
Wed, 2 Jun 2010 22:47:26 +0000 (15:47 -0700)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Wed, 9 Jun 2010 18:35:48 +0000 (11:35 -0700)
encoder/encoder.c

index 9c89eeb..238f2b6 100644 (file)
@@ -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 )
         {