Commit 2726f383 authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Adding allow_hp as an argument to mv search functions.

Making this change in order to move allow_high_precision_mv field
from MACROBLOCKD structure to VP9_COMMON (because it is a frame level
flag).

Change-Id: I1d006ba36d938e0caf4d40fa051e2e38df9c1108
parent 518fc282
......@@ -61,6 +61,7 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
best_err = cpi->find_fractional_mv_step(
x,
&dst_mv->as_mv, &ref_mv->as_mv,
xd->allow_high_precision_mv,
x->errorperbit, &v_fn_ptr,
0, cpi->sf.subpel_iters_per_step, NULL, NULL,
& distortion, &sse);
......
......@@ -275,6 +275,7 @@ void vp9_init3smotion_compensation(MACROBLOCK *x, int stride) {
int vp9_find_best_sub_pixel_iterative(MACROBLOCK *x,
MV *bestmv, const MV *ref_mv,
int allow_hp,
int error_per_bit,
const vp9_variance_fn_ptr_t *vfp,
int forced_stop,
......@@ -348,8 +349,7 @@ int vp9_find_best_sub_pixel_iterative(MACROBLOCK *x,
}
}
if (xd->allow_high_precision_mv && vp9_use_mv_hp(ref_mv) &&
forced_stop == 0) {
if (allow_hp && vp9_use_mv_hp(ref_mv) && forced_stop == 0) {
hstep >>= 1;
while (eighthiters--) {
FIRST_LEVEL_CHECKS;
......@@ -373,6 +373,7 @@ int vp9_find_best_sub_pixel_iterative(MACROBLOCK *x,
int vp9_find_best_sub_pixel_tree(MACROBLOCK *x,
MV *bestmv, const MV *ref_mv,
int allow_hp,
int error_per_bit,
const vp9_variance_fn_ptr_t *vfp,
int forced_stop,
......@@ -436,8 +437,7 @@ int vp9_find_best_sub_pixel_tree(MACROBLOCK *x,
tc = bc;
}
if (xd->allow_high_precision_mv && vp9_use_mv_hp(ref_mv) &&
forced_stop == 0) {
if (allow_hp && vp9_use_mv_hp(ref_mv) && forced_stop == 0) {
hstep >>= 1;
FIRST_LEVEL_CHECKS;
if (eighthiters > 1) {
......@@ -465,6 +465,7 @@ int vp9_find_best_sub_pixel_tree(MACROBLOCK *x,
int vp9_find_best_sub_pixel_comp_iterative(MACROBLOCK *x,
MV *bestmv, const MV *ref_mv,
int allow_hp,
int error_per_bit,
const vp9_variance_fn_ptr_t *vfp,
int forced_stop,
......@@ -544,8 +545,7 @@ int vp9_find_best_sub_pixel_comp_iterative(MACROBLOCK *x,
}
}
if (xd->allow_high_precision_mv && vp9_use_mv_hp(ref_mv) &&
forced_stop == 0) {
if (allow_hp && vp9_use_mv_hp(ref_mv) && forced_stop == 0) {
hstep >>= 1;
while (eighthiters--) {
FIRST_LEVEL_CHECKS;
......@@ -568,6 +568,7 @@ int vp9_find_best_sub_pixel_comp_iterative(MACROBLOCK *x,
int vp9_find_best_sub_pixel_comp_tree(MACROBLOCK *x,
MV *bestmv, const MV *ref_mv,
int allow_hp,
int error_per_bit,
const vp9_variance_fn_ptr_t *vfp,
int forced_stop,
......@@ -642,8 +643,7 @@ int vp9_find_best_sub_pixel_comp_tree(MACROBLOCK *x,
tc = bc;
}
if (xd->allow_high_precision_mv && vp9_use_mv_hp(ref_mv) &&
forced_stop == 0) {
if (allow_hp && vp9_use_mv_hp(ref_mv) && forced_stop == 0) {
hstep >>= 1;
FIRST_LEVEL_CHECKS;
if (eighthiters > 1) {
......
......@@ -74,6 +74,7 @@ int vp9_square_search(MACROBLOCK *x,
typedef int (fractional_mv_step_fp) (
MACROBLOCK *x,
MV *bestmv, const MV *ref_mv,
int allow_hp,
int error_per_bit,
const vp9_variance_fn_ptr_t *vfp,
int forced_stop, // 0 - full, 1 - qtr only, 2 - half only
......@@ -88,6 +89,7 @@ extern fractional_mv_step_fp vp9_find_best_sub_pixel_tree;
typedef int (fractional_mv_step_comp_fp) (
MACROBLOCK *x,
MV *bestmv, const MV *ref_mv,
int allow_hp,
int error_per_bit,
const vp9_variance_fn_ptr_t *vfp,
int forced_stop, // 0 - full, 1 - qtr only, 2 - half only
......
......@@ -1870,6 +1870,7 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
cpi->find_fractional_mv_step(x,
&mode_mv[NEWMV].as_mv,
&bsi->ref_mv->as_mv,
x->e_mbd.allow_high_precision_mv,
x->errorperbit, v_fn_ptr,
0, cpi->sf.subpel_iters_per_step,
x->nmvjointcost, x->mvcost,
......@@ -2450,6 +2451,7 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
int dis; /* TODO: use dis in distortion calculation later. */
unsigned int sse;
cpi->find_fractional_mv_step(x, &tmp_mv->as_mv, &ref_mv.as_mv,
xd->allow_high_precision_mv,
x->errorperbit,
&cpi->fn_ptr[block_size],
0, cpi->sf.subpel_iters_per_step,
......@@ -2585,6 +2587,7 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
bestsme = cpi->find_fractional_mv_step_comp(
x, &tmp_mv.as_mv,
&ref_mv[id].as_mv,
xd->allow_high_precision_mv,
x->errorperbit,
&cpi->fn_ptr[block_size],
0, cpi->sf.subpel_iters_per_step,
......
......@@ -166,6 +166,7 @@ static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi,
// Ignore mv costing by sending NULL pointer instead of cost array
bestsme = cpi->find_fractional_mv_step(x, &ref_mv->as_mv,
&best_ref_mv1.as_mv,
xd->allow_high_precision_mv,
x->errorperbit,
&cpi->fn_ptr[BLOCK_16X16],
0, cpi->sf.subpel_iters_per_step,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment