Use diamond search to replace full search in full-pixel refining search

In NEWMV mode, currently, full search is used as the refining search
after n-step search. By replacing it with an iterative diamond search
of radius 1 largely reduced the computation complexity, but still
maintained the same encoding quality since the refining search is
done for every macroblock instead of only a small precentage of
macroblocks while using full search.

Tests on the test set showed a 3.4% encoding speed increase with none
psnr & ssim loss.

Change-Id: Ife907d7eb9544d15c34f17dc6e4cfd97cb743d41
diff --git a/vp8/encoder/mcomp.h b/vp8/encoder/mcomp.h
index b14cbcb..d655b83 100644
--- a/vp8/encoder/mcomp.h
+++ b/vp8/encoder/mcomp.h
@@ -69,6 +69,20 @@
      MV *center_mv \
     )
 
+#define prototype_refining_search_sad(sym)\
+    int (sym)\
+    (\
+     MACROBLOCK *x, \
+     BLOCK *b, \
+     BLOCKD *d, \
+     MV *ref_mv, \
+     int error_per_bit, \
+     int distance, \
+     vp8_variance_fn_ptr_t *fn_ptr, \
+     int *mvcost[2], \
+     MV *center_mv \
+    )
+
 #define prototype_diamond_search_sad(sym)\
     int (sym)\
     (\
@@ -94,6 +108,10 @@
 extern prototype_full_search_sad(vp8_full_search_sadx3);
 extern prototype_full_search_sad(vp8_full_search_sadx8);
 
+typedef prototype_refining_search_sad(*vp8_refining_search_fn_t);
+extern prototype_refining_search_sad(vp8_refining_search_sad);
+extern prototype_refining_search_sad(vp8_refining_search_sadx4);
+
 typedef prototype_diamond_search_sad(*vp8_diamond_search_fn_t);
 extern prototype_diamond_search_sad(vp8_diamond_search_sad);
 extern prototype_diamond_search_sad(vp8_diamond_search_sadx4);
@@ -103,6 +121,11 @@
 #endif
 extern prototype_full_search_sad(vp8_search_full_search);
 
+#ifndef vp8_search_refining_search
+#define vp8_search_refining_search vp8_refining_search_sad
+#endif
+extern prototype_refining_search_sad(vp8_search_refining_search);
+
 #ifndef vp8_search_diamond_search
 #define vp8_search_diamond_search vp8_diamond_search_sad
 #endif
@@ -111,6 +134,7 @@
 typedef struct
 {
     prototype_full_search_sad(*full_search);
+    prototype_refining_search_sad(*refining_search);
     prototype_diamond_search_sad(*diamond_search);
 } vp8_search_rtcd_vtable_t;