summaryrefslogtreecommitdiff
path: root/libavcodec/ratecontrol.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-18 14:17:41 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-18 14:18:41 +0200
commitfc67d937cc73fb68ab8d840e319e89c52df79c3d (patch)
treeb82eb1bb43742eede1a5e2189419b79bb63bc9e9 /libavcodec/ratecontrol.c
parentec8f56efad2c1a150e822f6b11c54915446a2d09 (diff)
parent66a68ddd1ac376b24db8695058bc8fc28f5bada6 (diff)
downloadffmpeg-fc67d937cc73fb68ab8d840e319e89c52df79c3d.tar.gz
Merge commit '66a68ddd1ac376b24db8695058bc8fc28f5bada6'
* commit '66a68ddd1ac376b24db8695058bc8fc28f5bada6': lavc: make rc_buffer_aggressivity/rc_initial_cplx into private options of mpegvideo encoders Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ratecontrol.c')
-rw-r--r--libavcodec/ratecontrol.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c
index 9c1ad2e7dd..aa082048ee 100644
--- a/libavcodec/ratecontrol.c
+++ b/libavcodec/ratecontrol.c
@@ -250,9 +250,9 @@ av_cold int ff_rate_control_init(MpegEncContext *s)
return -1;
}
/* init stuff with the user specified complexity */
- if (s->avctx->rc_initial_cplx) {
+ if (s->rc_initial_cplx) {
for (i = 0; i < 60 * 30; i++) {
- double bits = s->avctx->rc_initial_cplx * (i / 10000.0 + 1.0) * s->mb_num;
+ double bits = s->rc_initial_cplx * (i / 10000.0 + 1.0) * s->mb_num;
RateControlEntry rce;
if (i % ((s->gop_size + 3) / 4) == 0)
@@ -533,7 +533,7 @@ static double modify_qscale(MpegEncContext *s, RateControlEntry *rce,
d = 1.0;
else if (d < 0.0001)
d = 0.0001;
- q *= pow(d, 1.0 / s->avctx->rc_buffer_aggressivity);
+ q *= pow(d, 1.0 / s->rc_buffer_aggressivity);
q_limit = bits2qp(rce,
FFMAX((min_rate - buffer_size + rcc->buffer_index) *
@@ -553,7 +553,7 @@ static double modify_qscale(MpegEncContext *s, RateControlEntry *rce,
d = 1.0;
else if (d < 0.0001)
d = 0.0001;
- q /= pow(d, 1.0 / s->avctx->rc_buffer_aggressivity);
+ q /= pow(d, 1.0 / s->rc_buffer_aggressivity);
q_limit = bits2qp(rce,
FFMAX(rcc->buffer_index *
@@ -569,7 +569,7 @@ static double modify_qscale(MpegEncContext *s, RateControlEntry *rce,
}
av_dlog(s, "q:%f max:%f min:%f size:%f index:%f agr:%f\n",
q, max_rate, min_rate, buffer_size, rcc->buffer_index,
- s->avctx->rc_buffer_aggressivity);
+ s->rc_buffer_aggressivity);
if (s->rc_qsquish == 0.0 || qmin == qmax) {
if (q < qmin)
q = qmin;