shithub: libvpx

Download patch

ref: eec622d178e2bdc1098fcb86e954800ce03138fa
parent: dea22b4bdade9a854cb3d395bc25551093aa42ef
parent: 3c038b6c407eb383e3c4fdd9229cc89257d46222
author: James Zern <jzern@google.com>
date: Thu Oct 24 02:04:10 EDT 2013

Merge "vp9/extend_for_intra: avoid crossing tile boundary"

--- a/vp9/common/vp9_blockd.h
+++ b/vp9/common/vp9_blockd.h
@@ -439,16 +439,19 @@
   }
 
   if (xd->mb_to_bottom_edge < 0) {
-    const int bh = 4 << b_height_log2(plane_bsize);
-    const int umv_border_start = bh + (xd->mb_to_bottom_edge >>
-                                       (3 + pd->subsampling_y));
-    int i;
-    const uint8_t c = buf[(umv_border_start - 1) * stride + x];
-    uint8_t *d = &buf[umv_border_start * stride + x];
+    if (xd->left_available || x >= 0) {
+      const int bh = 4 << b_height_log2(plane_bsize);
+      const int umv_border_start =
+          bh + (xd->mb_to_bottom_edge >> (3 + pd->subsampling_y));
 
-    if (y + bh > umv_border_start)
-      for (i = 0; i < bh; ++i, d += stride)
-        *d = c;
+      if (y + bh > umv_border_start) {
+        const uint8_t c = buf[(umv_border_start - 1) * stride + x];
+        uint8_t *d = &buf[umv_border_start * stride + x];
+        int i;
+        for (i = 0; i < bh; ++i, d += stride)
+          *d = c;
+      }
+    }
   }
 }
 static void set_contexts_on_border(MACROBLOCKD *xd,