summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorJingning Han <jingning@google.com>2013-07-30 15:47:12 -0700
committerJingning Han <jingning@google.com>2013-07-30 19:49:36 -0700
commit86c384d39893cc569fda4c5e133c42659ae41b5f (patch)
treeff8a61cfe7dd88793260f6768a8d58820fac8bb1 /vp9
parent525745b17ab832000c36b9823f6874ef657c187d (diff)
downloadlibvpx-86c384d39893cc569fda4c5e133c42659ae41b5f.tar
libvpx-86c384d39893cc569fda4c5e133c42659ae41b5f.tar.gz
libvpx-86c384d39893cc569fda4c5e133c42659ae41b5f.tar.bz2
libvpx-86c384d39893cc569fda4c5e133c42659ae41b5f.zip
Make the use of ref_frame index consistent
Refactor the frame buffer referencing in choose_partition and make it consistent with other places. This means to prevent potential issues when we extend reference frame buffer. Change-Id: I5ff33ed5f671e1f4cc7049622212769a9b4578d9
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_encodeframe.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index 7ae9c3590..cd530fd82 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -1088,7 +1088,8 @@ static void choose_partitioning(VP9_COMP *cpi, MODE_INFO *m, int mi_row,
dp = 64;
if (cm->frame_type != KEY_FRAME) {
int_mv nearest_mv, near_mv;
- YV12_BUFFER_CONFIG *ref_fb = &cm->yv12_fb[0];
+ const int idx = cm->ref_frame_map[get_ref_frame_idx(cpi, LAST_FRAME)];
+ YV12_BUFFER_CONFIG *ref_fb = &cm->yv12_fb[idx];
YV12_BUFFER_CONFIG *second_ref_fb = NULL;
setup_pre_planes(xd, 0, ref_fb, mi_row, mi_col,
@@ -1104,7 +1105,6 @@ static void choose_partitioning(VP9_COMP *cpi, MODE_INFO *m, int mi_row,
vp9_build_inter_predictors_sby(xd, mi_row, mi_col, BLOCK_SIZE_SB64X64);
d = xd->plane[0].dst.buf;
dp = xd->plane[0].dst.stride;
-
}
// Fill in the entire tree of 8x8 variances for splits.
@@ -1166,6 +1166,7 @@ static void choose_partitioning(VP9_COMP *cpi, MODE_INFO *m, int mi_row,
}
}
}
+
static void rd_use_partition(VP9_COMP *cpi, MODE_INFO *m, TOKENEXTRA **tp,
int mi_row, int mi_col, BLOCK_SIZE_TYPE bsize,
int *rate, int64_t *dist, int do_recon) {