static double diamond_search_sad_new(const MACROBLOCK *x,
const search_site_config *cfg,
const MV *init_full_mv, MV *best_full_mv,
- double *best_mv_dist, double *best_mv_cost,
int search_param, int lambda, int *num00,
const vp9_variance_fn_ptr_t *fn_ptr,
const int_mv *nb_full_mvs,
best_address = in_what;
// Check the starting position
- *best_mv_dist = fn_ptr->sdf(what, what_stride, in_what, in_what_stride);
- *best_mv_cost =
- vp9_nb_mvs_inconsistency(best_full_mv, nb_full_mvs, full_mv_num) /
- (double)(1 << LOG2_PRECISION);
- bestsad = (*best_mv_dist) + lambda * (*best_mv_cost);
+ {
+ const double mv_dist =
+ fn_ptr->sdf(what, what_stride, in_what, in_what_stride);
+ const double mv_cost =
+ vp9_nb_mvs_inconsistency(best_full_mv, nb_full_mvs, full_mv_num) /
+ (double)(1 << LOG2_PRECISION);
+ bestsad = mv_dist + lambda * mv_cost;
+ }
i = 0;
double thissad = mv_dist + lambda * mv_cost;
if (thissad < bestsad) {
bestsad = thissad;
- *best_mv_dist = mv_dist;
- *best_mv_cost = mv_cost;
best_site = i;
}
}
double thissad = mv_dist + lambda * mv_cost;
if (thissad < bestsad) {
bestsad = thissad;
- *best_mv_dist = mv_dist;
- *best_mv_cost = mv_cost;
best_site = i;
}
}
int do_refine,
const vp9_variance_fn_ptr_t *fn_ptr,
const int_mv *nb_full_mvs, int full_mv_num,
- MV *best_mv, double *best_mv_dist,
- double *best_mv_cost) {
+ MV *best_mv) {
int n, num00 = 0;
double thissme;
double bestsme;
const int further_steps = MAX_MVSEARCH_STEPS - 1 - step_param;
const MV center_mv = { 0, 0 };
vpx_clear_system_state();
- bestsme = diamond_search_sad_new(
- x, &cpi->ss_cfg, mvp_full, best_mv, best_mv_dist, best_mv_cost,
- step_param, lambda, &n, fn_ptr, nb_full_mvs, full_mv_num);
+ bestsme =
+ diamond_search_sad_new(x, &cpi->ss_cfg, mvp_full, best_mv, step_param,
+ lambda, &n, fn_ptr, nb_full_mvs, full_mv_num);
bestsme = vp9_get_mvpred_var(x, best_mv, ¢er_mv, fn_ptr, 0);
num00--;
} else {
MV temp_mv;
- double mv_dist;
- double mv_cost;
- thissme = diamond_search_sad_new(
- x, &cpi->ss_cfg, mvp_full, &temp_mv, &mv_dist, &mv_cost,
- step_param + n, lambda, &num00, fn_ptr, nb_full_mvs, full_mv_num);
+ thissme = diamond_search_sad_new(x, &cpi->ss_cfg, mvp_full, &temp_mv,
+ step_param + n, lambda, &num00, fn_ptr,
+ nb_full_mvs, full_mv_num);
thissme = vp9_get_mvpred_var(x, &temp_mv, ¢er_mv, fn_ptr, 0);
// check to see if refining search is needed.
if (num00 > further_steps - n) do_refine = 0;
if (thissme < bestsme) {
bestsme = thissme;
*best_mv = temp_mv;
- *best_mv_dist = mv_dist;
- *best_mv_cost = mv_cost;
}
}
}
if (do_refine) {
const int search_range = 8;
MV temp_mv = *best_mv;
- double mv_dist;
- double mv_cost;
- thissme = vp9_refining_search_sad_new(x, &temp_mv, &mv_dist, &mv_cost,
- lambda, search_range, fn_ptr,
- nb_full_mvs, full_mv_num);
+ thissme = vp9_refining_search_sad_new(x, &temp_mv, lambda, search_range,
+ fn_ptr, nb_full_mvs, full_mv_num);
thissme = vp9_get_mvpred_var(x, &temp_mv, ¢er_mv, fn_ptr, 0);
if (thissme < bestsme) {
bestsme = thissme;
*best_mv = temp_mv;
- *best_mv_dist = mv_dist;
- *best_mv_cost = mv_cost;
}
}
#if CONFIG_NON_GREEDY_MV
double vp9_refining_search_sad_new(const MACROBLOCK *x, MV *best_full_mv,
- double *best_mv_dist, double *best_mv_cost,
int lambda, int search_range,
const vp9_variance_fn_ptr_t *fn_ptr,
const int_mv *nb_full_mvs, int full_mv_num) {
double best_sad;
int i, j;
vpx_clear_system_state();
- *best_mv_dist =
- fn_ptr->sdf(what->buf, what->stride, best_address, in_what->stride);
- *best_mv_cost =
- vp9_nb_mvs_inconsistency(best_full_mv, nb_full_mvs, full_mv_num) /
- (double)(1 << LOG2_PRECISION);
- best_sad = (*best_mv_dist) + lambda * (*best_mv_cost);
+ {
+ const double mv_dist =
+ fn_ptr->sdf(what->buf, what->stride, best_address, in_what->stride);
+ const double mv_cost =
+ vp9_nb_mvs_inconsistency(best_full_mv, nb_full_mvs, full_mv_num) /
+ (double)(1 << LOG2_PRECISION);
+ best_sad = mv_dist + lambda * mv_cost;
+ }
for (i = 0; i < search_range; i++) {
int best_site = -1;
const double thissad = mv_dist + lambda * mv_cost;
if (thissad < best_sad) {
best_sad = thissad;
- *best_mv_dist = mv_dist;
- *best_mv_cost = mv_cost;
best_site = j;
}
}
const double thissad = mv_dist + lambda * mv_cost;
if (thissad < best_sad) {
best_sad = thissad;
- *best_mv_dist = mv_dist;
- *best_mv_cost = mv_cost;
best_site = j;
}
}
MV pred_mv[3];
#if CONFIG_NON_GREEDY_MV
- double mv_dist = 0;
- double mv_cost = 0;
double bestsme;
int_mv nb_full_mvs[NB_MVS_NUM];
const int nb_full_mv_num = NB_MVS_NUM;
mvp_full.row >>= 3;
#if CONFIG_NON_GREEDY_MV
- bestsme = vp9_full_pixel_diamond_new(
- cpi, x, &mvp_full, step_param, lambda, 1, &cpi->fn_ptr[bsize],
- nb_full_mvs, nb_full_mv_num, &tmp_mv->as_mv, &mv_dist, &mv_cost);
+ bestsme = vp9_full_pixel_diamond_new(cpi, x, &mvp_full, step_param, lambda, 1,
+ &cpi->fn_ptr[bsize], nb_full_mvs,
+ nb_full_mv_num, &tmp_mv->as_mv);
#else // CONFIG_NON_GREEDY_MV
bestsme = vp9_full_pixel_search(
cpi, x, bsize, &mvp_full, step_param, cpi->sf.mv.search_method, sadpb,
#if CONFIG_NON_GREEDY_MV
this_me = vp9_full_pixel_diamond_new(
cpi, x, &mvp_full, VPXMAX(step_param, MAX_MVSEARCH_STEPS - step),
- lambda, 1, &cpi->fn_ptr[bsize], nb_full_mvs, nb_full_mv_num, &this_mv,
- &mv_dist, &mv_cost);
+ lambda, 1, &cpi->fn_ptr[bsize], nb_full_mvs, nb_full_mv_num,
+ &this_mv);
#else // CONFIG_NON_GREEDY_MV
this_me = vp9_full_pixel_search(
cpi, x, bsize, &mvp_full,