Group GF related config in AV1EncoderConfig

This CL groups GF related configuration parameters in
AV1EncoderConfig into a new struct GFConfig, cleans up
function interfaces, and adds relevant documentation.

BUG=aomedia:2701

Change-Id: Icdffc0480525202e057c9df88de2f8c7b4f43293
diff --git a/av1/encoder/encode_strategy.c b/av1/encoder/encode_strategy.c
index 720c975..55620a0 100644
--- a/av1/encoder/encode_strategy.c
+++ b/av1/encoder/encode_strategy.c
@@ -930,7 +930,7 @@
   }
 
   if (frame_params->frame_type == KEY_FRAME && !is_stat_generation_stage(cpi) &&
-      oxcf->enable_tpl_model && oxcf->lag_in_frames > 0 &&
+      oxcf->enable_tpl_model && oxcf->gf_cfg.lag_in_frames > 0 &&
       frame_params->show_frame) {
     av1_tpl_setup_stats(cpi, 0, frame_params, frame_input);
   }
@@ -1050,6 +1050,7 @@
   AV1_COMMON *const cm = &cpi->common;
   GF_GROUP *gf_group = &cpi->gf_group;
   ExternalFlags *const ext_flags = &cpi->ext_flags;
+  GFConfig *const gf_cfg = &oxcf->gf_cfg;
 
   EncodeFrameInput frame_input;
   EncodeFrameParams frame_params;
@@ -1060,10 +1061,10 @@
 
   // TODO(sarahparker) finish bit allocation for one pass pyramid
   if (has_no_stats_stage(cpi)) {
-    oxcf->gf_max_pyr_height =
-        AOMMIN(oxcf->gf_max_pyr_height, USE_ALTREF_FOR_ONE_PASS);
-    oxcf->gf_min_pyr_height =
-        AOMMIN(oxcf->gf_min_pyr_height, oxcf->gf_max_pyr_height);
+    gf_cfg->gf_max_pyr_height =
+        AOMMIN(gf_cfg->gf_max_pyr_height, USE_ALTREF_FOR_ONE_PASS);
+    gf_cfg->gf_min_pyr_height =
+        AOMMIN(gf_cfg->gf_min_pyr_height, gf_cfg->gf_max_pyr_height);
   }
 
   if (!is_stat_generation_stage(cpi)) {
@@ -1153,7 +1154,7 @@
 #else
   const int use_one_pass_rt_params = has_no_stats_stage(cpi) &&
                                      oxcf->mode == REALTIME &&
-                                     oxcf->lag_in_frames == 0;
+                                     gf_cfg->lag_in_frames == 0;
   if (use_one_pass_rt_params) {
     av1_get_one_pass_rt_params(cpi, &frame_params, *frame_flags);
   } else if (!is_stat_generation_stage(cpi)) {
@@ -1265,7 +1266,7 @@
   if (!frame_params.show_existing_frame) {
     cm->quant_params.using_qmatrix = oxcf->using_qm;
 #if !CONFIG_REALTIME_ONLY
-    if (oxcf->lag_in_frames > 0 && !is_stat_generation_stage(cpi)) {
+    if (gf_cfg->lag_in_frames > 0 && !is_stat_generation_stage(cpi)) {
       if (cpi->gf_group.index == 1 && oxcf->enable_tpl_model) {
         av1_configure_buffer_updates(cpi, &frame_params.refresh_frame,
                                      frame_update_type, 0);
@@ -1284,7 +1285,7 @@
   }
 #else
   if (has_no_stats_stage(cpi) && oxcf->mode == REALTIME &&
-      oxcf->lag_in_frames == 0) {
+      gf_cfg->lag_in_frames == 0) {
     if (av1_encode(cpi, dest, &frame_input, &frame_params, &frame_results) !=
         AOM_CODEC_OK) {
       return AOM_CODEC_ERROR;