Fix copy mode bug: searches made outside of the current tile
Change-Id: Ib3cf4bf4da0a575053493609956e133d1ce028a1
This commit is contained in:
parent
fa4b1ca714
commit
286983b8c6
@ -652,9 +652,9 @@ static int compare_interinfo(MB_MODE_INFO *mbmi, MB_MODE_INFO *ref_mbmi) {
|
||||
}
|
||||
}
|
||||
|
||||
static int check_inside(VP9_COMMON *cm, int mi_row, int mi_col) {
|
||||
return mi_row >= 0 && mi_col >= 0 &&
|
||||
mi_row < cm->mi_rows && mi_col < cm->mi_cols;
|
||||
static int check_inside(const TileInfo *const tile, int mi_row, int mi_col) {
|
||||
return mi_row >= tile->mi_row_start && mi_col >= tile->mi_col_start &&
|
||||
mi_row < tile->mi_row_end && mi_col < tile->mi_col_end;
|
||||
}
|
||||
|
||||
static int is_right_available(BLOCK_SIZE bsize, int mi_row, int mi_col) {
|
||||
@ -707,6 +707,7 @@ static int is_second_rec(int mi_row, int mi_col, BLOCK_SIZE bsize) {
|
||||
}
|
||||
|
||||
int vp9_construct_ref_inter_list(VP9_COMMON *cm, MACROBLOCKD *xd,
|
||||
const TileInfo *const tile,
|
||||
BLOCK_SIZE bsize, int mi_row, int mi_col,
|
||||
MB_MODE_INFO *ref_list[18]) {
|
||||
int bw = 4 << b_width_log2_lookup[bsize];
|
||||
@ -771,7 +772,7 @@ int vp9_construct_ref_inter_list(VP9_COMMON *cm, MACROBLOCKD *xd,
|
||||
col_offset = col_offset_cand[i];
|
||||
if ((col_offset < (bw / 8) ||
|
||||
(col_offset == (bw / 8) && is_right_available(bsize, mi_row, mi_col)))
|
||||
&& check_inside(cm, mi_row + row_offset, mi_col + col_offset)) {
|
||||
&& check_inside(tile, mi_row + row_offset, mi_col + col_offset)) {
|
||||
mi_offset = row_offset * cm->mi_stride + col_offset;
|
||||
ref_mbmi = &xd->mi[mi_offset].src_mi->mbmi;
|
||||
if (is_inter_block(ref_mbmi)) {
|
||||
|
@ -384,6 +384,7 @@ void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd,
|
||||
|
||||
#if CONFIG_COPY_MODE
|
||||
int vp9_construct_ref_inter_list(VP9_COMMON *cm, MACROBLOCKD *xd,
|
||||
const TileInfo *const tile,
|
||||
BLOCK_SIZE bsize, int mi_row, int mi_col,
|
||||
MB_MODE_INFO *ref_list[18]);
|
||||
#endif // CONFIG_COPY_MODE
|
||||
|
@ -1305,7 +1305,7 @@ static void read_inter_frame_mode_info(VP9_COMMON *const cm,
|
||||
#if CONFIG_COPY_MODE
|
||||
if (mbmi->sb_type >= BLOCK_8X8)
|
||||
num_candidate = vp9_construct_ref_inter_list(
|
||||
cm, xd, mbmi->sb_type, mi_row, mi_col, inter_ref_list);
|
||||
cm, xd, tile, mbmi->sb_type, mi_row, mi_col, inter_ref_list);
|
||||
if (mbmi->sb_type >= BLOCK_8X8 && num_candidate > 0) {
|
||||
int ctx = vp9_get_copy_mode_context(xd);
|
||||
int is_copy = vp9_read(r, cm->fc.copy_noref_prob[ctx][mbmi->sb_type]);
|
||||
|
@ -5929,7 +5929,8 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
&comp_mode_p);
|
||||
#if CONFIG_COPY_MODE
|
||||
inter_ref_count =
|
||||
vp9_construct_ref_inter_list(cm, xd, bsize, mi_row, mi_col, inter_ref_list);
|
||||
vp9_construct_ref_inter_list(cm, xd, tile, bsize, mi_row, mi_col,
|
||||
inter_ref_list);
|
||||
mbmi->inter_ref_count = inter_ref_count;
|
||||
#endif // CONFIG_COPY_MODE
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user