summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorPaul Wilkins <paulwilkins@google.com>2012-11-05 12:32:49 +0000
committerPaul Wilkins <paulwilkins@google.com>2012-11-12 11:31:12 +0000
commit6fb8953c190430bbc324b57efa0297f6a612d7c7 (patch)
treecd84a8802c13f488a1199c819fd65b4bf9a30760 /vp9
parentd01357bbad6fb495f16c763add16dcc351a6f8b3 (diff)
downloadlibvpx-6fb8953c190430bbc324b57efa0297f6a612d7c7.tar
libvpx-6fb8953c190430bbc324b57efa0297f6a612d7c7.tar.gz
libvpx-6fb8953c190430bbc324b57efa0297f6a612d7c7.tar.bz2
libvpx-6fb8953c190430bbc324b57efa0297f6a612d7c7.zip
Restrict ref mv search range.
Experiment to test speed trade off of reducing the extent of the ref mv search. Reducing the maximum number of tested candidates to 9 had minimal net effect on quality in any of the tests sets. Reduction to 7 has a small negative impact (worst was STD-HD at about -0.2%). This change is in response to the apparently high number of decode cycles reported in regard to mv-ref selection. Change-Id: I0e92e92e324337689358495a1ec9ccdeb23dc774
Diffstat (limited to 'vp9')
-rw-r--r--vp9/common/blockd.h2
-rw-r--r--vp9/common/mvref_common.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/vp9/common/blockd.h b/vp9/common/blockd.h
index 862335483..300c01f96 100644
--- a/vp9/common/blockd.h
+++ b/vp9/common/blockd.h
@@ -44,7 +44,7 @@ void vpx_log(const char *format, ...);
/* Segment Feature Masks */
#define SEGMENT_DELTADATA 0
#define SEGMENT_ABSDATA 1
-#define MAX_MV_REFS 19
+#define MAX_MV_REFS 9
typedef struct {
int r, c;
diff --git a/vp9/common/mvref_common.c b/vp9/common/mvref_common.c
index d6faa138d..67f2fb0fb 100644
--- a/vp9/common/mvref_common.c
+++ b/vp9/common/mvref_common.c
@@ -290,7 +290,7 @@ void vp9_find_mv_refs(
// Populate a list with candidate reference vectors from the
// spatial neighbours.
- for (i = 2; i < MVREF_NEIGHBOURS; ++i) {
+ for (i = 2; (i < MVREF_NEIGHBOURS) && (index < (MAX_MV_REFS - 2)); ++i) {
if (((mv_ref_search[i][0] << 7) >= xd->mb_to_left_edge) &&
((mv_ref_search[i][1] << 7) >= xd->mb_to_top_edge)) {
@@ -323,6 +323,11 @@ void vp9_find_mv_refs(
}
}
+ // Make sure we are able to add 0,0
+ if (index > (MAX_MV_REFS - 1)) {
+ index = (MAX_MV_REFS - 1);
+ }
+
// 0,0 is always a valid reference.
for (i = 0; i < index; ++i)
if (candidate_mvs[i].as_int == 0)