front-end/build/libvpx/vp9/encoder/vp9_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(VP9_COMP *cpi, int encoded_frame_size) {
  const VP9_COMMON *const cm = &cpi->common;
  const VP9_CONFIG *oxcf = &cpi->oxcf;
  RATE_CONTROL *const rc = &cpi->rc;
  if (!cm->show_frame) {
    rc->bits_off_target -= encoded_frame_size;
  } else {
    rc->bits_off_target += rc->av_per_frame_bandwidth - encoded_frame_size;
  }
  rc->bits_off_target = MIN(rc->bits_off_target, oxcf->maximum_buffer_size);
  rc->buffer_level = rc->bits_off_target;
  if (cpi->use_svc && cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
    update_layer_buffer_level(&cpi->svc, encoded_frame_size);
  }
}
static void update_buffer_level ( VP9_COMP * cpi , int encoded_frame_size ) { const VP9_COMMON * const cm = & cpi -> common ; const VP9_CONFIG * oxcf = & cpi -> oxcf ; RATE_CONTROL * const rc = & cpi -> rc ; if ( ! cm -> show_frame ) { rc -> bits_off_target -= encoded_frame_size ; } else { rc -> bits_off_target += rc -> av_per_frame_bandwidth - encoded_frame_size ; } rc -> bits_off_target = MIN ( rc -> bits_off_target , oxcf -> maximum_buffer_size ) ; rc -> buffer_level = rc -> bits_off_target ; if ( cpi -> use_svc && cpi -> oxcf . end_usage == USAGE_STREAM_FROM_SERVER ) { 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.