summaryrefslogtreecommitdiff
path: root/vp9/common/vp9_mvref_common.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@google.com>2013-06-06 13:44:34 -0700
committerRonald S. Bultje <rbultje@google.com>2013-06-06 17:28:09 -0700
commit6ef805eb9d084eec2ca52ff5740cbd30972fbf78 (patch)
treed56e75726f4c33853b541a03132954f4e31ece5e /vp9/common/vp9_mvref_common.c
parent9062b92b0fb9e49fbe22ad844abdfaf9f86530dd (diff)
downloadlibvpx-6ef805eb9d084eec2ca52ff5740cbd30972fbf78.tar
libvpx-6ef805eb9d084eec2ca52ff5740cbd30972fbf78.tar.gz
libvpx-6ef805eb9d084eec2ca52ff5740cbd30972fbf78.tar.bz2
libvpx-6ef805eb9d084eec2ca52ff5740cbd30972fbf78.zip
Change ref frame coding.
Code intra/inter, then comp/single, then the ref frame selection. Use contextualization for all steps. Don't code two past frames in comp pred mode. Change-Id: I4639a78cd5cccb283023265dbcc07898c3e7cf95
Diffstat (limited to 'vp9/common/vp9_mvref_common.c')
-rw-r--r--vp9/common/vp9_mvref_common.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/vp9/common/vp9_mvref_common.c b/vp9/common/vp9_mvref_common.c
index 224151de4..f225c0236 100644
--- a/vp9/common/vp9_mvref_common.c
+++ b/vp9/common/vp9_mvref_common.c
@@ -47,12 +47,12 @@ static void clamp_mv_ref(const MACROBLOCKD *xd, int_mv *mv) {
static int get_matching_candidate(const MODE_INFO *candidate_mi,
MV_REFERENCE_FRAME ref_frame,
int_mv *c_mv, int block_idx) {
- if (ref_frame == candidate_mi->mbmi.ref_frame) {
+ if (ref_frame == candidate_mi->mbmi.ref_frame[0]) {
if (block_idx >= 0 && candidate_mi->mbmi.sb_type < BLOCK_SIZE_SB8X8)
c_mv->as_int = candidate_mi->bmi[block_idx].as_mv[0].as_int;
else
c_mv->as_int = candidate_mi->mbmi.mv[0].as_int;
- } else if (ref_frame == candidate_mi->mbmi.second_ref_frame) {
+ } else if (ref_frame == candidate_mi->mbmi.ref_frame[1]) {
if (block_idx >= 0 && candidate_mi->mbmi.sb_type < BLOCK_SIZE_SB8X8)
c_mv->as_int = candidate_mi->bmi[block_idx].as_mv[1].as_int;
else
@@ -79,18 +79,18 @@ static void get_non_matching_candidates(const MODE_INFO *candidate_mi,
*c2_ref_frame = INTRA_FRAME;
// If first candidate not valid neither will be.
- if (candidate_mi->mbmi.ref_frame > INTRA_FRAME) {
+ if (candidate_mi->mbmi.ref_frame[0] > INTRA_FRAME) {
// First candidate
- if (candidate_mi->mbmi.ref_frame != ref_frame) {
- *c_ref_frame = candidate_mi->mbmi.ref_frame;
+ if (candidate_mi->mbmi.ref_frame[0] != ref_frame) {
+ *c_ref_frame = candidate_mi->mbmi.ref_frame[0];
c_mv->as_int = candidate_mi->mbmi.mv[0].as_int;
}
// Second candidate
- if ((candidate_mi->mbmi.second_ref_frame > INTRA_FRAME) &&
- (candidate_mi->mbmi.second_ref_frame != ref_frame) &&
+ if ((candidate_mi->mbmi.ref_frame[1] > INTRA_FRAME) &&
+ (candidate_mi->mbmi.ref_frame[1] != ref_frame) &&
(candidate_mi->mbmi.mv[1].as_int != candidate_mi->mbmi.mv[0].as_int)) {
- *c2_ref_frame = candidate_mi->mbmi.second_ref_frame;
+ *c2_ref_frame = candidate_mi->mbmi.ref_frame[1];
c2_mv->as_int = candidate_mi->mbmi.mv[1].as_int;
}
}
@@ -226,7 +226,7 @@ void vp9_find_mv_refs_idx(VP9_COMMON *cm, MACROBLOCKD *xd, MODE_INFO *here,
&refmv_count, c_refmv, 16);
}
split_count += (candidate_mi->mbmi.sb_type < BLOCK_SIZE_SB8X8 &&
- candidate_mi->mbmi.ref_frame != INTRA_FRAME);
+ candidate_mi->mbmi.ref_frame[0] != INTRA_FRAME);
// Count number of neihgbours coded intra and zeromv
intra_count += (candidate_mi->mbmi.mode < NEARESTMV);