Enforce trellis optimization for 1-pass encoding

This fixes the unit test failure in the 1-pass settings of
EndToEndTestLarge.EndtoEndPSNRTest

bug=webm:1243

Change-Id: I7667c341f7c063f7ffb83786446bbbd1e498c1aa
diff --git a/vp10/encoder/encodemb.c b/vp10/encoder/encodemb.c
index df96967..7f3646c 100644
--- a/vp10/encoder/encodemb.c
+++ b/vp10/encoder/encodemb.c
@@ -1053,7 +1053,7 @@
   }
 #endif
 
-  if (x->optimize && p->eobs[block]) {
+  if (p->eobs[block]) {
     int ctx;
 #if CONFIG_VAR_TX
     switch (tx_size) {
@@ -1234,24 +1234,15 @@
     int idx, idy;
     int block = 0;
     int step = 1 << (max_tx_size * 2);
+    vp10_get_entropy_contexts(bsize, TX_4X4, pd, ctx.ta[plane], ctx.tl[plane]);
+#else
+    const struct macroblockd_plane* const pd = &xd->plane[plane];
+    const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi, pd) : mbmi->tx_size;
+    vp10_get_entropy_contexts(bsize, tx_size, pd, ctx.ta[plane], ctx.tl[plane]);
 #endif
     vp10_subtract_plane(x, bsize, plane);
-
     arg.ta = ctx.ta[plane];
     arg.tl = ctx.tl[plane];
-
-    if (x->optimize) {
-#if CONFIG_VAR_TX
-      vp10_get_entropy_contexts(bsize, TX_4X4, pd,
-                                ctx.ta[plane], ctx.tl[plane]);
-#else
-      const struct macroblockd_plane* const pd = &xd->plane[plane];
-      const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi, pd) : mbmi->tx_size;
-      vp10_get_entropy_contexts(bsize, tx_size, pd,
-                                ctx.ta[plane], ctx.tl[plane]);
-#endif
-    }
-
 #if CONFIG_VAR_TX
     for (idy = 0; idy < mi_height; idy += bh) {
       for (idx = 0; idx < mi_width; idx += bh) {
@@ -1351,7 +1342,7 @@
 #endif  // CONFIG_NEW_QUANT
   a = &args->ta[blk_col];
   l = &args->tl[blk_row];
-  if (x->optimize && p->eobs[block]) {
+  if (p->eobs[block]) {
     int ctx;
     ctx = combine_entropy_contexts(*a, *l);
     *a = *l = vp10_optimize_b(x, plane, block, tx_size, ctx) > 0;
@@ -1388,7 +1379,7 @@
 
   struct encode_b_args arg = {x, NULL, &xd->mi[0]->mbmi.skip, ta, tl};
 
-  if (enable_optimize_b && x->optimize) {
+  if (enable_optimize_b) {
     const struct macroblockd_plane* const pd = &xd->plane[plane];
     const TX_SIZE tx_size = plane ? get_uv_tx_size(&xd->mi[0]->mbmi, pd) :
         xd->mi[0]->mbmi.tx_size;