summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_rdopt.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 72a09a982..3c84a7753 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -3787,11 +3787,6 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi,
int64_t total_sse = INT_MAX;
int early_term = 0;
struct buf_2d backup_yv12[2][MAX_MB_PLANE];
- const YV12_BUFFER_CONFIG *scaled_ref_frame[2] = {
- vp9_get_scaled_ref_frame(cpi, vp9_ref_order[ref_index].ref_frame[0]),
- vp9_get_scaled_ref_frame(cpi, vp9_ref_order[ref_index].ref_frame[1])
- };
- int ref;
ref_frame = vp9_ref_order[ref_index].ref_frame[0];
second_ref_frame = vp9_ref_order[ref_index].ref_frame[1];
@@ -3927,7 +3922,13 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi,
int pred_exists = 0;
int uv_skippable;
+ YV12_BUFFER_CONFIG *scaled_ref_frame[2] = {NULL, NULL};
+ int ref;
+
for (ref = 0; ref < 2; ++ref) {
+ scaled_ref_frame[ref] = mbmi->ref_frame[ref] > INTRA_FRAME ?
+ vp9_get_scaled_ref_frame(cpi, mbmi->ref_frame[ref]) : NULL;
+
if (scaled_ref_frame[ref]) {
int i;
// Swap out the reference frame for a version that's been scaled to
@@ -4089,14 +4090,14 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi,
skippable = skippable && uv_skippable;
total_sse += uv_sse;
}
- }
- for (ref = 0; ref < 2; ++ref) {
- if (scaled_ref_frame[ref]) {
- // Restore the prediction frame pointers to their unscaled versions.
- int i;
- for (i = 0; i < MAX_MB_PLANE; ++i)
- xd->plane[i].pre[ref] = backup_yv12[ref][i];
+ for (ref = 0; ref < 2; ++ref) {
+ if (scaled_ref_frame[ref]) {
+ // Restore the prediction frame pointers to their unscaled versions.
+ int i;
+ for (i = 0; i < MAX_MB_PLANE; ++i)
+ xd->plane[i].pre[ref] = backup_yv12[ref][i];
+ }
}
}