s += sprintf( s, " cqm=%d", p->i_cqm_preset );
s += sprintf( s, " chroma_qp_offset=%d", p->analyse.i_chroma_qp_offset );
s += sprintf( s, " slices=%d", p->i_threads );
+ s += sprintf( s, " nr=%d", p->analyse.i_noise_reduction );
s += sprintf( s, " bframes=%d", p->i_bframe );
if( p->i_bframe )
s += sprintf( s, " keyint=%d keyint_min=%d scenecut=%d",
p->i_keyint_max, p->i_keyint_min, p->i_scenecut_threshold );
- s += sprintf( s, " pass=%d", p->rc.b_stat_read ? 2 : 1 );
+ s += sprintf( s, " rc=%s", p->rc.b_stat_read && p->rc.b_cbr ? "2pass" :
+ p->rc.b_cbr ? p->rc.i_vbv_buffer_size ? "cbr" : "abr" :
+ p->rc.i_rf_constant ? "crf" : "cqp" );
if( p->rc.b_cbr || p->rc.i_rf_constant )
{
if( p->rc.i_rf_constant )
if( p->rc.b_stat_read )
s += sprintf( s, " cplxblur=%.1f qblur=%.1f",
p->rc.f_complexity_blur, p->rc.f_qblur );
- if( p->rc.i_vbv_max_bitrate && p->rc.i_vbv_buffer_size )
+ if( p->rc.i_vbv_buffer_size )
s += sprintf( s, " vbv_maxrate=%d vbv_bufsize=%d",
p->rc.i_vbv_max_bitrate, p->rc.i_vbv_buffer_size );
}
rc->last_non_b_pict_type = -1;
rc->cbr_decay = 1.0;
- if( rc->b_2pass && h->param.rc.i_rf_constant )
+ if( h->param.rc.i_rf_constant && h->param.rc.b_stat_read )
+ {
x264_log(h, X264_LOG_ERROR, "constant rate-factor is incompatible with 2pass.\n");
+ return -1;
+ }
if( h->param.rc.i_vbv_buffer_size && !h->param.rc.b_cbr && !h->param.rc.i_rf_constant )
x264_log(h, X264_LOG_ERROR, "VBV is incompatible with constant QP.\n");
if( h->param.rc.i_vbv_buffer_size && h->param.rc.b_cbr
rc->cbr_decay = 1.0 - rc->buffer_rate / rc->buffer_size
* 0.5 * X264_MAX(0, 1.5 - rc->buffer_rate * rc->fps / rc->bitrate);
}
- else if( h->param.rc.i_vbv_max_bitrate || h->param.rc.i_vbv_buffer_size )
- x264_log(h, X264_LOG_ERROR, "VBV maxrate or buffer size specified, but not both.\n");
+ else if( h->param.rc.i_vbv_max_bitrate )
+ x264_log(h, X264_LOG_ERROR, "VBV maxrate specified, but no bufsize.\n");
if(rc->rate_tolerance < 0.01) {
x264_log(h, X264_LOG_ERROR, "bitrate tolerance too small, using .01\n");
rc->rate_tolerance = 0.01;