/* * Copyright (c) 2019, Alliance for Open Media. All rights reserved. * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
#if !CONFIG_REALTIME_ONLY // Early terminates PARTITION_NONE using simple_motion_search features and the // rate, distortion, and rdcost of PARTITION_NONE. This is only called when: // - The frame is a show frame // - The frame is not intra only // - The current bsize is > BLOCK_8X8 // - blk_row + blk_height/2 < total_rows and blk_col + blk_width/2 < total_cols void av1_simple_motion_search_early_term_none(AV1_COMP *const cpi,
MACROBLOCK *x,
SIMPLE_MOTION_DATA_TREE *sms_tree, const RD_STATS *none_rdc,
PartitionSearchState *part_state);
// Get the features for selecting the max and min partition size. Currently this // performs simple_motion_search on 16X16 subblocks of the current superblock, // and then extract the statistics of sse and motion vectors as features. void av1_get_max_min_partition_features(AV1_COMP *const cpi, MACROBLOCK *x, int mi_row, int mi_col, float *features);
// Predict the maximum BLOCK_SIZE to be used to encoder the current superblock.
BLOCK_SIZE av1_predict_max_partition(const AV1_COMP *const cpi, const MACROBLOCK *const x, constfloat *features);
// Attempts an early termination after PARTITION_SPLIT. void av1_ml_early_term_after_split(AV1_COMP *const cpi, MACROBLOCK *const x,
SIMPLE_MOTION_DATA_TREE *const sms_tree,
int64_t best_rd, int64_t part_none_rd,
int64_t part_split_rd,
int64_t *split_block_rd,
PartitionSearchState *part_state);
// Use the rdcost ratio and source var ratio to prune PARTITION_HORZ and // PARTITION_VERT. // TODO(chiyotsai@google.com): Currently this model does not use q value and has // no information about rectangular partitions. Preliminary experiments suggest // that we can get better performance by adding in q_index and rectangular // sse/var from SMS. We should retrain and tune this model later. void av1_ml_prune_rect_partition(AV1_COMP *const cpi, const MACROBLOCK *const x,
int64_t best_rd, int64_t none_rd, const int64_t *split_rd,
PartitionSearchState *part_state);
// Use a ML model to predict if horz4 and vert4 should be considered. void av1_ml_prune_4_partition(AV1_COMP *const cpi, MACROBLOCK *const x, int part_ctx, int64_t best_rd,
PartitionSearchState *part_state, int *part4_allowed, unsignedint pb_source_variance);
// The first round of partition pruning determined before any partition // has been tested. The decisions will be updated and passed back // to the partition search function. void av1_prune_partitions_before_search(AV1_COMP *const cpi,
MACROBLOCK *const x,
SIMPLE_MOTION_DATA_TREE *const sms_tree,
PartitionSearchState *part_state);
// Prune out partitions that lead to coding block sizes outside the min and max // bsizes set by the encoder. Max and min square partition levels are defined as // the partition nodes that the recursive function rd_pick_partition() can // reach. To implement this: only PARTITION_NONE is allowed if the current node // equals max_partition_size, only PARTITION_SPLIT is allowed if the current // node exceeds max_partition_size. void av1_prune_partitions_by_max_min_bsize(SuperBlockEnc *sb_enc,
PartitionSearchState *part_state);
// Prune out AB partitions based on rd decisions made from testing the // basic partitions. void av1_prune_ab_partitions(AV1_COMP *cpi, const MACROBLOCK *x, const PC_TREE *pc_tree, int pb_source_variance,
int64_t best_rdcost, const RD_RECT_PART_WIN_INFO *rect_part_win_info, bool ext_partition_allowed,
PartitionSearchState *part_state, int *ab_partitions_allowed);
// Set up destination pointers.
av1_setup_dst_planes(xd->plane, bsize, &cm->cur_frame->buf, mi_row, mi_col, 0,
num_planes);
// Set up limit values for MV components. // Mv beyond the range do not produce new/different prediction block.
av1_set_mv_limits(mi_params, &x->mv_limits, mi_row, mi_col, mi_height,
mi_width, cpi->oxcf.border_in_pixels);
#if !CONFIG_REALTIME_ONLY // Do not use this criteria for screen content videos. // Since screen content videos could often find good predictors and the largest // block size is likely to be used. staticinlineint use_auto_max_partition(const AV1_COMP *const cpi,
BLOCK_SIZE sb_size, int mi_row, int mi_col) {
assert(IMPLIES(cpi->ppi->gf_group.size > 0,
cpi->gf_frame_index < cpi->ppi->gf_group.size)); const AV1_COMMON *const cm = &cpi->common; return !frame_is_intra_only(cm) && !cpi->use_screen_content_tools &&
cpi->sf.part_sf.auto_max_partition_based_on_simple_motion !=
NOT_IN_USE &&
sb_size == BLOCK_128X128 &&
is_full_sb(&cm->mi_params, mi_row, mi_col, sb_size) &&
cpi->ppi->gf_group.update_type[cpi->gf_frame_index] !=
OVERLAY_UPDATE &&
cpi->ppi->gf_group.update_type[cpi->gf_frame_index] !=
INTNL_OVERLAY_UPDATE;
}
static BLOCK_SIZE dim_to_size(int dim) { switch (dim) { case 4: return BLOCK_4X4; case 8: return BLOCK_8X8; case 16: return BLOCK_16X16; case 32: return BLOCK_32X32; case 64: return BLOCK_64X64; case 128: return BLOCK_128X128; default: assert(0); return 0;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.