Lines 142-154
Link Here
|
142 |
x4->params.rc.b_stat_write = (avctx->flags & CODEC_FLAG_PASS1); |
142 |
x4->params.rc.b_stat_write = (avctx->flags & CODEC_FLAG_PASS1); |
143 |
if(avctx->flags & CODEC_FLAG_PASS2) x4->params.rc.b_stat_read = 1; |
143 |
if(avctx->flags & CODEC_FLAG_PASS2) x4->params.rc.b_stat_read = 1; |
144 |
else{ |
144 |
else{ |
145 |
if(avctx->crf) x4->params.rc.i_rf_constant = avctx->crf; |
145 |
if(avctx->crf){ |
146 |
else if(avctx->cqp > -1) x4->params.rc.i_qp_constant = avctx->cqp; |
146 |
x4->params.rc.i_rc_method = X264_RC_CRF; |
|
|
147 |
x4->params.rc.i_rf_constant = avctx->crf; |
148 |
}else if(avctx->cqp > -1){ |
149 |
x4->params.rc.i_rc_method = X264_RC_CQP; |
150 |
x4->params.rc.i_qp_constant = avctx->cqp; |
151 |
} |
147 |
} |
152 |
} |
148 |
|
153 |
|
149 |
// if neither crf nor cqp modes are selected we have to enable the RC |
154 |
// if neither crf nor cqp modes are selected we have to enable the RC |
150 |
// we do it this way because we cannot check if the bitrate has been set |
155 |
// we do it this way because we cannot check if the bitrate has been set |
151 |
if(!(avctx->crf || (avctx->cqp > -1))) x4->params.rc.b_cbr = 1; |
156 |
if(!(avctx->crf || (avctx->cqp > -1))) x4->params.rc.i_rc_method = X264_RC_ABR; |
152 |
|
157 |
|
153 |
x4->params.i_bframe = avctx->max_b_frames; |
158 |
x4->params.i_bframe = avctx->max_b_frames; |
154 |
x4->params.b_cabac = avctx->coder_type == FF_CODER_TYPE_AC; |
159 |
x4->params.b_cabac = avctx->coder_type == FF_CODER_TYPE_AC; |