]> granicus.if.org Git - libvpx/commitdiff
Add a quick path in build_intra_predictors
authorhui su <huisu@google.com>
Wed, 25 May 2016 21:51:02 +0000 (14:51 -0700)
committerhui su <huisu@google.com>
Wed, 25 May 2016 22:21:57 +0000 (15:21 -0700)
For the cases where no reference data is available.

Change-Id: Ibf1ac9b7073acc2c7fc44da893f3d608dc74bc1e

vp10/common/reconintra.c

index fa20f2cc1ccf9bba78974a5a455c9e0842c8faf4..89ff13b3f0b94265060be4ac6d39408572d4ce5e 100644 (file)
@@ -1198,6 +1198,20 @@ static void build_intra_predictors_high(const MACROBLOCKD *xd,
 #endif  // CONFIG_EXT_INTRA
 
   (void) plane;
+  assert(n_top_px >= 0);
+  assert(n_topright_px >= 0);
+  assert(n_left_px >= 0);
+  assert(n_bottomleft_px >= 0);
+
+  if ((!need_above && n_left_px == 0) || (!need_left && n_top_px == 0)) {
+    int i;
+    const int val = (n_left_px == 0) ? base + 1 : base - 1;
+    for (i = 0; i < bs; ++i) {
+      vpx_memset16(dst, val, bs);
+      dst += dst_stride;
+    }
+    return;
+  }
 
   // NEED_LEFT
   if (need_left) {
@@ -1361,6 +1375,16 @@ static void build_intra_predictors(const MACROBLOCKD *xd, const uint8_t *ref,
   assert(n_left_px >= 0);
   assert(n_bottomleft_px >= 0);
 
+  if ((!need_above && n_left_px == 0) || (!need_left && n_top_px == 0)) {
+    int i;
+    const int val = (n_left_px == 0) ? 129 : 127;
+    for (i = 0; i < bs; ++i) {
+      memset(dst, val, bs);
+      dst += dst_stride;
+    }
+    return;
+  }
+
   // NEED_LEFT
   if (need_left) {
 #if CONFIG_EXT_INTRA