Do not generate redundant ref MVs
Only 2 ref MVs are needed.
Change-Id: I1ce0e0c5293ffbf27ffa59af66734b99b3a3e79c
diff --git a/av1/common/mvref_common.c b/av1/common/mvref_common.c
index b5c7161..1490c55 100644
--- a/av1/common/mvref_common.c
+++ b/av1/common/mvref_common.c
@@ -708,17 +708,19 @@
}
// Build up the compound mv predictor
- int_mv comp_list[3][2];
+ int_mv comp_list[MAX_MV_REF_CANDIDATES][2];
for (int idx = 0; idx < 2; ++idx) {
int comp_idx = 0;
- for (int list_idx = 0; list_idx < ref_id_count[idx] && comp_idx < 2;
+ for (int list_idx = 0;
+ list_idx < ref_id_count[idx] && comp_idx < MAX_MV_REF_CANDIDATES;
++list_idx, ++comp_idx)
comp_list[comp_idx][idx] = ref_id[idx][list_idx];
- for (int list_idx = 0; list_idx < ref_diff_count[idx] && comp_idx < 2;
+ for (int list_idx = 0;
+ list_idx < ref_diff_count[idx] && comp_idx < MAX_MV_REF_CANDIDATES;
++list_idx, ++comp_idx)
comp_list[comp_idx][idx] = ref_diff[idx][list_idx];
- for (; comp_idx < 3; ++comp_idx)
+ for (; comp_idx < MAX_MV_REF_CANDIDATES; ++comp_idx)
comp_list[comp_idx][idx] = gm_mv_candidates[idx];
}