ref: 75459d65dfba690d6ded22219549ae1a528ca60c
parent: 4852a8023d0e8562fba338f20a064b40304f7858
author: Jim Bankoski <[email protected]>
date: Mon Jun 10 05:21:11 EDT 2013
border mvref issue Fixes mvref issue. Change-Id: I07dc1b0682845bc18fe0efa6af5e4f4da3abfa3a
--- a/vp9/common/vp9_mvref_common.c
+++ b/vp9/common/vp9_mvref_common.c
@@ -152,6 +152,7 @@
int split_count = 0;
int (*mv_ref_search)[2];
const int mi_col = get_mi_col(xd);
+ const int mi_row = get_mi_row(xd);
int intra_count = 0;
int zero_count = 0;
int newmv_count = 0;
@@ -171,10 +172,10 @@
// Look at nearest neigbours
for (i = 0; i < 2; ++i) {
const int mi_search_col = mi_col + mv_ref_search[i][0];
+ const int mi_search_row = mi_row + mv_ref_search[i][1];
if ((mi_search_col >= cm->cur_tile_mi_col_start) &&
(mi_search_col < cm->cur_tile_mi_col_end) &&
- ((mv_ref_search[i][1] << 6) >= xd->mb_to_top_edge) &&
- ((-mv_ref_search[i][1] << 6) <= xd->mb_to_bottom_edge)) {
+ (mi_search_row >= 0) && (mi_search_row < cm->mi_rows)) {
int b;
candidate_mi = here + mv_ref_search[i][0] +
@@ -206,11 +207,10 @@
for (i = 2; (i < MVREF_NEIGHBOURS) &&
(refmv_count < MAX_MV_REF_CANDIDATES); ++i) {
const int mi_search_col = mi_col + mv_ref_search[i][0];
-
+ const int mi_search_row = mi_row + mv_ref_search[i][1];
if ((mi_search_col >= cm->cur_tile_mi_col_start) &&
(mi_search_col < cm->cur_tile_mi_col_end) &&
- ((mv_ref_search[i][1] << 6) >= xd->mb_to_top_edge) &&
- ((-mv_ref_search[i][1] << 6) <= xd->mb_to_bottom_edge)) {
+ (mi_search_row >= 0) && (mi_search_row < cm->mi_rows)) {
candidate_mi = here + mv_ref_search[i][0] +
(mv_ref_search[i][1] * xd->mode_info_stride);
@@ -237,11 +237,10 @@
for (i = 0; (i < MVREF_NEIGHBOURS) &&
(refmv_count < MAX_MV_REF_CANDIDATES); ++i) {
const int mi_search_col = mi_col + mv_ref_search[i][0];
-
+ const int mi_search_row = mi_row + mv_ref_search[i][1];
if ((mi_search_col >= cm->cur_tile_mi_col_start) &&
(mi_search_col < cm->cur_tile_mi_col_end) &&
- ((mv_ref_search[i][1] << 6) >= xd->mb_to_top_edge) &&
- ((-mv_ref_search[i][1] << 6) <= xd->mb_to_bottom_edge)) {
+ (mi_search_row >= 0) && (mi_search_row < cm->mi_rows)) {
candidate_mi = here + mv_ref_search[i][0] +
(mv_ref_search[i][1] * xd->mode_info_stride);