Calling set_partition_seg_context() instead of code duplication.

Change-Id: I65be6acc54c99688fd1f0c946cec3511514b8555
This commit is contained in:
Dmitry Kovalev 2013-07-03 11:15:58 -07:00
parent 60198a595d
commit 2ad62c9312
3 changed files with 8 additions and 12 deletions

View File

@ -305,11 +305,10 @@ static int mi_cols_aligned_to_sb(VP9_COMMON *cm) {
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,

View File

@ -206,8 +206,8 @@ static void set_offsets(VP9D_COMP *pbi, BLOCK_SIZE_TYPE bsize,
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
@ -304,10 +304,8 @@ static void decode_modes_sb(VP9D_COMP *pbi, int mi_row, int mi_col,
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)

View File

@ -656,9 +656,8 @@ static void write_modes_sb(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc,
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)