summaryrefslogtreecommitdiff
path: root/vp9/common/vp9_onyxc_int.h
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2013-08-22 15:45:56 -0700
committerDmitry Kovalev <dkovalev@google.com>2013-08-22 15:45:56 -0700
commit335b1d360bbf39ea44d87e97efcd54a61fb34913 (patch)
treeb75326d1033f82085f258b69fb2789b222dbbb31 /vp9/common/vp9_onyxc_int.h
parent13eed79c776477f0bc3ed5e70c2fce69165cb77e (diff)
downloadlibvpx-335b1d360bbf39ea44d87e97efcd54a61fb34913.tar
libvpx-335b1d360bbf39ea44d87e97efcd54a61fb34913.tar.gz
libvpx-335b1d360bbf39ea44d87e97efcd54a61fb34913.tar.bz2
libvpx-335b1d360bbf39ea44d87e97efcd54a61fb34913.zip
check_bsize_coverage cleanup.
Change-Id: Ib7803857b35c00e317c9deb8630e777e25eb278f
Diffstat (limited to 'vp9/common/vp9_onyxc_int.h')
-rw-r--r--vp9/common/vp9_onyxc_int.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h
index 1693817ef..1e0120382 100644
--- a/vp9/common/vp9_onyxc_int.h
+++ b/vp9/common/vp9_onyxc_int.h
@@ -255,25 +255,20 @@ static INLINE void set_partition_seg_context(VP9_COMMON *cm, MACROBLOCKD *xd,
xd->left_seg_context = cm->left_seg_context + (mi_row & MI_MASK);
}
-static int check_bsize_coverage(VP9_COMMON *cm, int mi_row, int mi_col,
- BLOCK_SIZE_TYPE bsize) {
- int bsl = mi_width_log2(bsize), bs = 1 << bsl;
- int ms = bs / 2;
+// return the node index in the prob tree for binary coding
+static int check_bsize_coverage(int bs, int mi_rows, int mi_cols,
+ int mi_row, int mi_col) {
+ const int r = (mi_row + bs < mi_rows);
+ const int c = (mi_col + bs < mi_cols);
- if ((mi_row + ms < cm->mi_rows) && (mi_col + ms < cm->mi_cols))
+ if (r && c)
return 0;
- // frame width/height are multiples of 8, hence 8x8 block should always
- // pass the above check
- assert(bsize > BLOCK_8X8);
-
- // return the node index in the prob tree for binary coding
- // only allow horizontal/split partition types
- if ((mi_col + ms < cm->mi_cols) && (mi_row + ms >= cm->mi_rows))
- return 1;
- // only allow vertical/split partition types
- if ((mi_row + ms < cm->mi_rows) && (mi_col + ms >= cm->mi_cols))
- return 2;
+ if (c && !r)
+ return 1; // only allow horizontal/split partition types
+
+ if (r && !c)
+ return 2; // only allow vertical/split partition types
return -1;
}