]> granicus.if.org Git - libvpx/commitdiff
Fix copy mode bug: searches made outside of the current tile
authorJack Haughton <jack.haughton@argondesign.com>
Tue, 9 Jun 2015 13:34:14 +0000 (14:34 +0100)
committerJack Haughton <jack.haughton@argondesign.com>
Thu, 11 Jun 2015 08:23:32 +0000 (09:23 +0100)
Change-Id: Ib3cf4bf4da0a575053493609956e133d1ce028a1

vp9/common/vp9_mvref_common.c
vp9/common/vp9_mvref_common.h
vp9/decoder/vp9_decodemv.c
vp9/encoder/vp9_rdopt.c

index 3f7dd5e054bf8e1d6f8eb624863858e6caee9983..6f1291076982e621acbdfc520e34765ae61545eb 100644 (file)
@@ -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)) {
index d05b455f523e24b03fe898072a3b5ee10535581d..cdbd4d128d6b9867ac60612162558f1ec9aec0a1 100644 (file)
@@ -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
index 81dd4e3ad492869664a4665d8f8253b54cce9b36..680a5c83016e5b9cdb0865c437ba231ab1bf2c8a 100644 (file)
@@ -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]);
index 69603f08a92fa6d317105edb702f1a8d686df9b0..f1451fcf865d2a9fab80cf7b30b9c154702ace3e 100644 (file)
@@ -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