[x264-devel] commit: Print intra chroma pred modes in stats (Jason Garrett-Glaser )

git at videolan.org git at videolan.org
Sat Apr 24 00:40:05 CEST 2010


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Mon Apr 19 23:34:03 2010 -0700| [d6d63a0d1fb1ac1526da4bcdcc0a24e42e03a39c] | committer: Jason Garrett-Glaser 

Print intra chroma pred modes in stats

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=d6d63a0d1fb1ac1526da4bcdcc0a24e42e03a39c
---

 common/common.h   |    4 ++--
 encoder/encoder.c |   18 +++++++++++++++---
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/common/common.h b/common/common.h
index e75f743..7bc6a1f 100644
--- a/common/common.h
+++ b/common/common.h
@@ -734,7 +734,7 @@ struct x264_t
             int i_mb_count_ref[2][32];
             int i_mb_partition[17];
             int i_mb_cbp[6];
-            int i_mb_pred_mode[3][13];
+            int i_mb_pred_mode[4][13];
             /* Adaptive direct mv pred */
             int i_direct_score[2];
             /* Metrics */
@@ -762,7 +762,7 @@ struct x264_t
         int64_t i_mb_count_8x8dct[2];
         int64_t i_mb_count_ref[2][2][32];
         int64_t i_mb_cbp[6];
-        int64_t i_mb_pred_mode[3][13];
+        int64_t i_mb_pred_mode[4][13];
         /* */
         int     i_direct_score[2];
         int     i_direct_frames[2];
diff --git a/encoder/encoder.c b/encoder/encoder.c
index da4565b..0f9ba87 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -1945,6 +1945,7 @@ static int x264_slice_write( x264_t *h )
                 else //if( h->mb.i_type == I_4x4 )
                     for( int i = 0; i < 16; i++ )
                         h->stat.frame.i_mb_pred_mode[2][h->mb.cache.intra4x4_pred_mode[x264_scan8[i]]]++;
+                h->stat.frame.i_mb_pred_mode[3][x264_mb_pred_mode8x8c_fix[h->mb.i_chroma_pred_mode]]++;
             }
         }
 
@@ -2638,7 +2639,7 @@ static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
         h->stat.i_mb_count_8x8dct[i] += h->stat.frame.i_mb_count_8x8dct[i];
     for( int i = 0; i < 6; i++ )
         h->stat.i_mb_cbp[i] += h->stat.frame.i_mb_cbp[i];
-    for( int i = 0; i < 3; i++ )
+    for( int i = 0; i < 4; i++ )
         for( int j = 0; j < 13; j++ )
             h->stat.i_mb_pred_mode[i][j] += h->stat.frame.i_mb_pred_mode[i][j];
     if( h->sh.i_type != SLICE_TYPE_I )
@@ -2963,8 +2964,8 @@ void    x264_encoder_close  ( x264_t *h )
                   h->stat.i_mb_cbp[2] * 100.0 / (i_all_intra  ),
                   h->stat.i_mb_cbp[4] * 100.0 / (i_all_intra  ), buf );
 
-        int64_t fixed_pred_modes[3][9] = {{0}};
-        int64_t sum_pred_modes[3] = {0};
+        int64_t fixed_pred_modes[4][9] = {{0}};
+        int64_t sum_pred_modes[4] = {0};
         for( int i = 0; i <= I_PRED_16x16_DC_128; i++ )
         {
             fixed_pred_modes[0][x264_mb_pred_mode16x16_fix[i]] += h->stat.i_mb_pred_mode[0][i];
@@ -2995,6 +2996,17 @@ void    x264_encoder_close  ( x264_t *h )
                           fixed_pred_modes[i][7] * 100.0 / sum_pred_modes[i],
                           fixed_pred_modes[i][8] * 100.0 / sum_pred_modes[i] );
         }
+        for( int i = 0; i <= I_PRED_CHROMA_DC_128; i++ )
+        {
+            fixed_pred_modes[3][x264_mb_pred_mode8x8c_fix[i]] += h->stat.i_mb_pred_mode[3][i];
+            sum_pred_modes[3] += h->stat.i_mb_pred_mode[3][i];
+        }
+        if( sum_pred_modes[3] )
+            x264_log( h, X264_LOG_INFO, "i8c dc,h,v,p: %2.0f%% %2.0f%% %2.0f%% %2.0f%%\n",
+                      fixed_pred_modes[3][0] * 100.0 / sum_pred_modes[3],
+                      fixed_pred_modes[3][1] * 100.0 / sum_pred_modes[3],
+                      fixed_pred_modes[3][2] * 100.0 / sum_pred_modes[3],
+                      fixed_pred_modes[3][3] * 100.0 / sum_pred_modes[3] );
 
         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",



More information about the x264-devel mailing list