aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-01-14 23:48:12 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-01-14 23:48:12 +0000
commita9c3ff5b9edbefd4914333fd6c99cc8aded1f269 (patch)
treeb05526af71783405b7c33a82ca35c9a4f9b9427f /libavcodec
parentb6c7f870bed82d26f6885774b7c1568f59ad7123 (diff)
downloadffmpeg-a9c3ff5b9edbefd4914333fd6c99cc8aded1f269.tar.gz
assertion about bits statistic and minor bits stat fix
Originally committed as revision 3835 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpegvideo.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 170edb13be..6a48097a0c 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -2312,6 +2312,8 @@ int MPV_encode_picture(AVCodecContext *avctx,
avctx->error[i] += s->current_picture_ptr->error[i];
}
+ if(s->flags&CODEC_FLAG_PASS1)
+ assert(avctx->header_bits + avctx->mv_bits + avctx->misc_bits + avctx->i_tex_bits + avctx->p_tex_bits == put_bits_count(&s->pb));
flush_put_bits(&s->pb);
s->frame_bits = put_bits_count(&s->pb);
@@ -4556,6 +4558,9 @@ static void write_slice_end(MpegEncContext *s){
align_put_bits(&s->pb);
flush_put_bits(&s->pb);
+
+ if((s->flags&CODEC_FLAG_PASS1) && !s->partitioned_frame)
+ s->misc_bits+= get_bits_diff(s);
}
static int encode_thread(AVCodecContext *c, void *arg){