av1/encoder/ratectrl.c
// Update the buffer level: leaky bucket model.
Update the buffer level: leaky bucket model.
Update the buffer level : leaky bucket model .
static void update_buffer_level(AV1_COMP *cpi, int encoded_frame_size) {
  const AV1_COMMON *const cm = &cpi->common;
  RATE_CONTROL *const rc = &cpi->rc;
  if (!cm->show_frame)
    rc->bits_off_target -= encoded_frame_size;
  else
    rc->bits_off_target += rc->avg_frame_bandwidth - encoded_frame_size;
  rc->bits_off_target = AOMMIN(rc->bits_off_target, rc->maximum_buffer_size);
  rc->buffer_level = rc->bits_off_target;
  if (cpi->use_svc) update_layer_buffer_level(&cpi->svc, encoded_frame_size);
}
static void update_buffer_level ( AV1_COMP * cpi , int encoded_frame_size ) { const AV1_COMMON * const cm = & cpi -> common ; RATE_CONTROL * const rc = & cpi -> rc ; if ( ! cm -> show_frame ) rc -> bits_off_target -= encoded_frame_size ; else rc -> bits_off_target += rc -> avg_frame_bandwidth - encoded_frame_size ; rc -> bits_off_target = AOMMIN ( rc -> bits_off_target , rc -> maximum_buffer_size ) ; rc -> buffer_level = rc -> bits_off_target ; if ( cpi -> use_svc ) update_layer_buffer_level ( & cpi -> svc , encoded_frame_size ) ; }
Update the buffer level: leaky bucket model.
Update the buffer level : leaky bucket model .
// Non-viewable frames are a special case and are treated as pure overhead. // Clip the buffer level to the maximum specified buffer size.