Calculate coeff token cost before encoding each SB

Compression gain:
AWCY
PSNR	PSNR HVS	SSIM	CIEDE 2000
-0.42	-0.15   	-0.38	-0.62

Google testsets
lowres -0.18%
midres -0.32%

No obvious encoding speed changes observed.

Change-Id: I888cf4b22b591d79d80b2d77c9eb10d84e5de722
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index 81c4d88..fdb0bfe 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -421,8 +421,8 @@
   x->nmvjointcost = x->nmv_vec_cost[nmv_ctx];
 }
 
-void fill_token_costs_from_cdf(av1_coeff_cost *cost,
-                               coeff_cdf_model (*cdf)[PLANE_TYPES]) {
+void av1_fill_token_costs_from_cdf(av1_coeff_cost *cost,
+                                   coeff_cdf_model (*cdf)[PLANE_TYPES]) {
   for (int tx = 0; tx < TX_SIZES; ++tx) {
     for (int pt = 0; pt < PLANE_TYPES; ++pt) {
       for (int rt = 0; rt < REF_TYPES; ++rt) {
@@ -471,15 +471,13 @@
   }
 #endif
 
-  if (cpi->oxcf.pass != 1) {
-    fill_token_costs_from_cdf(x->token_head_costs, cm->fc->coef_head_cdfs);
-    fill_token_costs_from_cdf(x->token_tail_costs, cm->fc->coef_tail_cdfs);
 #if CONFIG_GLOBAL_MOTION
+  if (cpi->oxcf.pass != 1) {
     for (int i = 0; i < TRANS_TYPES; ++i)
       cpi->gmtype_cost[i] = (1 + (i > 0 ? GLOBAL_TYPE_BITS : 0))
                             << AV1_PROB_COST_SHIFT;
-#endif  // CONFIG_GLOBAL_MOTION
   }
+#endif  // CONFIG_GLOBAL_MOTION
 }
 
 static void model_rd_norm(int xsq_q10, int *r_q10, int *d_q10) {