[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec mpegvideo.c, 1.497, 1.498 mpegvideo.h, 1.229, 1.230 ratecontrol.c, 1.51, 1.52
Michael Niedermayer CVS
michael
Thu Dec 22 23:48:11 CET 2005
Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv16911
Modified Files:
mpegvideo.c mpegvideo.h ratecontrol.c
Log Message:
better f_code guessing in 2nd pass
Index: mpegvideo.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mpegvideo.c,v
retrieving revision 1.497
retrieving revision 1.498
diff -u -d -r1.497 -r1.498
--- mpegvideo.c 22 Dec 2005 14:17:54 -0000 1.497
+++ mpegvideo.c 22 Dec 2005 22:48:09 -0000 1.498
@@ -5298,9 +5298,10 @@
s->no_rounding ^= 1;
}
- if(s->flags & CODEC_FLAG_PASS2)
+ if(s->flags & CODEC_FLAG_PASS2){
estimate_qp(s, 1);
- else if(!(s->flags & CODEC_FLAG_QSCALE)){
+ ff_get_2pass_fcode(s);
+ }else if(!(s->flags & CODEC_FLAG_QSCALE)){
RateControlContext *rcc= &s->rc_context;
if(s->pict_type==B_TYPE)
Index: mpegvideo.h
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mpegvideo.h,v
retrieving revision 1.229
retrieving revision 1.230
diff -u -d -r1.229 -r1.230
--- mpegvideo.h 22 Dec 2005 01:10:08 -0000 1.229
+++ mpegvideo.h 22 Dec 2005 22:48:09 -0000 1.230
@@ -980,6 +980,6 @@
double (**func2)(void *, double, double), char **func2_name,
void *opaque);
int ff_vbv_update(MpegEncContext *s, int frame_size);
-
+void ff_get_2pass_fcode(MpegEncContext *s);
#endif /* AVCODEC_MPEGVIDEO_H */
Index: ratecontrol.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/ratecontrol.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- ratecontrol.c 19 Dec 2005 13:41:27 -0000 1.51
+++ ratecontrol.c 22 Dec 2005 22:48:09 -0000 1.52
@@ -607,6 +607,17 @@
s->lambda_table[mb_xy]= intq;
}
}
+
+void ff_get_2pass_fcode(MpegEncContext *s){
+ RateControlContext *rcc= &s->rc_context;
+ int picture_number= s->picture_number;
+ RateControlEntry *rce;
+
+ rce= &rcc->entry[picture_number];
+ s->f_code= rce->f_code;
+ s->b_code= rce->b_code;
+}
+
//FIXME rd or at least approx for dquant
float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
More information about the ffmpeg-cvslog
mailing list