Merge "Avoid dividing by 0 in vp8 gf_group bits compute"
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index 8ca7eb6..c7610ef 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -2171,6 +2171,8 @@
   }
 }
 
+static void init_motion_estimation(VP9_COMP *cpi);
+
 static void update_initial_width(VP9_COMP *cpi, int use_highbitdepth,
                                  int subsampling_x, int subsampling_y) {
   VP9_COMMON *const cm = &cpi->common;
@@ -2190,7 +2192,8 @@
 #if CONFIG_VP9_HIGHBITDEPTH
     cm->use_highbitdepth = use_highbitdepth;
 #endif
-
+    alloc_util_frame_buffers(cpi);
+    init_motion_estimation(cpi);
     cpi->initial_width = cm->width;
     cpi->initial_height = cm->height;
     cpi->initial_mbs = cm->MBs;