av1/encoder/encoder.c
// Calculates resize and superres params for next frame
Calculates resize and superres params for next frame
Calculates resize and superres params for next frame
static size_params_type calculate_next_size_params(AV1_COMP *cpi) {
  const AV1EncoderConfig *oxcf = &cpi->oxcf;
  size_params_type rsz = { oxcf->width, oxcf->height, SCALE_NUMERATOR };
  int resize_denom = SCALE_NUMERATOR;
  if (has_no_stats_stage(cpi) && cpi->use_svc &&
      cpi->svc.spatial_layer_id < cpi->svc.number_spatial_layers - 1) {
    rsz.resize_width = cpi->common.width;
    rsz.resize_height = cpi->common.height;
    return rsz;
  }
  if (is_stat_generation_stage(cpi)) return rsz;
  if (cpi->resize_pending_width && cpi->resize_pending_height) {
    rsz.resize_width = cpi->resize_pending_width;
    rsz.resize_height = cpi->resize_pending_height;
    cpi->resize_pending_width = cpi->resize_pending_height = 0;
  } else {
    resize_denom = calculate_next_resize_scale(cpi);
    rsz.resize_width = cpi->oxcf.width;
    rsz.resize_height = cpi->oxcf.height;
    av1_calculate_scaled_size(&rsz.resize_width, &rsz.resize_height,
                              resize_denom);
  }
  rsz.superres_denom = calculate_next_superres_scale(cpi);
  if (!validate_size_scales(oxcf->resize_mode, oxcf->superres_mode, oxcf->width,
                            oxcf->height, &rsz))
    assert(0 && "Invalid scale parameters");
  return rsz;
}
static size_params_type calculate_next_size_params ( AV1_COMP * cpi ) { const AV1EncoderConfig * oxcf = & cpi -> oxcf ; size_params_type rsz = { oxcf -> width , oxcf -> height , SCALE_NUMERATOR } ; int resize_denom = SCALE_NUMERATOR ; if ( has_no_stats_stage ( cpi ) && cpi -> use_svc && cpi -> svc . spatial_layer_id < cpi -> svc . number_spatial_layers - 1 ) { rsz . resize_width = cpi -> common . width ; rsz . resize_height = cpi -> common . height ; return rsz ; } if ( is_stat_generation_stage ( cpi ) ) return rsz ; if ( cpi -> resize_pending_width && cpi -> resize_pending_height ) { rsz . resize_width = cpi -> resize_pending_width ; rsz . resize_height = cpi -> resize_pending_height ; cpi -> resize_pending_width = cpi -> resize_pending_height = 0 ; } else { resize_denom = calculate_next_resize_scale ( cpi ) ; rsz . resize_width = cpi -> oxcf . width ; rsz . resize_height = cpi -> oxcf . height ; av1_calculate_scaled_size ( & rsz . resize_width , & rsz . resize_height , resize_denom ) ; } rsz . superres_denom = calculate_next_superres_scale ( cpi ) ; if ( ! validate_size_scales ( oxcf -> resize_mode , oxcf -> superres_mode , oxcf -> width , oxcf -> height , & rsz ) ) assert ( 0 && " " ) ; return rsz ; }
Calculates resize and superres params for next frame
Calculates resize and superres params for next frame