[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec mpegvideo.c,1.496,1.497

Michael Niedermayer CVS michael
Thu Dec 22 15:17:56 CET 2005


Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv20080/libavcodec

Modified Files:
	mpegvideo.c 
Log Message:
improved lambda/qp guessing for motion estimation RD in first pass
this only affects encoding with bframes and rate control


Index: mpegvideo.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mpegvideo.c,v
retrieving revision 1.496
retrieving revision 1.497
diff -u -d -r1.496 -r1.497
--- mpegvideo.c	22 Dec 2005 01:10:08 -0000	1.496
+++ mpegvideo.c	22 Dec 2005 14:17:54 -0000	1.497
@@ -5300,7 +5300,15 @@
 
     if(s->flags & CODEC_FLAG_PASS2)
         estimate_qp(s, 1);
+    else if(!(s->flags & CODEC_FLAG_QSCALE)){
+        RateControlContext *rcc= &s->rc_context;
 
+        if(s->pict_type==B_TYPE)
+            s->lambda= rcc->last_qscale_for[s->pict_type];
+        else
+            s->lambda= rcc->last_qscale_for[rcc->last_non_b_pict_type];
+        update_qscale(s);
+    }
 
     s->mb_intra=0; //for the rate distortion & bit compare functions
     for(i=1; i<s->avctx->thread_count; i++){





More information about the ffmpeg-cvslog mailing list