changeset 2428:548c87c06dbb libavcodec

assertion about bits statistic and minor bits stat fix
author michael
date Fri, 14 Jan 2005 23:48:12 +0000
parents d1b1a6258930
children 4b350cc506a7
files mpegvideo.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mpegvideo.c	Thu Jan 13 11:59:19 2005 +0000
+++ b/mpegvideo.c	Fri Jan 14 23:48:12 2005 +0000
@@ -2312,6 +2312,8 @@
             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 @@
 
     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){