Call vp10_fwd_txfm_4x4 in encode_inter_mb_segment

Change-Id: Ieabe5534e5f4fb3f2d751a3cfc682208b3913715
diff --git a/vp10/encoder/rdopt.c b/vp10/encoder/rdopt.c
index fb6e0c3..d736751 100644
--- a/vp10/encoder/rdopt.c
+++ b/vp10/encoder/rdopt.c
@@ -4258,8 +4258,6 @@
   const int width = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
   const int height = 4 * num_4x4_blocks_high_lookup[plane_bsize];
   int idx, idy;
-  void (*fwd_txm4x4)(const int16_t *input, tran_low_t *output, int stride);
-
   const uint8_t *const src =
       &p->src.buf[vp10_raster_block_offset(BLOCK_8X8, i, p->src.stride)];
   uint8_t *const dst = &pd->dst.buf[vp10_raster_block_offset(BLOCK_8X8, i,
@@ -4273,17 +4271,6 @@
 
 #if CONFIG_VP9_HIGHBITDEPTH
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
-    fwd_txm4x4 = xd->lossless[mi->mbmi.segment_id] ? vp10_highbd_fwht4x4
-                                                   : vpx_highbd_fdct4x4;
-  } else {
-    fwd_txm4x4 = xd->lossless[mi->mbmi.segment_id] ? vp10_fwht4x4 : vpx_fdct4x4;
-  }
-#else
-  fwd_txm4x4 = xd->lossless[mi->mbmi.segment_id] ? vp10_fwht4x4 : vpx_fdct4x4;
-#endif  // CONFIG_VP9_HIGHBITDEPTH
-
-#if CONFIG_VP9_HIGHBITDEPTH
-  if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     vpx_highbd_subtract_block(
         height, width, vp10_raster_block_offset_int16(BLOCK_8X8, i, p->src_diff),
         8, src, p->src.stride, dst, pd->dst.stride, xd->bd);
@@ -4302,6 +4289,7 @@
   for (idy = 0; idy < height / 4; ++idy) {
     for (idx = 0; idx < width / 4; ++idx) {
       int64_t dist, ssz, rd, rd1, rd2;
+      const int16_t *src_diff;
       tran_low_t* coeff;
 #if CONFIG_VAR_TX
       int coeff_ctx;
@@ -4312,8 +4300,21 @@
                                            *(tl + (k >> 1)));
 #endif
       coeff = BLOCK_OFFSET(p->coeff, k);
-      fwd_txm4x4(vp10_raster_block_offset_int16(BLOCK_8X8, k, p->src_diff),
-                 coeff, 8);
+
+      src_diff = vp10_raster_block_offset_int16(BLOCK_8X8, k, p->src_diff);
+#if CONFIG_VP9_HIGHBITDEPTH
+      if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
+        vp10_highbd_fwd_txfm_4x4(src_diff, coeff, 8, DCT_DCT,
+                                 xd->lossless[mi->mbmi.segment_id]);
+      } else {
+        vp10_fwd_txfm_4x4(src_diff, coeff, 8, DCT_DCT,
+                          xd->lossless[mi->mbmi.segment_id]);
+      }
+#else
+      vp10_fwd_txfm_4x4(src_diff, coeff, 8, DCT_DCT,
+                        xd->lossless[mi->mbmi.segment_id]);
+#endif  // CONFIG_VP9_HIGHBITDEPTH
+
       vp10_regular_quantize_b_4x4(x, 0, k, so->scan, so->iscan);
       dist_block(cpi, x, 0, k, idy + (i >> 1), idx + (i & 0x1), TX_4X4,
                  &dist, &ssz);