diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-09-11 17:20:08 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-09-11 17:50:14 +0200 |
commit | a990a308835f11461595fa15d66ab4348254bbf6 (patch) | |
tree | 1d013d15e3981ef2fd52669ac1c9c2fcb0d7d93c /libavcodec/ratecontrol.c | |
parent | 2fe8fd394829d44fd2ac5c7ac30ff01d8f228dd0 (diff) | |
download | ffmpeg-streaming-a990a308835f11461595fa15d66ab4348254bbf6.zip ffmpeg-streaming-a990a308835f11461595fa15d66ab4348254bbf6.tar.gz |
ratecontrol: correct predictor in case of stuffing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ratecontrol.c')
-rw-r--r-- | libavcodec/ratecontrol.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c index a693ec4..7b8e649 100644 --- a/libavcodec/ratecontrol.c +++ b/libavcodec/ratecontrol.c @@ -679,7 +679,8 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run) /* update predictors */ if(picture_number>2 && !dry_run){ const int last_var= s->last_pict_type == AV_PICTURE_TYPE_I ? rcc->last_mb_var_sum : rcc->last_mc_mb_var_sum; - update_predictor(&rcc->pred[s->last_pict_type], rcc->last_qscale, sqrt(last_var), s->frame_bits); + av_assert1(s->frame_bits >= s->stuffing_bits); + update_predictor(&rcc->pred[s->last_pict_type], rcc->last_qscale, sqrt(last_var), s->frame_bits - s->stuffing_bits); } if(s->flags&CODEC_FLAG_PASS2){ |