Fix a bug for high-bit-depth in av1_dist_block()

BUG=aomedia:426

Change-Id: I246b0de3bd25863853643bdb238899bf8e5847be
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index f61cb55..6c8154d 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -1459,6 +1459,10 @@
       const int16_t *diff = &p->src_diff[diff_idx];
       tmp = sum_squares_visible(xd, plane, diff, diff_stride, blk_row, blk_col,
                                 plane_bsize, tx_bsize);
+#if CONFIG_AOM_HIGHBITDEPTH
+      if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH)
+        tmp = ROUND_POWER_OF_TWO(tmp, (xd->bd - 8) * 2);
+#endif  // CONFIG_AOM_HIGHBITDEPTH
     }
     *out_sse = (int64_t)tmp * 16;