]> granicus.if.org Git - libvpx/commitdiff
Use 3 rows and cols of pixels for ref_mv scoring
authorYaowu Xu <yaowu@google.com>
Fri, 14 Sep 2012 15:58:02 +0000 (08:58 -0700)
committerYaowu Xu <yaowu@google.com>
Fri, 14 Sep 2012 16:47:43 +0000 (09:47 -0700)
The commit changed to use 3 rows above and 3 cols from left for SAD
scoring for selecting the best reference motion vector. The change
helped std-hd set by >.2% on psnr/ssim metrics.

Change-Id: Ifad3b528d0b4b6e3c22518af789d76eff23c1520

vp8/common/findnearmv.c
vp8/encoder/sad_c.c

index 43eb6bf4ded8dbb652d97be433e9639a243d96df..235ca46cead17e37cc6e7d5b019de4cec3d31a9c 100644 (file)
@@ -225,10 +225,10 @@ void vp8_find_best_ref_mvs(MACROBLOCKD *xd,
   best_mv->as_int = nearest->as_int = near->as_int = 0;
   vpx_memset(sorted_mvs, 0, sizeof(sorted_mvs));
 
-  above_src = xd->dst.y_buffer - xd->dst.y_stride * 2;
-  left_src  = xd->dst.y_buffer - 2;
-  above_ref = ref_y_buffer - ref_y_stride * 2;
-  left_ref  = ref_y_buffer - 2;
+  above_src = xd->dst.y_buffer - xd->dst.y_stride * 3;
+  left_src  = xd->dst.y_buffer - 3;
+  above_ref = ref_y_buffer - ref_y_stride * 3;
+  left_ref  = ref_y_buffer - 3;
 
   //for(i = 0; i < MAX_MV_REFS; ++i) {
   // Limit search to the predicted best 4
@@ -259,10 +259,10 @@ void vp8_find_best_ref_mvs(MACROBLOCKD *xd,
       ((this_mv.as_mv.col + 3) >> 3):((this_mv.as_mv.col + 4) >> 3);
     offset = ref_y_stride * row_offset + col_offset;
 
-    sad = vp8_sad16x2_c(above_src, xd->dst.y_stride,
+    sad = vp8_sad16x3_c(above_src, xd->dst.y_stride,
                         above_ref + offset, ref_y_stride, INT_MAX);
 
-    sad += vp8_sad2x16_c(left_src, xd->dst.y_stride,
+    sad += vp8_sad3x16_c(left_src, xd->dst.y_stride,
                          left_ref + offset, ref_y_stride, INT_MAX);
 
     // Add the entry to our list and then resort the list on score.
@@ -281,7 +281,6 @@ void vp8_find_best_ref_mvs(MACROBLOCKD *xd,
     }
   }
 
-
   // Set the best mv to the first entry in the sorted list
   best_mv->as_int = sorted_mvs[0].as_int;
 
index 4fdfd11862040cbe3639ca28c52f10b0b1157dad..2e86a16c01214eff16e8b2cf9848a6b8b723e545 100644 (file)
@@ -98,21 +98,21 @@ unsigned int vp8_sad4x4_c(
 }
 
 #if CONFIG_NEWBESTREFMV
-unsigned int vp8_sad2x16_c(
+unsigned int vp8_sad3x16_c(
   const unsigned char *src_ptr,
   int  src_stride,
   const unsigned char *ref_ptr,
   int  ref_stride,
   int max_sad){
-  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 2, 16);
+  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 3, 16);
 }
-unsigned int vp8_sad16x2_c(
+unsigned int vp8_sad16x3_c(
   const unsigned char *src_ptr,
   int  src_stride,
   const unsigned char *ref_ptr,
   int  ref_stride,
   int max_sad){
-  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 16, 2);
+  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 16, 3);
 }
 #endif