Fix frame boundary block distortion computation in var-tx

Fix the computation of distortion for blocks at frame boundary.

Change-Id: Ib32b95f25e28af42abe9144a7f589030bbaab463
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 9b1f5be..373af79 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -3207,7 +3207,7 @@
       for (idx = 0; idx < blocks_width; ++idx) {
         const int16_t *d =
             diff + ((idy * diff_stride + idx) << tx_size_wide_log2[0]);
-        tmp += aom_sum_squares_2d_i16(d, diff_stride, 4);
+        tmp += sum_squares_2d(d, diff_stride, 0);
       }
     }
   } else {
@@ -3251,7 +3251,7 @@
               src + ((idy * src_stride + idx) << tx_size_wide_log2[0]);
           uint8_t *const r =
               rec_buffer + ((idy * MAX_TX_SIZE + idx) << tx_size_wide_log2[0]);
-          cpi->fn_ptr[BLOCK_4X4].vf(s, src_stride, r, MAX_TX_SIZE, &this_dist);
+          cpi->fn_ptr[0].vf(s, src_stride, r, MAX_TX_SIZE, &this_dist);
           tmp += this_dist;
         }
       }