changeset 3454:de0ed6497a13 libavcodec

remove STATS code (probably hasnt been used for years ..., and its not completely clear what it was good for anyway)
author michael
date Sun, 09 Jul 2006 10:33:49 +0000
parents e3f5377bddb2
children cc4b4ea83e29
files bitstream.h mpegvideo.c msmpeg4.c wmv2.c
diffstat 4 files changed, 0 insertions(+), 88 deletions(-) [+]
line wrap: on
line diff
--- a/bitstream.h	Sun Jul 09 03:00:57 2006 +0000
+++ b/bitstream.h	Sun Jul 09 10:33:49 2006 +0000
@@ -177,9 +177,6 @@
     unsigned int bit_buf;
     int bit_left;
 
-#ifdef STATS
-    st_out_bit_counts[st_current_index] += n;
-#endif
     //    printf("put_bits=%d %x\n", n, value);
     assert(n == 32 || value < (1U << n));
 
--- a/mpegvideo.c	Sun Jul 09 03:00:57 2006 +0000
+++ b/mpegvideo.c	Sun Jul 09 10:33:49 2006 +0000
@@ -1371,10 +1371,6 @@
 {
     MpegEncContext *s = avctx->priv_data;
 
-#ifdef STATS
-    print_stats();
-#endif
-
     ff_rate_control_uninit(s);
 
     MPV_common_end(s);
--- a/msmpeg4.c	Sun Jul 09 03:00:57 2006 +0000
+++ b/msmpeg4.c	Sun Jul 09 10:33:49 2006 +0000
@@ -89,70 +89,6 @@
 static uint8_t rl_length[NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2];
 #endif //CONFIG_ENCODERS
 
-#ifdef STATS
-
-const char *st_names[ST_NB] = {
-    "unknown",
-    "dc",
-    "intra_ac",
-    "inter_ac",
-    "intra_mb",
-    "inter_mb",
-    "mv",
-};
-
-int st_current_index = 0;
-unsigned int st_bit_counts[ST_NB];
-unsigned int st_out_bit_counts[ST_NB];
-
-#define set_stat(var) st_current_index = var;
-
-void print_stats(void)
-{
-    unsigned int total;
-    int i;
-
-    printf("Input:\n");
-    total = 0;
-    for(i=0;i<ST_NB;i++)
-        total += st_bit_counts[i];
-    if (total == 0)
-        total = 1;
-    for(i=0;i<ST_NB;i++) {
-        printf("%-10s : %10.1f %5.1f%%\n",
-               st_names[i],
-               (double)st_bit_counts[i] / 8.0,
-               (double)st_bit_counts[i] * 100.0 / total);
-    }
-    printf("%-10s : %10.1f %5.1f%%\n",
-           "total",
-           (double)total / 8.0,
-           100.0);
-
-    printf("Output:\n");
-    total = 0;
-    for(i=0;i<ST_NB;i++)
-        total += st_out_bit_counts[i];
-    if (total == 0)
-        total = 1;
-    for(i=0;i<ST_NB;i++) {
-        printf("%-10s : %10.1f %5.1f%%\n",
-               st_names[i],
-               (double)st_out_bit_counts[i] / 8.0,
-               (double)st_out_bit_counts[i] * 100.0 / total);
-    }
-    printf("%-10s : %10.1f %5.1f%%\n",
-           "total",
-           (double)total / 8.0,
-           100.0);
-}
-
-#else
-
-#define set_stat(var)
-
-#endif
-
 static void common_init(MpegEncContext * s)
 {
     static int inited=0;
@@ -509,7 +445,6 @@
     mv = &mv_tables[s->mv_table_index];
 
     code = mv->table_mv_index[(mx << 6) | my];
-    set_stat(ST_MV);
     put_bits(&s->pb,
              mv->table_mv_bits[code],
              mv->table_mv_code[code]);
@@ -545,7 +480,6 @@
 
     if (!s->mb_intra) {
         /* compute cbp */
-        set_stat(ST_INTER_MB);
         cbp = 0;
         for (i = 0; i < 6; i++) {
             if (s->block_last_index[i] >= 0)
@@ -636,7 +570,6 @@
                      cbpy_tab[cbp>>2][0]);
         }else{
             if (s->pict_type == I_TYPE) {
-                set_stat(ST_INTRA_MB);
                 put_bits(&s->pb,
                          ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]);
             } else {
@@ -646,7 +579,6 @@
                          table_mb_non_intra[cbp][1],
                          table_mb_non_intra[cbp][0]);
             }
-            set_stat(ST_INTRA_MB);
             put_bits(&s->pb, 1, 0);             /* no AC prediction yet */
             if(s->inter_intra_pred){
                 s->h263_aic_dir=0;
@@ -924,7 +856,6 @@
     const uint8_t *scantable;
 
     if (s->mb_intra) {
-        set_stat(ST_DC);
         msmpeg4_encode_dc(s, block[0], n, &dc_pred_dir);
         i = 1;
         if (n < 4) {
@@ -934,7 +865,6 @@
         }
         run_diff = 0;
         scantable= s->intra_scantable.permutated;
-        set_stat(ST_INTRA_AC);
     } else {
         i = 0;
         rl = &rl_table[3 + s->rl_table_index];
@@ -943,7 +873,6 @@
         else
             run_diff = 1;
         scantable= s->inter_scantable.permutated;
-        set_stat(ST_INTER_AC);
     }
 
     /* recalculate block_last_index for M$ wmv1 */
@@ -1572,7 +1501,6 @@
     uint32_t * const mb_type_ptr= &s->current_picture.mb_type[ s->mb_x + s->mb_y*s->mb_stride ];
 
     if (s->pict_type == P_TYPE) {
-        set_stat(ST_INTER_MB);
         if (s->use_skip_mb_code) {
             if (get_bits1(&s->gb)) {
                 /* skip mb */
@@ -1598,7 +1526,6 @@
 
         cbp = code & 0x3f;
     } else {
-        set_stat(ST_INTRA_MB);
         s->mb_intra = 1;
         code = get_vlc2(&s->gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2);
         if (code < 0)
@@ -1623,7 +1550,6 @@
             s->rl_table_index = decode012(&s->gb);
             s->rl_chroma_table_index = s->rl_table_index;
         }
-        set_stat(ST_MV);
         h263_pred_motion(s, 0, 0, &mx, &my);
         if (msmpeg4_decode_motion(s, &mx, &my) < 0)
             return -1;
@@ -1634,7 +1560,6 @@
         *mb_type_ptr = MB_TYPE_L0 | MB_TYPE_16x16;
     } else {
 //printf("I at %d %d %d %06X\n", s->mb_x, s->mb_y, ((cbp&3)? 1 : 0) +((cbp&0x3C)? 2 : 0), show_bits(&s->gb, 24));
-        set_stat(ST_INTRA_MB);
         s->ac_pred = get_bits1(&s->gb);
         *mb_type_ptr = MB_TYPE_INTRA;
         if(s->inter_intra_pred){
@@ -1673,7 +1598,6 @@
         qadd=0;
 
         /* DC coef */
-        set_stat(ST_DC);
         level = msmpeg4_decode_dc(s, n, &dc_pred_dir);
 
         if (level < 0){
@@ -1709,7 +1633,6 @@
         } else {
             scan_table = s->intra_scantable.permutated;
         }
-        set_stat(ST_INTRA_AC);
         rl_vlc= rl->rl_vlc[0];
     } else {
         qmul = s->qscale << 1;
@@ -1728,7 +1651,6 @@
         }
         if(!scan_table)
             scan_table = s->inter_scantable.permutated;
-        set_stat(ST_INTER_AC);
         rl_vlc= rl->rl_vlc[s->qscale];
     }
   {
--- a/wmv2.c	Sun Jul 09 03:00:57 2006 +0000
+++ b/wmv2.c	Sun Jul 09 10:33:49 2006 +0000
@@ -207,7 +207,6 @@
 
     if (!s->mb_intra) {
         /* compute cbp */
-        set_stat(ST_INTER_MB);
         cbp = 0;
         for (i = 0; i < 6; i++) {
             if (s->block_last_index[i] >= 0)
@@ -244,7 +243,6 @@
 #endif
 
         if (s->pict_type == I_TYPE) {
-            set_stat(ST_INTRA_MB);
             put_bits(&s->pb,
                      ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]);
         } else {
@@ -252,7 +250,6 @@
                      wmv2_inter_table[w->cbp_table_index][cbp][1],
                      wmv2_inter_table[w->cbp_table_index][cbp][0]);
         }
-        set_stat(ST_INTRA_MB);
         put_bits(&s->pb, 1, 0);         /* no AC prediction yet */
         if(s->inter_intra_pred){
             s->h263_aic_dir=0;