if( h->param.rc.i_vbv_max_bitrate > 0 && h->param.rc.i_vbv_buffer_size > 0 &&
param->rc.i_vbv_max_bitrate > 0 && param->rc.i_vbv_buffer_size > 0 )
{
+ rc_reconfig |= h->param.rc.i_vbv_max_bitrate != param->rc.i_vbv_max_bitrate;
+ rc_reconfig |= h->param.rc.i_vbv_buffer_size != param->rc.i_vbv_buffer_size;
+ rc_reconfig |= h->param.rc.i_bitrate != param->rc.i_bitrate;
COPY( rc.i_vbv_max_bitrate );
COPY( rc.i_vbv_buffer_size );
COPY( rc.i_bitrate );
- rc_reconfig = 1;
}
- if( h->param.rc.f_rf_constant != param->rc.f_rf_constant )
- {
- COPY( rc.f_rf_constant );
- rc_reconfig = 1;
- }
- if( h->param.rc.f_rf_constant_max != param->rc.f_rf_constant_max )
- {
- COPY( rc.f_rf_constant_max );
- rc_reconfig = 1;
- }
-
+ rc_reconfig |= h->param.rc.f_rf_constant != param->rc.f_rf_constant;
+ rc_reconfig |= h->param.rc.f_rf_constant_max != param->rc.f_rf_constant_max;
+ COPY( rc.f_rf_constant );
+ COPY( rc.f_rf_constant_max );
#undef COPY
mbcmp_init( h );
memcpy( &dst->i_frame, &src->i_frame, offsetof(x264_t, mb.type) - offsetof(x264_t, i_frame) );
dst->param = src->param;
dst->stat = src->stat;
+ dst->pixf = src->pixf;
}
static void x264_thread_sync_stat( x264_t *dst, x264_t *src )
if( h->param.rc.i_vbv_max_bitrate > 0 && h->param.rc.i_vbv_buffer_size > 0 )
{
+ /* We don't support changing the ABR bitrate right now,
+ so if the stream starts as CBR, keep it CBR. */
+ if( rc->b_vbv_min_rate )
+ h->param.rc.i_vbv_max_bitrate = h->param.rc.i_bitrate;
+
if( h->param.rc.i_vbv_buffer_size < (int)(h->param.rc.i_vbv_max_bitrate / rc->fps) )
{
h->param.rc.i_vbv_buffer_size = h->param.rc.i_vbv_max_bitrate / rc->fps;
h->param.rc.i_vbv_buffer_size );
}
- /* We don't support changing the ABR bitrate right now,
- so if the stream starts as CBR, keep it CBR. */
- if( rc->b_vbv_min_rate )
- h->param.rc.i_vbv_max_bitrate = h->param.rc.i_bitrate;
-
int vbv_buffer_size = h->param.rc.i_vbv_buffer_size * 1000;
int vbv_max_bitrate = h->param.rc.i_vbv_max_bitrate * 1000;
/* Init HRD */
- h->sps->vui.hrd.i_bit_rate_unscaled = vbv_max_bitrate;
- h->sps->vui.hrd.i_cpb_size_unscaled = vbv_buffer_size;
if( h->param.i_nal_hrd && b_init )
{
h->sps->vui.hrd.i_cpb_cnt = 1;
x264_log( h, X264_LOG_WARNING, "VBV parameters cannot be changed when NAL HRD is in use\n" );
return;
}
+ h->sps->vui.hrd.i_bit_rate_unscaled = vbv_max_bitrate;
+ h->sps->vui.hrd.i_cpb_size_unscaled = vbv_buffer_size;
+ if( rc->b_vbv_min_rate )
+ rc->bitrate = h->param.rc.i_bitrate * 1000.;
rc->buffer_rate = vbv_max_bitrate / rc->fps;
rc->vbv_max_rate = vbv_max_bitrate;
rc->buffer_size = vbv_buffer_size;
COPY(prev_zone);
COPY(qpbuf_pos);
/* these vars can be updated by x264_ratecontrol_init_reconfigurable */
- COPY(buffer_rate);
+ COPY(bitrate);
COPY(buffer_size);
+ COPY(buffer_rate);
+ COPY(vbv_max_rate);
COPY(single_frame_vbv);
COPY(cbr_decay);
- COPY(b_vbv_min_rate);
COPY(rate_factor_constant);
- COPY(bitrate);
+ COPY(rate_factor_max_increment);
#undef COPY
}
if( cur != next )