Commit 04ec930a authored by Yunqing Wang's avatar Yunqing Wang
Browse files

Modify HEX search

Changed 8-neighbor searching to 4-neighour searching, and continued
searching until the center point is the best match.

Test on test set showed 1.3% encoding speed improvement as well as
0.1% PSNR and SSIM improvement at speed=-5 (rt mode).

Will continue to improve it.

Change-Id: If4993b1907dd742b906fd3f86fee77cc5932ee9a
parent 5abafcc3
......@@ -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,12 +920,15 @@ int vp8_hex_search
break;
}
// check 8 1 away neighbors
// check 4 1-away neighbors
cal_neighbors:
for (j = 0; j < 32; j++)
{
tr = br;
tc = bc;
for (i = 0; i < 8; i++)
for (i = 0; i < 4; i++)
{
int nr = tr + neighbors[i].row, nc = tc + neighbors[i].col;
......@@ -938,6 +943,10 @@ cal_neighbors:
CHECK_BETTER(thiserr, nr, nc);
}
if (tr == br && tc == bc)
break;
}
best_mv->row = br;
best_mv->col = bc;
......
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