ref: 2ad62c93129e363a6c7a916f656d807dfefce8e6
parent: 60198a595d53b34139c3e7e6c9d8f7d4ab69db7c
author: Dmitry Kovalev <[email protected]>
date: Wed Jul 3 07:15:58 EDT 2013
Calling set_partition_seg_context() instead of code duplication. Change-Id: I65be6acc54c99688fd1f0c946cec3511514b8555
--- a/vp9/common/vp9_onyxc_int.h
+++ b/vp9/common/vp9_onyxc_int.h
@@ -305,11 +305,10 @@
return 2 * ((cm->mb_cols + 3) & ~3);
}
-static INLINE void set_partition_seg_context(VP9_COMMON *cm,
- MACROBLOCKD *xd,
+static INLINE void set_partition_seg_context(VP9_COMMON *cm, MACROBLOCKD *xd,
int mi_row, int mi_col) {
xd->above_seg_context = cm->above_seg_context + mi_col;
- xd->left_seg_context = cm->left_seg_context + (mi_row & MI_MASK);
+ xd->left_seg_context = cm->left_seg_context + (mi_row & MI_MASK);
}
static int check_bsize_coverage(VP9_COMMON *cm, MACROBLOCKD *xd,
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -206,9 +206,9 @@
pd->left_context = cm->left_context[i] +
(((mi_row * 2) & 15) >> pd->subsampling_y);
}
- xd->above_seg_context = cm->above_seg_context + mi_col;
- xd->left_seg_context = cm->left_seg_context + (mi_row & MI_MASK);
+ set_partition_seg_context(cm, xd, mi_row, mi_col);
+
// Distance of Mb to the various image edges. These are specified to 8th pel
// as they are always compared to values that are in 1/8th pel units
set_mi_row_col(cm, xd, mi_row, bh, mi_col, bw);
@@ -304,10 +304,8 @@
if (bsize >= BLOCK_SIZE_SB8X8) {
int pl;
- int idx = check_bsize_coverage(pc, xd, mi_row, mi_col, bsize);
- // read the partition information
- xd->left_seg_context = pc->left_seg_context + (mi_row & MI_MASK);
- xd->above_seg_context = pc->above_seg_context + mi_col;
+ const int idx = check_bsize_coverage(pc, xd, mi_row, mi_col, bsize);
+ set_partition_seg_context(pc, xd, mi_row, mi_col);
pl = partition_plane_context(xd, bsize);
if (idx == 0)
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -656,9 +656,8 @@
if (bsize >= BLOCK_SIZE_SB8X8) {
int pl;
- int idx = check_bsize_coverage(cm, xd, mi_row, mi_col, bsize);
- xd->left_seg_context = cm->left_seg_context + (mi_row & MI_MASK);
- xd->above_seg_context = cm->above_seg_context + mi_col;
+ const int idx = check_bsize_coverage(cm, xd, mi_row, mi_col, bsize);
+ set_partition_seg_context(cm, xd, mi_row, mi_col);
pl = partition_plane_context(xd, bsize);
// encode the partition information
if (idx == 0)