shithub: libvpx

Download patch

ref: 992d9a062af3b77af65dea52d41d295636a721f6
parent: 8fa5ca48999f67998c7a5f805dc27dc54b22e53d
parent: b6d71a308ce4a110652d737c6e9f6cf65c1e8e96
author: James Zern <[email protected]>
date: Thu Sep 10 02:10:44 EDT 2015

Merge "Fix ioc warnings related to sub8x8 reference frame"

--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -3787,11 +3787,6 @@
     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 @@
       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 @@
         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];
+        }
       }
     }