diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-12-22 14:17:54 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-12-22 14:17:54 +0000 |
commit | 50c6f6cd4c1754d52bd093f3a7bd7585b17547a0 (patch) | |
tree | 007accc18b3aa481e6e3f3433d2bb29aadcffd59 /libavcodec | |
parent | bb270c0896b39e1ae9277355e3c120ed3feb64a3 (diff) | |
download | ffmpeg-50c6f6cd4c1754d52bd093f3a7bd7585b17547a0.tar.gz |
improved lambda/qp guessing for motion estimation RD in first pass
this only affects encoding with bframes and rate control
Originally committed as revision 4765 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpegvideo.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index cc884dbae8..729cfdd89d 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -5300,7 +5300,15 @@ static void encode_picture(MpegEncContext *s, int picture_number) 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++){ |