mcomp: Use valid bit depth in upsampled_pref_error

For some reason xd->cur_buf->bit_depth appears to always be 0.
Use xd->bd instead, as this appears to have the correct value.

Along with commit 49bb8f8c8fd6, this fixes the HBD internal quality
loss introduced in commit 5d24b6f04919.

BUG=aomedia:649

Change-Id: Ie97e9caf3b13f7493f873258f3863e1314466f1d
diff --git a/av1/encoder/mcomp.c b/av1/encoder/mcomp.c
index 269920a..4efadff 100644
--- a/av1/encoder/mcomp.c
+++ b/av1/encoder/mcomp.c
@@ -713,15 +713,15 @@
       if (mask)
         aom_highbd_comp_mask_upsampled_pred(
             pred16, second_pred, w, h, subpel_x_q3, subpel_y_q3, y, y_stride,
-            mask, mask_stride, invert_mask, xd->cur_buf->bit_depth);
+            mask, mask_stride, invert_mask, xd->bd);
       else
 #endif
         aom_highbd_comp_avg_upsampled_pred(pred16, second_pred, w, h,
                                            subpel_x_q3, subpel_y_q3, y,
-                                           y_stride, xd->cur_buf->bit_depth);
+                                           y_stride, xd->bd);
     } else {
       aom_highbd_upsampled_pred(pred16, w, h, subpel_x_q3, subpel_y_q3, y,
-                                y_stride, xd->cur_buf->bit_depth);
+                                y_stride, xd->bd);
     }
 
     besterr = vfp->vf(CONVERT_TO_BYTEPTR(pred16), w, src, src_stride, sse);
@@ -2712,7 +2712,7 @@
   if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
     DECLARE_ALIGNED(16, uint16_t, pred16[MAX_SB_SQUARE]);
     aom_highbd_upsampled_pred(pred16, w, h, subpel_x_q3, subpel_y_q3, y,
-                              y_stride, xd->cur_buf->bit_depth);
+                              y_stride, xd->bd);
 
     besterr = vfp->ovf(CONVERT_TO_BYTEPTR(pred16), w, wsrc, mask, sse);
   } else {