enum {
MV_COST_ENTROPY, // Use the entropy rate of the mv as the cost
MV_COST_L1_LOWRES, // Use the l1 norm of the mv as the cost (<480p)
MV_COST_L1_MIDRES, // Use the l1 norm of the mv as the cost (>=480p)
MV_COST_L1_HDRES, // Use the l1 norm of the mv as the cost (>=720p)
MV_COST_NONE // Use 0 as as cost irrespective of the current mv
} UENUM1BYTE(MV_COST_TYPE);
typedefstruct { // The reference mv used to compute the mv cost const MV *ref_mv;
FULLPEL_MV full_ref_mv;
MV_COST_TYPE mv_cost_type; const int *mvjcost; const int *mvcost[2];
int error_per_bit; // A multiplier used to convert rate to sad cost
int sad_per_bit;
} MV_COST_PARAMS;
int av1_mv_bit_cost(const MV *mv, const MV *ref_mv, const int *mvjcost,
int *const mvcost[2], int weight);
// The source and predictors/mask used by translational search conststruct buf_2d *src; const uint8_t *second_pred; const uint8_t *mask;
int mask_stride;
int inv_mask;
// The weighted source and mask used by OBMC const int32_t *wsrc; const int32_t *obmc_mask;
} MSBuffers;
// ============================================================================= // Fullpixel Motion Search // ============================================================================= // This struct holds fullpixel motion search parameters that should be constant // during the search typedefstruct {
BLOCK_SIZE bsize; // A function pointer to the simd function for fast computation const aom_variance_fn_ptr_t *vfp;
MSBuffers ms_buffers;
// WARNING: search_method should be regarded as a private variable and should // not be modified directly so it is in sync with search_sites. To modify it, // use av1_set_mv_search_method.
SEARCH_METHODS search_method; const search_site_config *search_sites;
FullMvLimits mv_limits;
int run_mesh_search; // Sets mesh search unless it got pruned by // prune_mesh_search.
int prune_mesh_search; // Disables mesh search if the best_mv after a normal // search if close to the start_mv.
int mesh_search_mv_diff_threshold; // mv diff threshold to enable // prune_mesh_search
int force_mesh_thresh; // Forces mesh search if the residue variance is // higher than the threshold. conststruct MESH_PATTERN *mesh_patterns[2];
// Use maximum search interval of 4 if true. This helps motion search to find // the best motion vector for screen content types.
int fine_search_interval;
int is_intra_mode;
int fast_obmc_search;
// For calculating mv cost
MV_COST_PARAMS mv_cost_params;
// Stores the function used to compute the sad. This can be different from the // sdf in vfp (e.g. downsampled sad and not sad) to allow speed up.
aom_sad_fn_t sdf;
aom_sad_multi_d_fn_t sdx4df;
aom_sad_multi_d_fn_t sdx3df;
} FULLPEL_MOTION_SEARCH_PARAMS;
typedefstruct {
int err_cost; unsigned int distortion; unsigned int sse;
} FULLPEL_MV_STATS;
/*! Sets the \ref FULLPEL_MOTION_SEARCH_PARAMS to intra mode. */ void av1_set_ms_to_intra_mode(FULLPEL_MOTION_SEARCH_PARAMS *ms_params, const IntraBCMVCosts *dv_costs);
// Sets up configs for firstpass motion search. void av1_init_motion_fpf(search_site_config *cfg, int stride);
/*! Function pointer to search site config initialization of different search
* method functions. */ typedefvoid (*av1_init_search_site_config)(search_site_config *cfg, int stride,
int level);
/*! Array of function pointers used to set the motion search config. */
extern const av1_init_search_site_config
av1_init_motion_compensation[NUM_DISTINCT_SEARCH_METHODS];
// Array to inform which all search methods are having // same candidates and different in number of search steps. staticconst SEARCH_METHODS search_method_lookup[NUM_SEARCH_METHODS] = {
DIAMOND, // DIAMOND
NSTEP, // NSTEP
NSTEP_8PT, // NSTEP_8PT
CLAMPED_DIAMOND, // CLAMPED_DIAMOND
HEX, // HEX
BIGDIA, // BIGDIA
BIGDIA, // FAST_DIAMOND
BIGDIA, // FAST_BIGDIA
BIGDIA // VFAST_DIAMOND
};
// Reinitialize the search site config. static inline void av1_refresh_search_site_config(
search_site_config *ss_cfg_buf, SEARCH_METHODS search_method, const int ref_stride) { const int level =
search_method == NSTEP_8PT || search_method == CLAMPED_DIAMOND;
search_method = search_method_lookup[search_method];
av1_init_motion_compensation[search_method](&ss_cfg_buf[search_method],
ref_stride, level);
}
// Mv beyond the range do not produce new/different prediction block. static inline void av1_set_mv_search_method(
FULLPEL_MOTION_SEARCH_PARAMS *ms_params, const search_site_config search_sites[NUM_DISTINCT_SEARCH_METHODS],
SEARCH_METHODS search_method) {
ms_params->search_method = search_method;
ms_params->search_sites =
&search_sites[search_method_lookup[ms_params->search_method]];
}
// Set up limit values for MV components. // Mv beyond the range do not produce new/different prediction block. static inline void av1_set_mv_row_limits( const CommonModeInfoParams *const mi_params, FullMvLimits *mv_limits,
int mi_row, int mi_height, int border) { const int min1 = -(mi_row * MI_SIZE + border - 2 * AOM_INTERP_EXTEND); const int min2 = -(((mi_row + mi_height) * MI_SIZE) + 2 * AOM_INTERP_EXTEND);
mv_limits->row_min = AOMMAX(min1, min2); const int max1 = (mi_params->mi_rows - mi_row - mi_height) * MI_SIZE +
border - 2 * AOM_INTERP_EXTEND; const int max2 =
(mi_params->mi_rows - mi_row) * MI_SIZE + 2 * AOM_INTERP_EXTEND;
mv_limits->row_max = AOMMIN(max1, max2);
}
int av1_vector_match(const int16_t *ref, const int16_t *src, int bwl,
int search_size_top, int search_size_bottom,
int full_search, int *sad);
unsigned int av1_int_pro_motion_estimation( conststruct AV1_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mi_row,
int mi_col, const MV *ref_mv, unsigned int *y_sad_zero,
int me_search_size_col, int me_search_size_row, int is_var_part,
int use_larger_search);
int av1_refining_search_8p_c(const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, const FULLPEL_MV start_mv, FULLPEL_MV *best_mv);
int av1_full_pixel_search(const FULLPEL_MV start_mv, const FULLPEL_MOTION_SEARCH_PARAMS *ms_params, const int step_param, int *cost_list,
FULLPEL_MV *best_mv, FULLPEL_MV_STATS *best_mv_stats,
FULLPEL_MV *second_best_mv);
typedefstruct { const aom_variance_fn_ptr_t *vfp;
SUBPEL_SEARCH_TYPE subpel_search_type; // Source and reference buffers
MSBuffers ms_buffers;
int w, h;
} SUBPEL_SEARCH_VAR_PARAMS;
// This struct holds subpixel motion search parameters that should be constant // during the search typedefstruct { // High level motion search settings
int allow_hp; const int *cost_list;
SUBPEL_FORCE_STOP forced_stop;
int iters_per_step;
SubpelMvLimits mv_limits;
// For calculating mv cost
MV_COST_PARAMS mv_cost_params;
unsigned int av1_refine_warped_mv(MACROBLOCKD *xd, const AV1_COMMON *const cm, const SUBPEL_MOTION_SEARCH_PARAMS *ms_params,
BLOCK_SIZE bsize, const int *pts0, const int *pts_inref0, int total_samples,
WARP_SEARCH_METHOD search_method,
int num_iterations);
static inline void av1_set_fractional_mv(int_mv *fractional_best_mv) {
for (int z = 0; z < 3; z++) {
fractional_best_mv[z].as_int = INVALID_MV;
}
}
static inline void av1_set_subpel_mv_search_range(SubpelMvLimits *subpel_limits, const FullMvLimits *mv_limits, const MV *ref_mv) { const int max_mv = GET_MV_SUBPEL(MAX_FULL_PEL_VAL);
int minc = AOMMAX(GET_MV_SUBPEL(mv_limits->col_min), ref_mv->col - max_mv);
int maxc = AOMMIN(GET_MV_SUBPEL(mv_limits->col_max), ref_mv->col + max_mv);
int minr = AOMMAX(GET_MV_SUBPEL(mv_limits->row_min), ref_mv->row - max_mv);
int maxr = AOMMIN(GET_MV_SUBPEL(mv_limits->row_max), ref_mv->row + max_mv);
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.