shithub: libvpx

Download patch

ref: a07eb47b254946d50c831dd895f94ad0ab5a553b
parent: 0a18228274fe0b648ce76456ca28987257a93f0a
parent: daa9b29ea1ed584d88bb2ee6313b2548f8f2549d
author: John Koleszar <jkoleszar@google.com>
date: Mon Mar 11 12:32:03 EDT 2013

Merge "Reinitialize motion search tables on frame size change" into experimental

--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -739,7 +739,6 @@
   int mode = cpi->compressor_speed;
   int speed = cpi->Speed;
   int i;
-  VP9_COMMON *cm = &cpi->common;
 
   // Only modes 0 and 1 supported for now in experimental code basae
   if (mode > 1)
@@ -839,16 +838,6 @@
     sf->improved_dct = 0;
   }
 
-  {
-    int y_stride = cm->yv12_fb[cm->ref_frame_map[cpi->lst_fb_idx]].y_stride;
-
-    if (cpi->sf.search_method == NSTEP) {
-      vp9_init3smotion_compensation(&cpi->mb, y_stride);
-    } else if (cpi->sf.search_method == DIAMOND) {
-      vp9_init_dsmotion_compensation(&cpi->mb, y_stride);
-    }
-  }
-
   cpi->mb.fwd_txm16x16  = vp9_short_fdct16x16;
   cpi->mb.fwd_txm8x8    = vp9_short_fdct8x8;
   cpi->mb.fwd_txm8x4    = vp9_short_fdct8x4;
@@ -1032,6 +1021,16 @@
                                     width, height, VP9BORDERINPIXELS))
     vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
                        "Failed to reallocate scaled source buffer");
+
+  {
+    int y_stride = cpi->scaled_source.y_stride;
+
+    if (cpi->sf.search_method == NSTEP) {
+      vp9_init3smotion_compensation(&cpi->mb, y_stride);
+    } else if (cpi->sf.search_method == DIAMOND) {
+      vp9_init_dsmotion_compensation(&cpi->mb, y_stride);
+    }
+  }
 }
 
 
--