summaryrefslogtreecommitdiff
path: root/vp8
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2012-10-15 15:02:36 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2012-10-15 15:02:36 -0700
commit4dfa7589917d33f6683e2b039f9390a83be69c05 (patch)
treeb1f82d8b3e47a6310fdb51cbad435d6143cacc41 /vp8
parente788146247d47e0e24ad92259f6f016ffcf7b55a (diff)
parentb2f4257c391d5112eb14381d32161f7fb287a237 (diff)
downloadlibvpx-4dfa7589917d33f6683e2b039f9390a83be69c05.tar
libvpx-4dfa7589917d33f6683e2b039f9390a83be69c05.tar.gz
libvpx-4dfa7589917d33f6683e2b039f9390a83be69c05.tar.bz2
libvpx-4dfa7589917d33f6683e2b039f9390a83be69c05.zip
Merge "Changed to use real pixels only for evaluating MVs" into experimental
Diffstat (limited to 'vp8')
-rw-r--r--vp8/common/findnearmv.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/vp8/common/findnearmv.c b/vp8/common/findnearmv.c
index 235ca46ce..285aabdb6 100644
--- a/vp8/common/findnearmv.c
+++ b/vp8/common/findnearmv.c
@@ -217,7 +217,7 @@ void vp8_find_best_ref_mvs(MACROBLOCKD *xd,
unsigned char *above_ref;
unsigned char *left_ref;
int sad;
- int sad_scores[MAX_MV_REFS];
+ int sad_scores[MAX_MV_REFS] = {0};
int_mv sorted_mvs[MAX_MV_REFS];
int zero_seen = FALSE;
@@ -259,12 +259,13 @@ void vp8_find_best_ref_mvs(MACROBLOCKD *xd,
((this_mv.as_mv.col + 3) >> 3):((this_mv.as_mv.col + 4) >> 3);
offset = ref_y_stride * row_offset + col_offset;
- sad = vp8_sad16x3_c(above_src, xd->dst.y_stride,
- above_ref + offset, ref_y_stride, INT_MAX);
-
- sad += vp8_sad3x16_c(left_src, xd->dst.y_stride,
- left_ref + offset, ref_y_stride, INT_MAX);
-
+ sad = 0;
+ if (xd->up_available)
+ sad += vp8_sad16x3_c(above_src, xd->dst.y_stride,
+ above_ref + offset, ref_y_stride, INT_MAX);
+ if (xd->left_available)
+ sad += vp8_sad3x16_c(left_src, xd->dst.y_stride,
+ left_ref + offset, ref_y_stride, INT_MAX);
// Add the entry to our list and then resort the list on score.
sad_scores[i] = sad;
sorted_mvs[i].as_int = this_mv.as_int;