[NORMATIVE]ext_tile: correctly increment output reference ptr

In HBD case, after tile decoding, we need to copy the decoded tile
out from the corresponding location of the internal frame buffer.
This patch corrected the copying location calculation in HBD case.

BUG=aomedia:1993

Change-Id: I4df6ed740e6fbb5bd3474eb8311fea056bc2b4b5
diff --git a/av1/av1_dx_iface.c b/av1/av1_dx_iface.c
index f0862da..9f338ab 100644
--- a/av1/av1_dx_iface.c
+++ b/av1/av1_dx_iface.c
@@ -691,11 +691,14 @@
             const int tile_col = AOMMIN(pbi->dec_tile_col, cm->tile_cols - 1);
             const int mi_col = tile_col * cm->tile_width;
             const int ssx = ctx->img.x_chroma_shift;
+            const int is_hbd =
+                (ctx->img.fmt & AOM_IMG_FMT_HIGHBITDEPTH) ? 1 : 0;
             int plane;
-            ctx->img.planes[0] += mi_col * MI_SIZE;
+            ctx->img.planes[0] += mi_col * MI_SIZE * (1 + is_hbd);
             if (num_planes > 1) {
               for (plane = 1; plane < MAX_MB_PLANE; ++plane) {
-                ctx->img.planes[plane] += mi_col * (MI_SIZE >> ssx);
+                ctx->img.planes[plane] +=
+                    mi_col * (MI_SIZE >> ssx) * (1 + is_hbd);
               }
             }
             ctx->img.d_w =
diff --git a/av1/decoder/obu.c b/av1/decoder/obu.c
index fdcaec0..207065b 100644
--- a/av1/decoder/obu.c
+++ b/av1/decoder/obu.c
@@ -501,15 +501,15 @@
       bufs[plane] = cur_frame->buffers[plane];
       strides[plane] =
           (plane > 0) ? cur_frame->strides[1] : cur_frame->strides[0];
-      if (is_hbd) {
-        bufs[plane] = (uint8_t *)CONVERT_TO_SHORTPTR(cur_frame->buffers[plane]);
-        strides[plane] =
-            (plane > 0) ? 2 * cur_frame->strides[1] : 2 * cur_frame->strides[0];
-      }
 
       bufs[plane] += mi_row * (MI_SIZE >> shift_y) * strides[plane] +
                      mi_col * (MI_SIZE >> shift_x);
 
+      if (is_hbd) {
+        bufs[plane] = (uint8_t *)CONVERT_TO_SHORTPTR(bufs[plane]);
+        strides[plane] *= 2;
+      }
+
       int w, h;
       w = (plane > 0 && shift_x > 0) ? ((tile_width_in_pixels + 1) >> shift_x)
                                      : tile_width_in_pixels;