shithub: libvpx

Download patch

ref: 5316cfe95af4364aee5eb7faf3f66b3a3f9c56fe
parent: 171ae2cbae638a7459533303bebd6fbacce19369
parent: 2b6f7cb3f2b06aff3bd9f352509640951eb9e941
author: Angie Chiang <angiebird@google.com>
date: Tue Feb 5 13:27:15 EST 2019

Merge "Add dist scale in get_mv_dist"

--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -6146,7 +6146,7 @@
     // TODO(angiebird): Consider subpixel when computing the sse.
     cpi->fn_ptr[bsize].vf(src.buf, src.stride, get_buf_from_mv(&pre, &full_mv),
                           pre.stride, &sse);
-    return (double)sse;
+    return (double)(sse << VP9_DIST_SCALE_LOG2);
   } else {
     assert(0);
     return 0;
--- a/vp9/encoder/vp9_rd.h
+++ b/vp9/encoder/vp9_rd.h
@@ -42,6 +42,9 @@
 #define RD_THRESH_MAX_FACT 64
 #define RD_THRESH_INC 1
 
+#define VP9_DIST_SCALE_LOG2 4
+#define VP9_DIST_SCALE (1 << VP9_DIST_SCALE_LOG2)
+
 // This enumerator type needs to be kept aligned with the mode order in
 // const MODE_DEFINITION vp9_mode_order[MAX_MODES] used in the rd code.
 typedef enum {
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -273,9 +273,9 @@
   }
 
   *skip_txfm_sb = skip_flag;
-  *skip_sse_sb = total_sse << 4;
+  *skip_sse_sb = total_sse << VP9_DIST_SCALE_LOG2;
   *out_rate_sum = (int)rate_sum;
-  *out_dist_sum = dist_sum << 4;
+  *out_dist_sum = dist_sum << VP9_DIST_SCALE_LOG2;
 }
 
 #if CONFIG_VP9_HIGHBITDEPTH