From: Julia Robson Date: Tue, 24 Nov 2015 11:22:59 +0000 (+0000) Subject: Changes to allow 128x128 to work with copy_mode X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d52cc33891d30aacd6f2e339ba97051e06054106;p=libvpx Changes to allow 128x128 to work with copy_mode Change-Id: I1fff46e7733e5e1d15c012d6a204536243c6e090 --- diff --git a/vp9/common/vp9_entropymode.c b/vp9/common/vp9_entropymode.c index 7984ea941..df15fbcda 100644 --- a/vp9/common/vp9_entropymode.c +++ b/vp9/common/vp9_entropymode.c @@ -887,11 +887,25 @@ static const vp9_prob default_supertx_prob[PARTITION_SUPERTX_CONTEXTS] #if CONFIG_COPY_MODE static const vp9_prob default_copy_noref_prob[COPY_MODE_CONTEXTS] [BLOCK_SIZES] = { +#if CONFIG_EXT_CODING_UNIT_SIZE + {255, 255, 255, 82, 148, 182, 65, 193, 158, 70, 138, 101, 23, 23, + 23, 23}, + {255, 255, 255, 118, 153, 161, 123, 169, 157, 82, 101, 123, 88, 88, + 88, 88}, + {255, 255, 255, 130, 178, 226, 194, 196, 174, 173, 135, 144, 141, 141, + 141, 141}, + {255, 255, 255, 178, 218, 225, 197, 230, 222, 215, 220, 220, 220, 220, + 220, 220}, + {255, 255, 255, 243, 248, 241, 233, 249, 249, 249, 249, 249, 249, 249, + 249, 249} + +#else {255, 255, 255, 82, 148, 182, 65, 193, 158, 70, 138, 101, 23}, {255, 255, 255, 118, 153, 161, 123, 169, 157, 82, 101, 123, 88}, {255, 255, 255, 130, 178, 226, 194, 196, 174, 173, 135, 144, 141}, {255, 255, 255, 178, 218, 225, 197, 230, 222, 215, 220, 220, 220}, {255, 255, 255, 243, 248, 241, 233, 249, 249, 249, 249, 249, 249} +#endif }; static const vp9_prob default_copy_mode_probs_l2[COPY_MODE_CONTEXTS][1] = { diff --git a/vp9/common/vp9_mvref_common.c b/vp9/common/vp9_mvref_common.c index 2caa7a6c3..b4fc7ee3f 100644 --- a/vp9/common/vp9_mvref_common.c +++ b/vp9/common/vp9_mvref_common.c @@ -662,18 +662,19 @@ static int is_right_available(BLOCK_SIZE bsize, PARTITION_TYPE partition, #endif int mi_row, int mi_col) { - int depth, max_depth = 4 - MIN(b_width_log2_lookup[bsize], - b_height_log2_lookup[bsize]); - int block[4] = {0}; + int depth, max_depth = (CODING_UNIT_SIZE_LOG2 - 2) - + MIN(b_width_log2_lookup[bsize], b_height_log2_lookup[bsize]); + int block[(CODING_UNIT_SIZE_LOG2 - 2)] = {0}; if (bsize == BLOCK_LARGEST) return 1; - mi_row = mi_row % 8; - mi_col = mi_col % 8; + mi_row = mi_row % MI_BLOCK_SIZE; + mi_col = mi_col % MI_BLOCK_SIZE; for (depth = 1; depth <= max_depth; depth++) { - block[depth] = (mi_row >> (3 - depth)) * 2 + (mi_col >> (3 - depth)); - mi_row = mi_row % (8 >> depth); - mi_col = mi_col % (8 >> depth); + block[depth] = (mi_row >> (MI_BLOCK_SIZE_LOG2 - depth)) * 2 + + (mi_col >> (MI_BLOCK_SIZE_LOG2 - depth)); + mi_row = mi_row % (MI_BLOCK_SIZE >> depth); + mi_col = mi_col % (MI_BLOCK_SIZE >> depth); } if (b_width_log2_lookup[bsize] < b_height_log2_lookup[bsize]) { @@ -724,14 +725,16 @@ int vp9_construct_ref_inter_list(VP9_COMMON *cm, MACROBLOCKD *xd, PARTITION_TYPE partition, #endif int mi_row, int mi_col, - MB_MODE_INFO *ref_list[18]) { + MB_MODE_INFO *ref_list[2 * + (MI_BLOCK_SIZE + 1)]) { int bw = 4 << b_width_log2_lookup[bsize]; int bh = 4 << b_height_log2_lookup[bsize]; int row_offset, col_offset; int mi_offset; MB_MODE_INFO *ref_mbmi; int ref_index, ref_num = 0; - int row_offset_cand[18], col_offset_cand[18]; + int row_offset_cand[2 * (MI_BLOCK_SIZE + 1)]; + int col_offset_cand[2 * (MI_BLOCK_SIZE + 1)]; int offset_num = 0, i, switchflag; int is_sec_rec = is_second_rec(mi_row, mi_col, bsize); @@ -740,23 +743,25 @@ int vp9_construct_ref_inter_list(VP9_COMMON *cm, MACROBLOCKD *xd, offset_num++; } if (is_sec_rec != 1) { - row_offset_cand[offset_num] = bh / 16; col_offset_cand[offset_num] = -1; + row_offset_cand[offset_num] = bh / (2 * MI_SIZE); + col_offset_cand[offset_num] = -1; offset_num++; } - row_offset = bh / 8 - 1; + row_offset = bh / MI_SIZE - 1; col_offset = 1; if (is_sec_rec < 2) switchflag = 1; else switchflag = 0; - while ((is_sec_rec == 0 && ((row_offset >=0) || col_offset < (bw / 8 + 1))) || - (is_sec_rec == 1 && col_offset < (bw / 8 + 1)) || + while ((is_sec_rec == 0 && ((row_offset >=0) || + col_offset < (bw / MI_SIZE + 1))) || + (is_sec_rec == 1 && col_offset < (bw / MI_SIZE + 1)) || (is_sec_rec == 2 && row_offset >=0)) { switch (switchflag) { case 0: if (row_offset >= 0) { - if (row_offset != bh / 16) { + if (row_offset != bh / (2 * MI_SIZE)) { row_offset_cand[offset_num] = row_offset; col_offset_cand[offset_num] = -1; offset_num++; @@ -765,7 +770,7 @@ int vp9_construct_ref_inter_list(VP9_COMMON *cm, MACROBLOCKD *xd, } break; case 1: - if (col_offset < (bw / 8 + 1)) { + if (col_offset < (bw / MI_SIZE + 1)) { row_offset_cand[offset_num] = -1; col_offset_cand[offset_num] = col_offset; offset_num++; @@ -785,8 +790,8 @@ int vp9_construct_ref_inter_list(VP9_COMMON *cm, MACROBLOCKD *xd, for (i = 0; i < offset_num; i++) { row_offset = row_offset_cand[i]; col_offset = col_offset_cand[i]; - if ((col_offset < (bw / 8) || - (col_offset == (bw / 8) && is_right_available(bsize, + if ((col_offset < (bw / MI_SIZE) || + (col_offset == (bw / MI_SIZE) && is_right_available(bsize, #if CONFIG_EXT_PARTITION partition, #endif diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c index a492729a6..8e4baeeff 100644 --- a/vp9/decoder/vp9_decodemv.c +++ b/vp9/decoder/vp9_decodemv.c @@ -1454,7 +1454,7 @@ static void read_inter_frame_mode_info(VP9_COMMON *const cm, int inter_block; #if CONFIG_COPY_MODE int num_candidate = 0; - MB_MODE_INFO *inter_ref_list[18] = {NULL}; + MB_MODE_INFO *inter_ref_list[2 * (MI_BLOCK_SIZE + 1)] = {NULL}; #endif #if CONFIG_SUPERTX (void) supertx_enabled; diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index e5377d222..c4cd87756 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -6723,7 +6723,7 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, #if CONFIG_COPY_MODE COPY_MODE copy_mode; int inter_ref_count; - MB_MODE_INFO *inter_ref_list[18]; + MB_MODE_INFO *inter_ref_list[2 * (MI_BLOCK_SIZE + 1)]; int copy_mode_context = vp9_get_copy_mode_context(xd); int orig_segment_id = mbmi->segment_id; #endif // CONFIG_COPY_MODE