av1/encoder/encodeframe.c
// Try searching for an encoding for the given subblock. Returns zero if the
// rdcost is already too high (to tell the caller not to bother searching for
// encodings of further subblocks)
Try searching for an encoding for the given subblock. Returns zero if the
rdcost is already too high (to tell the caller not to bother searching for
encodings of further subblocks)
Try searching for an encoding for the given subblock . Returns zero if the rdcost is already too high ( to tell the caller not to bother searching for encodings of further subblocks )
static int rd_try_subblock(AV1_COMP *const cpi, ThreadData *td,
                           TileDataEnc *tile_data, TOKENEXTRA **tp, int is_last,
                           int mi_row, int mi_col, BLOCK_SIZE subsize,
                           RD_STATS best_rdcost, RD_STATS *sum_rdc,
                           PARTITION_TYPE partition,
                           PICK_MODE_CONTEXT *prev_ctx,
                           PICK_MODE_CONTEXT *this_ctx) {
  MACROBLOCK *const x = &td->mb;
  const int orig_mult = x->rdmult;
  setup_block_rdmult(cpi, x, mi_row, mi_col, subsize, NO_AQ, NULL);
  av1_rd_cost_update(x->rdmult, &best_rdcost);
  if (cpi->sf.mv_sf.adaptive_motion_search) load_pred_mv(x, prev_ctx);
  RD_STATS rdcost_remaining;
  av1_rd_stats_subtraction(x->rdmult, &best_rdcost, sum_rdc, &rdcost_remaining);
  RD_STATS this_rdc;
  pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &this_rdc, partition,
                subsize, this_ctx, rdcost_remaining, PICK_MODE_RD);
  if (this_rdc.rate == INT_MAX) {
    sum_rdc->rdcost = INT64_MAX;
  } else {
    sum_rdc->rate += this_rdc.rate;
    sum_rdc->dist += this_rdc.dist;
    av1_rd_cost_update(x->rdmult, sum_rdc);
  }
  if (sum_rdc->rdcost >= best_rdcost.rdcost) {
    x->rdmult = orig_mult;
    return 0;
  }
  if (!is_last) {
    update_state(cpi, td, this_ctx, mi_row, mi_col, subsize, 1);
    encode_superblock(cpi, tile_data, td, tp, DRY_RUN_NORMAL, subsize, NULL);
  }
  x->rdmult = orig_mult;
  return 1;
}
static int rd_try_subblock ( AV1_COMP * const cpi , ThreadData * td , TileDataEnc * tile_data , TOKENEXTRA * * tp , int is_last , int mi_row , int mi_col , BLOCK_SIZE subsize , RD_STATS best_rdcost , RD_STATS * sum_rdc , PARTITION_TYPE partition , PICK_MODE_CONTEXT * prev_ctx , PICK_MODE_CONTEXT * this_ctx ) { MACROBLOCK * const x = & td -> mb ; const int orig_mult = x -> rdmult ; setup_block_rdmult ( cpi , x , mi_row , mi_col , subsize , NO_AQ , NULL ) ; av1_rd_cost_update ( x -> rdmult , & best_rdcost ) ; if ( cpi -> sf . mv_sf . adaptive_motion_search ) load_pred_mv ( x , prev_ctx ) ; RD_STATS rdcost_remaining ; av1_rd_stats_subtraction ( x -> rdmult , & best_rdcost , sum_rdc , & rdcost_remaining ) ; RD_STATS this_rdc ; pick_sb_modes ( cpi , tile_data , x , mi_row , mi_col , & this_rdc , partition , subsize , this_ctx , rdcost_remaining , PICK_MODE_RD ) ; if ( this_rdc . rate == INT_MAX ) { sum_rdc -> rdcost = INT64_MAX ; } else { sum_rdc -> rate += this_rdc . rate ; sum_rdc -> dist += this_rdc . dist ; av1_rd_cost_update ( x -> rdmult , sum_rdc ) ; } if ( sum_rdc -> rdcost >= best_rdcost . rdcost ) { x -> rdmult = orig_mult ; return 0 ; } if ( ! is_last ) { update_state ( cpi , td , this_ctx , mi_row , mi_col , subsize , 1 ) ; encode_superblock ( cpi , tile_data , td , tp , DRY_RUN_NORMAL , subsize , NULL ) ; } x -> rdmult = orig_mult ; return 1 ; }
Try searching for an encoding for the given subblock.
Try searching for an encoding for the given subblock .