diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c index e984ed5b29..64dab153f6 100644 --- a/libavcodec/ratecontrol.c +++ b/libavcodec/ratecontrol.c @@ -862,8 +862,8 @@ static int init_pass2(MpegEncContext *s) /* find qscale */ for(i=0; inum_entries; i++){ RateControlEntry *rce= &rcc->entry[i]; - qscale[i]= get_qscale(s, &rcc->entry[i], rate_factor, i); - rcc->last_qscale_for[rce->pict_type] = qscale[i]; + double q = get_qscale(s, &rcc->entry[i], rate_factor, i); + qscale[i] = get_diff_limited_q(s, rce, q); } assert(filter_size%2==1);