summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2013-05-08 16:14:14 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2013-05-09 20:14:39 -0700
commita37ee9d2e8b9b7cf33455af60bcd9312dc898126 (patch)
tree246646e203b0ec450ada4e0681e1c6f8e04397f7 /vp9
parent6dab4d205e5c3cb51fc104109359a41f9c1b9111 (diff)
downloadlibvpx-a37ee9d2e8b9b7cf33455af60bcd9312dc898126.tar
libvpx-a37ee9d2e8b9b7cf33455af60bcd9312dc898126.tar.gz
libvpx-a37ee9d2e8b9b7cf33455af60bcd9312dc898126.tar.bz2
libvpx-a37ee9d2e8b9b7cf33455af60bcd9312dc898126.zip
Fix non-4:2:0 chroma MV calculation for SPLITMV
The previous code was somewhat vestigial for 16x16 MI units, but was incorrect when called with chroma blocks larger than 4x4 because the block index caused a reference to a non-existent BMI. This patch uses the same MV for all chroma subblocks in SPLITMV mode, which is suboptimal for non-4:2:0 subsamplings, but as SPLITMV may be removed in the near future, will use this as a stop gap. Change-Id: I3211cee5ccf1cfb426e5eef5353b0ce5bb92b4cd
Diffstat (limited to 'vp9')
-rw-r--r--vp9/common/vp9_reconinter.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/vp9/common/vp9_reconinter.c b/vp9/common/vp9_reconinter.c
index 0f5cbf4ac..3668fcdae 100644
--- a/vp9/common/vp9_reconinter.c
+++ b/vp9/common/vp9_reconinter.c
@@ -257,22 +257,19 @@ static INLINE int round_mv_comp_q4(int value) {
return (value < 0 ? value - 2 : value + 2) / 4;
}
-#define IDX1 2
-#define IDX2 3
-
-static int mi_mv_pred_row_q4(MACROBLOCKD *mb, int off, int idx) {
- const int temp = mb->mode_info_context->bmi[off + 0].as_mv[idx].as_mv.row +
- mb->mode_info_context->bmi[off + 1].as_mv[idx].as_mv.row +
- mb->mode_info_context->bmi[off + IDX1].as_mv[idx].as_mv.row +
- mb->mode_info_context->bmi[off + IDX2].as_mv[idx].as_mv.row;
+static int mi_mv_pred_row_q4(MACROBLOCKD *mb, int idx) {
+ const int temp = mb->mode_info_context->bmi[0].as_mv[idx].as_mv.row +
+ mb->mode_info_context->bmi[1].as_mv[idx].as_mv.row +
+ mb->mode_info_context->bmi[2].as_mv[idx].as_mv.row +
+ mb->mode_info_context->bmi[3].as_mv[idx].as_mv.row;
return round_mv_comp_q4(temp);
}
-static int mi_mv_pred_col_q4(MACROBLOCKD *mb, int off, int idx) {
- const int temp = mb->mode_info_context->bmi[off + 0].as_mv[idx].as_mv.col +
- mb->mode_info_context->bmi[off + 1].as_mv[idx].as_mv.col +
- mb->mode_info_context->bmi[off + IDX1].as_mv[idx].as_mv.col +
- mb->mode_info_context->bmi[off + IDX2].as_mv[idx].as_mv.col;
+static int mi_mv_pred_col_q4(MACROBLOCKD *mb, int idx) {
+ const int temp = mb->mode_info_context->bmi[0].as_mv[idx].as_mv.col +
+ mb->mode_info_context->bmi[1].as_mv[idx].as_mv.col +
+ mb->mode_info_context->bmi[2].as_mv[idx].as_mv.col +
+ mb->mode_info_context->bmi[3].as_mv[idx].as_mv.col;
return round_mv_comp_q4(temp);
}
@@ -351,9 +348,12 @@ static void build_inter_predictors(int plane, int block,
if (plane == 0) {
mv = &xd->mode_info_context->bmi[block].as_mv[which_mv].as_mv;
} else {
- const int y_block = (block & 2) * 4 + (block & 1) * 2;
- split_chroma_mv.row = mi_mv_pred_row_q4(xd, y_block, which_mv);
- split_chroma_mv.col = mi_mv_pred_col_q4(xd, y_block, which_mv);
+ // TODO(jkoleszar): All chroma MVs in SPLITMV mode are taken as the
+ // same MV (the average of the 4 luma MVs) but we could do something
+ // smarter for non-4:2:0. Just punt for now, pending the changes to get
+ // rid of SPLITMV mode entirely.
+ split_chroma_mv.row = mi_mv_pred_row_q4(xd, which_mv);
+ split_chroma_mv.col = mi_mv_pred_col_q4(xd, which_mv);
mv = &split_chroma_mv;
}
} else {