]> git.videolan.org Git - x264.git/commitdiff
Only print weightp stats if there were P-frames
authorJason Garrett-Glaser <darkshikari@gmail.com>
Fri, 20 Nov 2009 16:04:28 +0000 (08:04 -0800)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Sat, 21 Nov 2009 19:48:26 +0000 (11:48 -0800)
encoder/encoder.c

index 0b4117e76216418341fdde660ad6637a86be197c..8523d152e710316f312b3923c469a5c3464c5a29 100644 (file)
@@ -2566,7 +2566,7 @@ void    x264_encoder_close  ( x264_t *h )
                           fixed_pred_modes[i][8] * 100.0 / sum_pred_modes[i] );
         }
 
-        if( h->param.analyse.i_weighted_pred == X264_WEIGHTP_SMART )
+        if( h->param.analyse.i_weighted_pred == X264_WEIGHTP_SMART && h->stat.i_frame_count[SLICE_TYPE_P] > 0 )
             x264_log( h, X264_LOG_INFO, "Weighted P-Frames: Y:%.1f%%\n",
                       h->stat.i_wpred[0] * 100.0 / h->stat.i_frame_count[SLICE_TYPE_P] );