av1/encoder/encodeframe.c
// Checks to see if a super block is on a horizontal image edge.
// In most cases this is the "real" edge unless there are formatting
// bars embedded in the stream.
Checks to see if a super block is on a horizontal image edge.
In most cases this is the "real" edge unless there are formatting
bars embedded in the stream.
Checks to see if a super block is on a horizontal image edge . In most cases this is the " real " edge unless there are formatting bars embedded in the stream .
static int active_h_edge(const AV1_COMP *cpi, int mi_row, int mi_step) {
  int top_edge = 0;
  int bottom_edge = cpi->common.mi_rows;
  int is_active_h_edge = 0;
  if (is_stat_consumption_stage_twopass(cpi)) {
    const AV1_COMMON *const cm = &cpi->common;
    const FIRSTPASS_STATS *const this_frame_stats = read_one_frame_stats(
        &cpi->twopass, cm->current_frame.display_order_hint);
    if (this_frame_stats == NULL) return AOM_CODEC_ERROR;
    top_edge += (int)(this_frame_stats->inactive_zone_rows * 4);
    bottom_edge -= (int)(this_frame_stats->inactive_zone_rows * 4);
    bottom_edge = AOMMAX(top_edge, bottom_edge);
  }
  if (((top_edge >= mi_row) && (top_edge < (mi_row + mi_step))) ||
      ((bottom_edge >= mi_row) && (bottom_edge < (mi_row + mi_step)))) {
    is_active_h_edge = 1;
  }
  return is_active_h_edge;
}
static int active_h_edge ( const AV1_COMP * cpi , int mi_row , int mi_step ) { int top_edge = 0 ; int bottom_edge = cpi -> common . mi_rows ; int is_active_h_edge = 0 ; if ( is_stat_consumption_stage_twopass ( cpi ) ) { const AV1_COMMON * const cm = & cpi -> common ; const FIRSTPASS_STATS * const this_frame_stats = read_one_frame_stats ( & cpi -> twopass , cm -> current_frame . display_order_hint ) ; if ( this_frame_stats == NULL ) return AOM_CODEC_ERROR ; top_edge += ( int ) ( this_frame_stats -> inactive_zone_rows * 4 ) ; bottom_edge -= ( int ) ( this_frame_stats -> inactive_zone_rows * 4 ) ; bottom_edge = AOMMAX ( top_edge , bottom_edge ) ; } if ( ( ( top_edge >= mi_row ) && ( top_edge < ( mi_row + mi_step ) ) ) || ( ( bottom_edge >= mi_row ) && ( bottom_edge < ( mi_row + mi_step ) ) ) ) { is_active_h_edge = 1 ; } return is_active_h_edge ; }
Checks to see if a super block is on a horizontal image edge.
Checks to see if a super block is on a horizontal image edge .
// For two pass account for any formatting bars detected. // The inactive region is specified in MBs not mi units. // The image edge is in the following MB row.