summaryrefslogtreecommitdiff
path: root/libavcodec/wmv2enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-01 00:40:33 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-01 00:40:33 +0100
commitec5e02d49573975ee4bc73be173a2fad76d808ff (patch)
tree266bbe1706fe426833cfb12a4000bbbb4ce128f1 /libavcodec/wmv2enc.c
parente1573d714746684e261628d6e773fa6913ed9634 (diff)
downloadffmpeg-ec5e02d49573975ee4bc73be173a2fad76d808ff.tar.gz
avcodec/wmv2enc: Collect statistics for 2 pass encoding
Fixes Ticket3053 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wmv2enc.c')
-rw-r--r--libavcodec/wmv2enc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c
index ab5e08591d..6aeee59ab2 100644
--- a/libavcodec/wmv2enc.c
+++ b/libavcodec/wmv2enc.c
@@ -169,10 +169,12 @@ void ff_wmv2_encode_mb(MpegEncContext * s,
ff_wmv2_inter_table[w->cbp_table_index][cbp + 64][1],
ff_wmv2_inter_table[w->cbp_table_index][cbp + 64][0]);
+ s->misc_bits += get_bits_diff(s);
/* motion vector */
ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
ff_msmpeg4_encode_motion(s, motion_x - pred_x,
motion_y - pred_y);
+ s->mv_bits += get_bits_diff(s);
} else {
/* compute cbp */
cbp = 0;
@@ -203,11 +205,16 @@ void ff_wmv2_encode_mb(MpegEncContext * s,
s->h263_aic_dir=0;
put_bits(&s->pb, ff_table_inter_intra[s->h263_aic_dir][1], ff_table_inter_intra[s->h263_aic_dir][0]);
}
+ s->misc_bits += get_bits_diff(s);
}
for (i = 0; i < 6; i++) {
ff_msmpeg4_encode_block(s, block[i], i);
}
+ if (s->mb_intra)
+ s->i_tex_bits += get_bits_diff(s);
+ else
+ s->p_tex_bits += get_bits_diff(s);
}
AVCodec ff_wmv2_encoder = {