Add support for forced_stop equaling FULL_PEL
Current sub-pel mv search function didn't support "forced_stop == FULL_PEL"
case. Added this support in the function to provide the felexibility
while we don't need sub-pel search precision.
Change-Id: Ib0e4861001fe5a37ba0bb6198787e06edab700b3
diff --git a/av1/encoder/mcomp.c b/av1/encoder/mcomp.c
index 46737bf..f36e58e 100644
--- a/av1/encoder/mcomp.c
+++ b/av1/encoder/mcomp.c
@@ -2528,6 +2528,8 @@
besterr = setup_center_error(xd, bestmv, var_params, mv_cost_params, sse1,
distortion);
+ // If forced_stop is FULL_PEL, return.
+ if (forced_stop == FULL_PEL) return besterr;
if (check_repeated_mv_and_update(last_mv_search_list, *bestmv, iter)) {
return INT_MAX;
@@ -2552,7 +2554,7 @@
// Each subsequent iteration checks at least one point in common with
// the last iteration could be 2 ( if diag selected) 1/4 pel
- if (forced_stop != HALF_PEL) {
+ if (forced_stop < HALF_PEL) {
if (check_repeated_mv_and_update(last_mv_search_list, *bestmv, iter)) {
return INT_MAX;
}
@@ -2604,6 +2606,8 @@
besterr = setup_center_error(xd, bestmv, var_params, mv_cost_params, sse1,
distortion);
+ // If forced_stop is FULL_PEL, return.
+ if (forced_stop == FULL_PEL) return besterr;
if (check_repeated_mv_and_update(last_mv_search_list, *bestmv, iter)) {
return INT_MAX;
@@ -2630,7 +2634,7 @@
// Each subsequent iteration checks at least one point in common with
// the last iteration could be 2 ( if diag selected) 1/4 pel
- if (forced_stop != HALF_PEL) {
+ if (forced_stop < HALF_PEL) {
if (check_repeated_mv_and_update(last_mv_search_list, *bestmv, iter)) {
return INT_MAX;
}
@@ -2681,6 +2685,9 @@
besterr = setup_center_error(xd, bestmv, var_params, mv_cost_params, sse1,
distortion);
+ // If forced_stop is FULL_PEL, return.
+ if (forced_stop == FULL_PEL) return besterr;
+
if (check_repeated_mv_and_update(last_mv_search_list, *bestmv, iter)) {
return INT_MAX;
}
@@ -2746,7 +2753,7 @@
// Each subsequent iteration checks at least one point in common with
// the last iteration could be 2 ( if diag selected) 1/4 pel
- if (forced_stop != HALF_PEL) {
+ if (forced_stop < HALF_PEL) {
if (check_repeated_mv_and_update(last_mv_search_list, *bestmv, iter)) {
return INT_MAX;
}
@@ -2806,6 +2813,9 @@
distortion);
}
+ // If forced_stop is FULL_PEL, return.
+ if (!round) return besterr;
+
for (int iter = 0; iter < round; ++iter) {
MV iter_center_mv = *bestmv;
if (check_repeated_mv_and_update(last_mv_search_list, iter_center_mv,