Row SATDs are only necessary in VBV mode, so don't need to be checked if VBV is off.
* If we have tried this frame as P, then we have also tried
* the preceding frames as B. (is this still true?) */
/* Also check that we already calculated the row SATDs for the current frame. */
- if( frames[b]->i_cost_est[b-p0][p1-b] >= 0 && frames[b]->i_row_satds[b-p0][p1-b][0] != -1 )
+ if( frames[b]->i_cost_est[b-p0][p1-b] >= 0 && (!h->param.rc.i_vbv_buffer_size || frames[b]->i_row_satds[b-p0][p1-b][0] != -1) )
{
i_score = frames[b]->i_cost_est[b-p0][p1-b];
}