summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-07-09 10:33:49 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-07-09 10:33:49 +0000
commita7702890bd470fc1683578609b7e1c5a2acfcd94 (patch)
tree517e761e3e27fd66f3388364ab1e50493f3265d3 /libavcodec
parentfdb5983285b06139219142dd57a37ffa20c9f3b5 (diff)
remove STATS code (probably hasnt been used for years ..., and its not completely clear what it was good for anyway)
Originally committed as revision 5689 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/bitstream.h3
-rw-r--r--libavcodec/mpegvideo.c4
-rw-r--r--libavcodec/msmpeg4.c78
-rw-r--r--libavcodec/wmv2.c3
4 files changed, 0 insertions, 88 deletions
diff --git a/libavcodec/bitstream.h b/libavcodec/bitstream.h
index 265e934734..10db64d338 100644
--- a/libavcodec/bitstream.h
+++ b/libavcodec/bitstream.h
@@ -177,9 +177,6 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
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));
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 6393cc91fe..6f5a37b90a 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1371,10 +1371,6 @@ int MPV_encode_end(AVCodecContext *avctx)
{
MpegEncContext *s = avctx->priv_data;
-#ifdef STATS
- print_stats();
-#endif
-
ff_rate_control_uninit(s);
MPV_common_end(s);
diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c
index 9790494baa..6d83f5c6c5 100644
--- a/libavcodec/msmpeg4.c
+++ b/libavcodec/msmpeg4.c
@@ -89,70 +89,6 @@ int frame_count = 0;
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 @@ static void msmpeg4_encode_motion(MpegEncContext * s,
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 @@ void msmpeg4_encode_mb(MpegEncContext * s,
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 @@ void msmpeg4_encode_mb(MpegEncContext * s,
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 @@ void msmpeg4_encode_mb(MpegEncContext * s,
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 @@ static inline void msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int
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 @@ static inline void msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int
}
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 @@ static inline void msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int
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 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
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 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
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 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
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 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
*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 @@ static inline int msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
qadd=0;
/* DC coef */
- set_stat(ST_DC);
level = msmpeg4_decode_dc(s, n, &dc_pred_dir);
if (level < 0){
@@ -1709,7 +1633,6 @@ static inline int msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
} 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 @@ static inline int msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
}
if(!scan_table)
scan_table = s->inter_scantable.permutated;
- set_stat(ST_INTER_AC);
rl_vlc= rl->rl_vlc[s->qscale];
}
{
diff --git a/libavcodec/wmv2.c b/libavcodec/wmv2.c
index dd88b7d286..3f405af4f9 100644
--- a/libavcodec/wmv2.c
+++ b/libavcodec/wmv2.c
@@ -207,7 +207,6 @@ void ff_wmv2_encode_mb(MpegEncContext * s,
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 @@ void ff_wmv2_encode_mb(MpegEncContext * s,
#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 @@ void ff_wmv2_encode_mb(MpegEncContext * s,
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;