summaryrefslogtreecommitdiff
path: root/vp8/encoder/mcomp.c
diff options
context:
space:
mode:
authorYunqing Wang <yunqingwang@google.com>2011-05-03 11:59:32 -0700
committerCode Review <code-review@webmproject.org>2011-05-03 11:59:32 -0700
commit3fbade23a2c6eb060f7c65df210bc84f1a801165 (patch)
tree267c5716d6bf48711a226a40a691d05a3320bcd9 /vp8/encoder/mcomp.c
parente9465daee385e1b288ff559b2b65527bca2364f6 (diff)
parent04ec930abc97892eba8f0914fad0016b1d13b733 (diff)
downloadlibvpx-3fbade23a2c6eb060f7c65df210bc84f1a801165.tar
libvpx-3fbade23a2c6eb060f7c65df210bc84f1a801165.tar.gz
libvpx-3fbade23a2c6eb060f7c65df210bc84f1a801165.tar.bz2
libvpx-3fbade23a2c6eb060f7c65df210bc84f1a801165.zip
Merge "Modify HEX search"
Diffstat (limited to 'vp8/encoder/mcomp.c')
-rw-r--r--vp8/encoder/mcomp.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/vp8/encoder/mcomp.c b/vp8/encoder/mcomp.c
index 651890d81..9d447b210 100644
--- a/vp8/encoder/mcomp.c
+++ b/vp8/encoder/mcomp.c
@@ -831,7 +831,9 @@ int vp8_hex_search
)
{
MV hex[6] = { { -1, -2}, {1, -2}, {2, 0}, {1, 2}, { -1, 2}, { -2, 0} } ;
- MV neighbors[8] = { { -1, -1}, {0, -1}, {1, -1}, { -1, 0}, {1, 0}, { -1, 1}, {0, 1}, {1, 1} } ;
+ //MV neighbors[8] = { { -1, -1}, {0, -1}, {1, -1}, { -1, 0}, {1, 0}, { -1, 1}, {0, 1}, {1, 1} } ;
+ MV neighbors[4] = {{0, -1}, { -1, 0}, {1, 0}, {0, 1}} ;
+
int i, j;
unsigned char *src = (*(b->base_src) + b->src);
int src_stride = b->src_stride;
@@ -918,24 +920,31 @@ int vp8_hex_search
break;
}
- // check 8 1 away neighbors
+ // check 4 1-away neighbors
cal_neighbors:
- tr = br;
- tc = bc;
- for (i = 0; i < 8; i++)
+ for (j = 0; j < 32; j++)
{
- int nr = tr + neighbors[i].row, nc = tc + neighbors[i].col;
+ tr = br;
+ tc = bc;
- if (nc < x->mv_col_min) continue;
+ for (i = 0; i < 4; i++)
+ {
+ int nr = tr + neighbors[i].row, nc = tc + neighbors[i].col;
- if (nc > x->mv_col_max) continue;
+ if (nc < x->mv_col_min) continue;
- if (nr < x->mv_row_min) continue;
+ if (nc > x->mv_col_max) continue;
- if (nr > x->mv_row_max) continue;
+ if (nr < x->mv_row_min) continue;
+
+ if (nr > x->mv_row_max) continue;
+
+ CHECK_BETTER(thiserr, nr, nc);
+ }
- CHECK_BETTER(thiserr, nr, nc);
+ if (tr == br && tc == bc)
+ break;
}
best_mv->row = br;