1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/libx264: fix "bitrate reconfiguration"

This commit is contained in:
Michael Niedermayer 2014-06-12 01:03:46 +02:00
parent 8159fe255c
commit 3a1c8951bc

View File

@ -208,18 +208,20 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
} }
if (x4->params.rc.i_rc_method == X264_RC_CRF && if (x4->params.rc.i_rc_method == X264_RC_CRF &&
x4->crf >= 0 &&
x4->params.rc.f_rf_constant != x4->crf) { x4->params.rc.f_rf_constant != x4->crf) {
x4->params.rc.f_rf_constant = x4->crf; x4->params.rc.f_rf_constant = x4->crf;
x264_encoder_reconfig(x4->enc, &x4->params); x264_encoder_reconfig(x4->enc, &x4->params);
} }
if (x4->params.rc.i_rc_method == X264_RC_CQP && if (x4->params.rc.i_rc_method == X264_RC_CQP &&
x4->cqp >= 0 &&
x4->params.rc.i_qp_constant != x4->cqp) { x4->params.rc.i_qp_constant != x4->cqp) {
x4->params.rc.i_qp_constant = x4->cqp; x4->params.rc.i_qp_constant = x4->cqp;
x264_encoder_reconfig(x4->enc, &x4->params); x264_encoder_reconfig(x4->enc, &x4->params);
} }
if (x4->crf_max && if (x4->crf_max >= 0 &&
x4->params.rc.f_rf_constant_max != x4->crf_max) { x4->params.rc.f_rf_constant_max != x4->crf_max) {
x4->params.rc.f_rf_constant_max = x4->crf_max; x4->params.rc.f_rf_constant_max = x4->crf_max;
x264_encoder_reconfig(x4->enc, &x4->params); x264_encoder_reconfig(x4->enc, &x4->params);