Merge "Support for a fast diamond search"
This commit is contained in:
Коммит
44a203f5cd
|
@ -882,6 +882,20 @@ int vp9_fast_hex_search(const MACROBLOCK *x,
|
||||||
center_mv, best_mv);
|
center_mv, best_mv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int vp9_fast_dia_search(const MACROBLOCK *x,
|
||||||
|
MV *ref_mv,
|
||||||
|
int search_param,
|
||||||
|
int sad_per_bit,
|
||||||
|
int do_init_search,
|
||||||
|
const vp9_variance_fn_ptr_t *vfp,
|
||||||
|
int use_mvcost,
|
||||||
|
const MV *center_mv,
|
||||||
|
MV *best_mv) {
|
||||||
|
return vp9_bigdia_search(x, ref_mv, MAX(MAX_MVSEARCH_STEPS - 2, search_param),
|
||||||
|
sad_per_bit, do_init_search, vfp, use_mvcost,
|
||||||
|
center_mv, best_mv);
|
||||||
|
}
|
||||||
|
|
||||||
#undef CHECK_BETTER
|
#undef CHECK_BETTER
|
||||||
|
|
||||||
int vp9_full_range_search_c(const MACROBLOCK *x, MV *ref_mv, MV *best_mv,
|
int vp9_full_range_search_c(const MACROBLOCK *x, MV *ref_mv, MV *best_mv,
|
||||||
|
|
|
@ -75,6 +75,7 @@ integer_mv_pattern_search_fn vp9_hex_search;
|
||||||
integer_mv_pattern_search_fn vp9_bigdia_search;
|
integer_mv_pattern_search_fn vp9_bigdia_search;
|
||||||
integer_mv_pattern_search_fn vp9_square_search;
|
integer_mv_pattern_search_fn vp9_square_search;
|
||||||
integer_mv_pattern_search_fn vp9_fast_hex_search;
|
integer_mv_pattern_search_fn vp9_fast_hex_search;
|
||||||
|
integer_mv_pattern_search_fn vp9_fast_dia_search;
|
||||||
|
|
||||||
typedef int (fractional_mv_step_fp) (
|
typedef int (fractional_mv_step_fp) (
|
||||||
const MACROBLOCK *x,
|
const MACROBLOCK *x,
|
||||||
|
|
|
@ -872,7 +872,7 @@ static void set_rt_speed_feature(VP9_COMMON *cm,
|
||||||
if (speed >= 7) {
|
if (speed >= 7) {
|
||||||
sf->partition_search_type = VAR_BASED_FIXED_PARTITION;
|
sf->partition_search_type = VAR_BASED_FIXED_PARTITION;
|
||||||
sf->use_nonrd_pick_mode = 1;
|
sf->use_nonrd_pick_mode = 1;
|
||||||
sf->search_method = FAST_HEX;
|
sf->search_method = FAST_DIAMOND;
|
||||||
}
|
}
|
||||||
if (speed >= 8) {
|
if (speed >= 8) {
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -137,7 +137,8 @@ typedef enum {
|
||||||
HEX = 2,
|
HEX = 2,
|
||||||
BIGDIA = 3,
|
BIGDIA = 3,
|
||||||
SQUARE = 4,
|
SQUARE = 4,
|
||||||
FAST_HEX = 5
|
FAST_HEX = 5,
|
||||||
|
FAST_DIAMOND = 6
|
||||||
} SEARCH_METHODS;
|
} SEARCH_METHODS;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|
|
@ -86,7 +86,12 @@ static int full_pixel_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
mvp_full.col >>= 3;
|
mvp_full.col >>= 3;
|
||||||
mvp_full.row >>= 3;
|
mvp_full.row >>= 3;
|
||||||
|
|
||||||
if (cpi->sf.search_method == FAST_HEX) {
|
if (cpi->sf.search_method == FAST_DIAMOND) {
|
||||||
|
// NOTE: this returns SAD
|
||||||
|
vp9_fast_dia_search(x, &mvp_full, step_param, sadpb, 0,
|
||||||
|
&cpi->fn_ptr[bsize], 1,
|
||||||
|
&ref_mv, &tmp_mv->as_mv);
|
||||||
|
} else if (cpi->sf.search_method == FAST_HEX) {
|
||||||
// NOTE: this returns SAD
|
// NOTE: this returns SAD
|
||||||
vp9_fast_hex_search(x, &mvp_full, step_param, sadpb, 0,
|
vp9_fast_hex_search(x, &mvp_full, step_param, sadpb, 0,
|
||||||
&cpi->fn_ptr[bsize], 1,
|
&cpi->fn_ptr[bsize], 1,
|
||||||
|
|
|
@ -2457,7 +2457,14 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
|
||||||
// Further step/diamond searches as necessary
|
// Further step/diamond searches as necessary
|
||||||
further_steps = (cpi->sf.max_step_search_steps - 1) - step_param;
|
further_steps = (cpi->sf.max_step_search_steps - 1) - step_param;
|
||||||
|
|
||||||
if (cpi->sf.search_method == FAST_HEX) {
|
if (cpi->sf.search_method == FAST_DIAMOND) {
|
||||||
|
bestsme = vp9_fast_dia_search(x, &mvp_full, step_param, sadpb, 0,
|
||||||
|
&cpi->fn_ptr[bsize], 1,
|
||||||
|
&ref_mv, &tmp_mv->as_mv);
|
||||||
|
if (bestsme < INT_MAX)
|
||||||
|
bestsme = vp9_get_mvpred_var(x, &tmp_mv->as_mv, &ref_mv,
|
||||||
|
&cpi->fn_ptr[bsize], 1);
|
||||||
|
} else if (cpi->sf.search_method == FAST_HEX) {
|
||||||
bestsme = vp9_fast_hex_search(x, &mvp_full, step_param, sadpb, 0,
|
bestsme = vp9_fast_hex_search(x, &mvp_full, step_param, sadpb, 0,
|
||||||
&cpi->fn_ptr[bsize], 1,
|
&cpi->fn_ptr[bsize], 1,
|
||||||
&ref_mv, &tmp_mv->as_mv);
|
&ref_mv, &tmp_mv->as_mv);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче