Add RATECTRL_LOG

Since we need to record the rate control decision for
vbr / q / bitrate_accuracy mode, separate the log
object from VBR_RATECTRL_INFO

Add several functions to interact with RATECTRL_LOG

Other additional features:
1) Make bitrate_accuracy mode works with q mode.
bitrate_accuracy with q mode will be used for training rate model parameters

2) Fix update_type bug.
Properly set up update_type_list in vbr_rc_info

BUG=aomedia:3045

Change-Id: I498bdedb42e14c566d95bfcae6a7adb80f09f120
diff --git a/av1/encoder/thirdpass.c b/av1/encoder/thirdpass.c
index 68944d7..d526554 100644
--- a/av1/encoder/thirdpass.c
+++ b/av1/encoder/thirdpass.c
@@ -732,6 +732,7 @@
     for (int i = 0; i < tpl_info->gf_length; ++i) {
       tpl_info->txfm_stats_list[i] = tpl_data->txfm_stats_list[i];
       tpl_info->qstep_ratio_ls[i] = av1_tpl_get_qstep_ratio(tpl_data, i);
+      tpl_info->update_type_list[i] = gf_group->update_type[i];
     }
   }
 }
@@ -750,6 +751,9 @@
     fwrite_and_check(&tpl_info->qstep_ratio_ls,
                      sizeof(tpl_info->qstep_ratio_ls[0]), tpl_info->gf_length,
                      log_stream, error);
+    fwrite_and_check(&tpl_info->update_type_list,
+                     sizeof(tpl_info->update_type_list[0]), tpl_info->gf_length,
+                     log_stream, error);
   }
 }
 
@@ -768,6 +772,9 @@
     fread_and_check(&tpl_info->qstep_ratio_ls,
                     sizeof(tpl_info->qstep_ratio_ls[0]), tpl_info->gf_length,
                     log_stream, error);
+    fread_and_check(&tpl_info->update_type_list,
+                    sizeof(tpl_info->update_type_list[0]), tpl_info->gf_length,
+                    log_stream, error);
   }
 }
 #endif  // CONFIG_BITRATE_ACCURACY