int64_t i_cpb_delay_lookahead;
int64_t i_cpb_delay_pir_offset;
+ int64_t i_cpb_delay_pir_offset_next;
int b_queued_intra_refresh;
int64_t i_last_idr_pts;
if( h->param.cpu&X264_CPU_SSE_MISALIGN )
x264_cpu_mask_misalign_sse();
#endif
+ h->i_cpb_delay_pir_offset = h->i_cpb_delay_pir_offset_next;
/* no data out */
*pi_nal = 0;
}
if( h->fenc->b_keyframe && h->param.b_intra_refresh )
- h->i_cpb_delay_pir_offset = h->fenc->i_cpb_delay;
+ h->i_cpb_delay_pir_offset_next = h->fenc->i_cpb_delay;
/* Init the rate control */
/* FIXME: Include slice header bit cost. */
prev_frame->i_cpb_duration += cur_frame->i_dpb_output_delay;
}
- if( cur_frame->b_keyframe )
+ // don't reset cpb delay for IDR frames when using intra-refresh
+ if( cur_frame->b_keyframe && !h->param.b_intra_refresh )
*i_cpb_delay = 0;
*i_cpb_delay += cur_frame->i_duration;