summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorPaul Wilkins <paulwilkins@google.com>2013-02-06 04:06:31 -0800
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2013-02-06 04:06:31 -0800
commit8b4e9c5925d16e2d61df72e79849766d6ea48343 (patch)
tree713200a20eadb550e698b420e3f1ba84abe74437 /vp9
parent278df745d2d73d71f8d2da8c185c0dde26886bc8 (diff)
parent81043e8d625efbafe0668b6b04f3dc812b65c4a4 (diff)
downloadlibvpx-8b4e9c5925d16e2d61df72e79849766d6ea48343.tar
libvpx-8b4e9c5925d16e2d61df72e79849766d6ea48343.tar.gz
libvpx-8b4e9c5925d16e2d61df72e79849766d6ea48343.tar.bz2
libvpx-8b4e9c5925d16e2d61df72e79849766d6ea48343.zip
Merge "Change definition of NearestMV." into experimental
Diffstat (limited to 'vp9')
-rw-r--r--vp9/common/vp9_findnearmv.c23
-rw-r--r--vp9/encoder/vp9_rdopt.c7
2 files changed, 10 insertions, 20 deletions
diff --git a/vp9/common/vp9_findnearmv.c b/vp9/common/vp9_findnearmv.c
index 88f2ea9c1..9585611dd 100644
--- a/vp9/common/vp9_findnearmv.c
+++ b/vp9/common/vp9_findnearmv.c
@@ -279,21 +279,16 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
clamp_mv2(&sorted_mvs[i], xd);
}
- // Provided that there are non zero vectors available there will not
- // be more than one 0,0 entry in the sorted list.
- // The best ref mv is always set to the first entry (which gave the best
- // results. The nearest is set to the first non zero vector if available and
- // near to the second non zero vector if available.
- // We do not use 0,0 as a nearest or near as 0,0 has its own mode.
- if ( sorted_mvs[0].as_int ) {
- nearest->as_int = sorted_mvs[0].as_int;
- if ( sorted_mvs[1].as_int )
- near->as_int = sorted_mvs[1].as_int;
- else
- near->as_int = sorted_mvs[2].as_int;
+ // Nearest may be a 0,0 or non zero vector and now matches the chosen
+ // "best reference". This has advantages when it is used as part of a
+ // compound predictor as it means a non zero vector can be paired using
+ // this mode with a 0 vector. The Near vector is still forced to be a
+ // non zero candidate if one is avaialble.
+ nearest->as_int = sorted_mvs[0].as_int;
+ if ( sorted_mvs[1].as_int ) {
+ near->as_int = sorted_mvs[1].as_int;
} else {
- nearest->as_int = sorted_mvs[1].as_int;
- near->as_int = sorted_mvs[2].as_int;
+ near->as_int = sorted_mvs[2].as_int;
}
// Copy back the re-ordered mv list
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 631a4e3a2..cd7e46915 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -3304,13 +3304,8 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
96, xd->allow_high_precision_mv);
}
break;
- case NEARESTMV:
case NEARMV:
- // Do not bother proceeding if the vector (from newmv, nearest or
- // near) is 0,0 as this should then be coded using the zeromv mode.
- for (i = 0; i < num_refs; ++i)
- if (frame_mv[this_mode][refs[i]].as_int == 0)
- return INT64_MAX;
+ case NEARESTMV:
case ZEROMV:
default:
break;