diff --git a/av1/common/av1_common_int.h b/av1/common/av1_common_int.h
index e20e0c7..226dd7c 100644
--- a/av1/common/av1_common_int.h
+++ b/av1/common/av1_common_int.h
@@ -134,10 +134,8 @@
   // distance when a very old frame is used as a reference.
   unsigned int display_order_hint;
   unsigned int ref_display_order_hint[INTER_REFS_PER_FRAME];
-#if CONFIG_FRAME_PARALLEL_ENCODE
   // Frame's level within the hierarchical structure.
   unsigned int pyramid_level;
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
   MV_REF *mvs;
   uint8_t *seg_map;
   struct segmentation seg;
@@ -344,10 +342,8 @@
 
   unsigned int order_hint;
   unsigned int display_order_hint;
-#if CONFIG_FRAME_PARALLEL_ENCODE
   // Frame's level within the hierarchical structure.
   unsigned int pyramid_level;
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
   unsigned int frame_number;
   SkipModeInfo skip_mode_info;
   int refresh_frame_flags;  // Which ref frames are overwritten by this frame
diff --git a/av1/common/mvref_common.c b/av1/common/mvref_common.c
index 837df2c..d8889f3 100644
--- a/av1/common/mvref_common.c
+++ b/av1/common/mvref_common.c
@@ -838,9 +838,7 @@
 void av1_setup_frame_buf_refs(AV1_COMMON *cm) {
   cm->cur_frame->order_hint = cm->current_frame.order_hint;
   cm->cur_frame->display_order_hint = cm->current_frame.display_order_hint;
-#if CONFIG_FRAME_PARALLEL_ENCODE
   cm->cur_frame->pyramid_level = cm->current_frame.pyramid_level;
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
   MV_REFERENCE_FRAME ref_frame;
   for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
     const RefCntBuffer *const buf = get_ref_frame_buf(cm, ref_frame);
diff --git a/av1/encoder/encode_strategy.c b/av1/encoder/encode_strategy.c
index 3fd6107..11708a2 100644
--- a/av1/encoder/encode_strategy.c
+++ b/av1/encoder/encode_strategy.c
@@ -506,171 +506,12 @@
   return ref_map_index;
 }
 
-static void update_arf_stack(int ref_map_index,
-                             RefBufferStack *ref_buffer_stack) {
-  if (ref_buffer_stack->arf_stack_size >= 0) {
-    if (ref_buffer_stack->arf_stack[0] == ref_map_index)
-      stack_pop(ref_buffer_stack->arf_stack, &ref_buffer_stack->arf_stack_size);
-  }
-
-  if (ref_buffer_stack->lst_stack_size) {
-    for (int i = ref_buffer_stack->lst_stack_size - 1; i >= 0; --i) {
-      if (ref_buffer_stack->lst_stack[i] == ref_map_index) {
-        for (int idx = i; idx < ref_buffer_stack->lst_stack_size - 1; ++idx)
-          ref_buffer_stack->lst_stack[idx] =
-              ref_buffer_stack->lst_stack[idx + 1];
-        ref_buffer_stack->lst_stack[ref_buffer_stack->lst_stack_size - 1] =
-            INVALID_IDX;
-        --ref_buffer_stack->lst_stack_size;
-      }
-    }
-  }
-
-  if (ref_buffer_stack->gld_stack_size) {
-    for (int i = ref_buffer_stack->gld_stack_size - 1; i >= 0; --i) {
-      if (ref_buffer_stack->gld_stack[i] == ref_map_index) {
-        for (int idx = i; idx < ref_buffer_stack->gld_stack_size - 1; ++idx)
-          ref_buffer_stack->gld_stack[idx] =
-              ref_buffer_stack->gld_stack[idx + 1];
-        ref_buffer_stack->gld_stack[ref_buffer_stack->gld_stack_size - 1] =
-            INVALID_IDX;
-        --ref_buffer_stack->gld_stack_size;
-      }
-    }
-  }
-}
-
-// Update reference frame stack info.
-void av1_update_ref_frame_map(const AV1_COMP *cpi,
-                              FRAME_UPDATE_TYPE frame_update_type,
-                              REFBUF_STATE refbuf_state, int ref_map_index,
-                              RefBufferStack *ref_buffer_stack) {
-  const AV1_COMMON *const cm = &cpi->common;
-
-  // TODO(jingning): Consider the S-frame same as key frame for the
-  // reference frame tracking purpose. The logic might be better
-  // expressed than converting the frame update type.
-  if (frame_is_sframe(cm)) frame_update_type = KF_UPDATE;
-  if (is_frame_droppable(&cpi->svc, &cpi->ext_flags.refresh_frame)) return;
-
-  switch (frame_update_type) {
-    case KF_UPDATE:
-      stack_reset(ref_buffer_stack->lst_stack,
-                  &ref_buffer_stack->lst_stack_size);
-      stack_reset(ref_buffer_stack->gld_stack,
-                  &ref_buffer_stack->gld_stack_size);
-      stack_reset(ref_buffer_stack->arf_stack,
-                  &ref_buffer_stack->arf_stack_size);
-      stack_push(ref_buffer_stack->gld_stack, &ref_buffer_stack->gld_stack_size,
-                 ref_map_index);
-      break;
-    case GF_UPDATE:
-      update_arf_stack(ref_map_index, ref_buffer_stack);
-      stack_push(ref_buffer_stack->gld_stack, &ref_buffer_stack->gld_stack_size,
-                 ref_map_index);
-      // For nonrd_mode: update LAST as well on GF_UPDATE frame.
-      // TODO(jingning, marpan): Why replacing both reference frames with the
-      // same decoded frame?
-      if (cpi->sf.rt_sf.use_nonrd_pick_mode)
-        stack_push(ref_buffer_stack->lst_stack,
-                   &ref_buffer_stack->lst_stack_size, ref_map_index);
-      break;
-    case LF_UPDATE:
-      update_arf_stack(ref_map_index, ref_buffer_stack);
-      stack_push(ref_buffer_stack->lst_stack, &ref_buffer_stack->lst_stack_size,
-                 ref_map_index);
-      break;
-    case ARF_UPDATE:
-    case INTNL_ARF_UPDATE:
-      if (refbuf_state == REFBUF_RESET) {
-        stack_reset(ref_buffer_stack->lst_stack,
-                    &ref_buffer_stack->lst_stack_size);
-        stack_reset(ref_buffer_stack->gld_stack,
-                    &ref_buffer_stack->gld_stack_size);
-        stack_reset(ref_buffer_stack->arf_stack,
-                    &ref_buffer_stack->arf_stack_size);
-      } else {
-        update_arf_stack(ref_map_index, ref_buffer_stack);
-      }
-      stack_push(ref_buffer_stack->arf_stack, &ref_buffer_stack->arf_stack_size,
-                 ref_map_index);
-      break;
-    case OVERLAY_UPDATE:
-      if (refbuf_state == REFBUF_RESET) {
-        ref_map_index = stack_pop(ref_buffer_stack->arf_stack,
-                                  &ref_buffer_stack->arf_stack_size);
-        stack_reset(ref_buffer_stack->lst_stack,
-                    &ref_buffer_stack->lst_stack_size);
-        stack_reset(ref_buffer_stack->gld_stack,
-                    &ref_buffer_stack->gld_stack_size);
-        stack_reset(ref_buffer_stack->arf_stack,
-                    &ref_buffer_stack->arf_stack_size);
-        stack_push(ref_buffer_stack->gld_stack,
-                   &ref_buffer_stack->gld_stack_size, ref_map_index);
-      } else {
-        if (ref_map_index != INVALID_IDX) {
-          update_arf_stack(ref_map_index, ref_buffer_stack);
-          stack_push(ref_buffer_stack->lst_stack,
-                     &ref_buffer_stack->lst_stack_size, ref_map_index);
-        }
-        ref_map_index = stack_pop(ref_buffer_stack->arf_stack,
-                                  &ref_buffer_stack->arf_stack_size);
-        stack_push(ref_buffer_stack->gld_stack,
-                   &ref_buffer_stack->gld_stack_size, ref_map_index);
-      }
-      break;
-    case INTNL_OVERLAY_UPDATE:
-      ref_map_index = stack_pop(ref_buffer_stack->arf_stack,
-                                &ref_buffer_stack->arf_stack_size);
-      stack_push(ref_buffer_stack->lst_stack, &ref_buffer_stack->lst_stack_size,
-                 ref_map_index);
-      break;
-    default: assert(0 && "unknown type");
-  }
-  return;
-}
-
-static int get_free_ref_map_index(
-#if CONFIG_FRAME_PARALLEL_ENCODE
-    RefFrameMapPair ref_map_pairs[REF_FRAMES],
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
-    const RefBufferStack *ref_buffer_stack) {
-#if CONFIG_FRAME_PARALLEL_ENCODE
-  (void)ref_buffer_stack;
+static int get_free_ref_map_index(RefFrameMapPair ref_map_pairs[REF_FRAMES]) {
   for (int idx = 0; idx < REF_FRAMES; ++idx)
     if (ref_map_pairs[idx].disp_order == -1) return idx;
   return INVALID_IDX;
-#else
-  for (int idx = 0; idx < REF_FRAMES; ++idx) {
-    int is_free = 1;
-    for (int i = 0; i < ref_buffer_stack->arf_stack_size; ++i) {
-      if (ref_buffer_stack->arf_stack[i] == idx) {
-        is_free = 0;
-        break;
-      }
-    }
-
-    for (int i = 0; i < ref_buffer_stack->lst_stack_size; ++i) {
-      if (ref_buffer_stack->lst_stack[i] == idx) {
-        is_free = 0;
-        break;
-      }
-    }
-
-    for (int i = 0; i < ref_buffer_stack->gld_stack_size; ++i) {
-      if (ref_buffer_stack->gld_stack[i] == idx) {
-        is_free = 0;
-        break;
-      }
-    }
-
-    if (is_free) return idx;
-  }
-  return INVALID_IDX;
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
 }
 
-#if CONFIG_FRAME_PARALLEL_ENCODE
 static int get_refresh_idx(RefFrameMapPair ref_frame_map_pairs[REF_FRAMES],
                            int update_arf,
 #if CONFIG_FRAME_PARALLEL_ENCODE_2
@@ -741,7 +582,7 @@
   return -1;
 }
 
-#if CONFIG_FRAME_PARALLEL_ENCODE_2
+#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FRAME_PARALLEL_ENCODE_2
 // Computes the reference refresh index for INTNL_ARF_UPDATE frame.
 int av1_calc_refresh_idx_for_intnl_arf(
     AV1_COMP *cpi, RefFrameMapPair ref_frame_map_pairs[REF_FRAMES],
@@ -749,7 +590,7 @@
   GF_GROUP *const gf_group = &cpi->ppi->gf_group;
 
   // Search for the open slot to store the current frame.
-  int free_fb_index = get_free_ref_map_index(ref_frame_map_pairs, NULL);
+  int free_fb_index = get_free_ref_map_index(ref_frame_map_pairs);
 
   // Use a free slot if available.
   if (free_fb_index != INVALID_IDX) {
@@ -762,18 +603,12 @@
     return refresh_idx;
   }
 }
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE_2
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
+#endif  // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FRAME_PARALLEL_ENCODE_2
 
-int av1_get_refresh_frame_flags(const AV1_COMP *const cpi,
-                                const EncodeFrameParams *const frame_params,
-                                FRAME_UPDATE_TYPE frame_update_type,
-                                int gf_index,
-#if CONFIG_FRAME_PARALLEL_ENCODE
-                                int cur_disp_order,
-                                RefFrameMapPair ref_frame_map_pairs[REF_FRAMES],
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
-                                const RefBufferStack *const ref_buffer_stack) {
+int av1_get_refresh_frame_flags(
+    const AV1_COMP *const cpi, const EncodeFrameParams *const frame_params,
+    FRAME_UPDATE_TYPE frame_update_type, int gf_index, int cur_disp_order,
+    RefFrameMapPair ref_frame_map_pairs[REF_FRAMES]) {
   const AV1_COMMON *const cm = &cpi->common;
   const ExtRefreshFrameFlagsInfo *const ext_refresh_frame_flags =
       &cpi->ext_flags.refresh_frame;
@@ -840,13 +675,8 @@
   }
 
   // Search for the open slot to store the current frame.
-  int free_fb_index = get_free_ref_map_index(
-#if CONFIG_FRAME_PARALLEL_ENCODE
-      ref_frame_map_pairs,
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
-      ref_buffer_stack);
+  int free_fb_index = get_free_ref_map_index(ref_frame_map_pairs);
 
-#if CONFIG_FRAME_PARALLEL_ENCODE
   // No refresh necessary for these frame types.
   if (frame_update_type == OVERLAY_UPDATE ||
       frame_update_type == INTNL_OVERLAY_UPDATE)
@@ -869,73 +699,6 @@
 #endif  // CONFIG_FRAME_PARALLEL_ENCODE_2
                       cur_disp_order);
   return 1 << refresh_idx;
-#else
-  switch (frame_update_type) {
-    case KF_UPDATE:
-    case GF_UPDATE:
-      if (free_fb_index != INVALID_IDX) {
-        refresh_mask = 1 << free_fb_index;
-      } else {
-        if (ref_buffer_stack->gld_stack_size)
-          refresh_mask =
-              1 << ref_buffer_stack
-                       ->gld_stack[ref_buffer_stack->gld_stack_size - 1];
-        else
-          refresh_mask =
-              1 << ref_buffer_stack
-                       ->lst_stack[ref_buffer_stack->lst_stack_size - 1];
-      }
-      break;
-    case LF_UPDATE:
-      if (free_fb_index != INVALID_IDX) {
-        refresh_mask = 1 << free_fb_index;
-      } else {
-        if (ref_buffer_stack->lst_stack_size >= 2)
-          refresh_mask =
-              1 << ref_buffer_stack
-                       ->lst_stack[ref_buffer_stack->lst_stack_size - 1];
-        else if (ref_buffer_stack->gld_stack_size >= 2)
-          refresh_mask =
-              1 << ref_buffer_stack
-                       ->gld_stack[ref_buffer_stack->gld_stack_size - 1];
-        else
-          assert(0 && "No ref map index found");
-      }
-      break;
-    case ARF_UPDATE:
-      if (free_fb_index != INVALID_IDX) {
-        refresh_mask = 1 << free_fb_index;
-      } else {
-        if (ref_buffer_stack->gld_stack_size >= 3)
-          refresh_mask =
-              1 << ref_buffer_stack
-                       ->gld_stack[ref_buffer_stack->gld_stack_size - 1];
-        else if (ref_buffer_stack->lst_stack_size >= 2)
-          refresh_mask =
-              1 << ref_buffer_stack
-                       ->lst_stack[ref_buffer_stack->lst_stack_size - 1];
-        else
-          assert(0 && "No ref map index found");
-      }
-      break;
-    case INTNL_ARF_UPDATE:
-      if (free_fb_index != INVALID_IDX) {
-        refresh_mask = 1 << free_fb_index;
-      } else {
-        refresh_mask =
-            1 << ref_buffer_stack
-                     ->lst_stack[ref_buffer_stack->lst_stack_size - 1];
-      }
-      break;
-    case OVERLAY_UPDATE:
-      if (free_fb_index != INVALID_IDX) refresh_mask = 1 << free_fb_index;
-      break;
-    case INTNL_OVERLAY_UPDATE: break;
-    default: assert(0); break;
-  }
-
-  return refresh_mask;
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
 }
 
 #if !CONFIG_REALTIME_ONLY
@@ -1138,25 +901,6 @@
 }
 #endif  // !CONFIG_REALTIME_ONLY
 
-#if !CONFIG_FRAME_PARALLEL_ENCODE
-static INLINE int find_unused_ref_frame(const int *used_ref_frames,
-                                        const int *stack, int stack_size) {
-  for (int i = 0; i < stack_size; ++i) {
-    const int this_ref = stack[i];
-    int ref_idx = 0;
-    for (ref_idx = 0; ref_idx <= ALTREF_FRAME - LAST_FRAME; ++ref_idx) {
-      if (this_ref == used_ref_frames[ref_idx]) break;
-    }
-
-    // not in use
-    if (ref_idx > ALTREF_FRAME - LAST_FRAME) return this_ref;
-  }
-
-  return INVALID_IDX;
-}
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
-
-#if CONFIG_FRAME_PARALLEL_ENCODE
 /*!\cond */
 // Struct to keep track of relevant reference frame data.
 typedef struct {
@@ -1222,13 +966,13 @@
   buffer_map[unmapped_idx].used = 1;
 }
 
-static void get_ref_frames(RefFrameMapPair ref_frame_map_pairs[REF_FRAMES],
+void av1_get_ref_frames(RefFrameMapPair ref_frame_map_pairs[REF_FRAMES],
+                        int cur_frame_disp,
 #if CONFIG_FRAME_PARALLEL_ENCODE_2
-                           const AV1_COMP *const cpi, int gf_index,
-                           int is_parallel_encode,
+                        const AV1_COMP *cpi, int gf_index,
+                        int is_parallel_encode,
 #endif  // CONFIG_FRAME_PARALLEL_ENCODE_2
-                           int cur_frame_disp,
-                           int remapped_ref_idx[REF_FRAMES]) {
+                        int remapped_ref_idx[REF_FRAMES]) {
   int buf_map_idx = 0;
 
   // Initialize reference frame mappings.
@@ -1431,102 +1175,6 @@
   for (int i = 0; i < REF_FRAMES; ++i)
     if (remapped_ref_idx[i] == INVALID_IDX) remapped_ref_idx[i] = 0;
 }
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
-
-void av1_get_ref_frames(const RefBufferStack *ref_buffer_stack,
-#if CONFIG_FRAME_PARALLEL_ENCODE
-                        RefFrameMapPair ref_frame_map_pairs[REF_FRAMES],
-                        int cur_frame_disp,
-#if CONFIG_FRAME_PARALLEL_ENCODE_2
-                        const AV1_COMP *cpi, int gf_index,
-                        int is_parallel_encode,
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE_2
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
-                        int remapped_ref_idx[REF_FRAMES]) {
-#if CONFIG_FRAME_PARALLEL_ENCODE
-  (void)ref_buffer_stack;
-  get_ref_frames(ref_frame_map_pairs,
-#if CONFIG_FRAME_PARALLEL_ENCODE_2
-                 cpi, gf_index, is_parallel_encode,
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE_2
-                 cur_frame_disp, remapped_ref_idx);
-  return;
-#else
-  const int *const arf_stack = ref_buffer_stack->arf_stack;
-  const int *const lst_stack = ref_buffer_stack->lst_stack;
-  const int *const gld_stack = ref_buffer_stack->gld_stack;
-  const int arf_stack_size = ref_buffer_stack->arf_stack_size;
-  const int lst_stack_size = ref_buffer_stack->lst_stack_size;
-  const int gld_stack_size = ref_buffer_stack->gld_stack_size;
-
-  // Initialization
-  for (int i = 0; i < REF_FRAMES; ++i) remapped_ref_idx[i] = INVALID_IDX;
-
-  if (arf_stack_size) {
-    remapped_ref_idx[ALTREF_FRAME - LAST_FRAME] = arf_stack[arf_stack_size - 1];
-
-    if (arf_stack_size > 1)
-      remapped_ref_idx[BWDREF_FRAME - LAST_FRAME] = arf_stack[0];
-
-    if (arf_stack_size > 2)
-      remapped_ref_idx[ALTREF2_FRAME - LAST_FRAME] = arf_stack[1];
-  }
-
-  if (lst_stack_size) {
-    remapped_ref_idx[LAST_FRAME - LAST_FRAME] = lst_stack[0];
-
-    if (lst_stack_size > 1)
-      remapped_ref_idx[LAST2_FRAME - LAST_FRAME] = lst_stack[1];
-  }
-
-  if (gld_stack_size) {
-    remapped_ref_idx[GOLDEN_FRAME - LAST_FRAME] = gld_stack[0];
-
-    // If there are more frames in the golden stack, assign them to BWDREF,
-    // ALTREF2, or LAST3.
-    if (gld_stack_size > 1) {
-      if (arf_stack_size <= 2) {
-        if (arf_stack_size <= 1) {
-          remapped_ref_idx[BWDREF_FRAME - LAST_FRAME] = gld_stack[1];
-          if (gld_stack_size > 2)
-            remapped_ref_idx[ALTREF2_FRAME - LAST_FRAME] = gld_stack[2];
-        } else {
-          remapped_ref_idx[ALTREF2_FRAME - LAST_FRAME] = gld_stack[1];
-        }
-      } else {
-        remapped_ref_idx[LAST3_FRAME - LAST_FRAME] = gld_stack[1];
-      }
-    }
-  }
-
-  for (int idx = ALTREF_FRAME - LAST_FRAME; idx >= 0; --idx) {
-    int ref_map_index = remapped_ref_idx[idx];
-
-    if (ref_map_index != INVALID_IDX) continue;
-
-    ref_map_index =
-        find_unused_ref_frame(remapped_ref_idx, arf_stack, arf_stack_size);
-
-    if (ref_map_index == INVALID_IDX) {
-      ref_map_index =
-          find_unused_ref_frame(remapped_ref_idx, gld_stack, gld_stack_size);
-    }
-
-    if (ref_map_index == INVALID_IDX) {
-      ref_map_index =
-          find_unused_ref_frame(remapped_ref_idx, lst_stack, lst_stack_size);
-    }
-
-    if (ref_map_index != INVALID_IDX) {
-      remapped_ref_idx[idx] = ref_map_index;
-    } else if (!gld_stack_size && arf_stack_size) {
-      remapped_ref_idx[idx] = ref_buffer_stack->arf_stack[0];
-    } else {
-      remapped_ref_idx[idx] = ref_buffer_stack->gld_stack[0];
-    }
-  }
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
-}
 
 int av1_encode_strategy(AV1_COMP *const cpi, size_t *const size,
                         uint8_t *const dest, unsigned int *frame_flags,
@@ -1826,13 +1474,11 @@
     const RefCntBuffer *ref_frames[INTER_REFS_PER_FRAME];
     const YV12_BUFFER_CONFIG *ref_frame_buf[INTER_REFS_PER_FRAME];
 
-#if CONFIG_FRAME_PARALLEL_ENCODE
     RefFrameMapPair ref_frame_map_pairs[REF_FRAMES];
     init_ref_map_pair(cpi, ref_frame_map_pairs);
     const int order_offset = gf_group->arf_src_offset[cpi->gf_frame_index];
     const int cur_frame_disp =
         cpi->common.current_frame.frame_number + order_offset;
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
 
 #if CONFIG_FRAME_PARALLEL_ENCODE
     int get_ref_frames = 0;
@@ -1846,13 +1492,10 @@
     {
 #endif  // CONFIG_FRAME_PARALLEL_ENCODE
       if (!ext_flags->refresh_frame.update_pending) {
-        av1_get_ref_frames(&cpi->ref_buffer_stack,
-#if CONFIG_FRAME_PARALLEL_ENCODE
-                           ref_frame_map_pairs, cur_frame_disp,
+        av1_get_ref_frames(ref_frame_map_pairs, cur_frame_disp,
 #if CONFIG_FRAME_PARALLEL_ENCODE_2
                            cpi, cpi->gf_frame_index, 1,
 #endif  // CONFIG_FRAME_PARALLEL_ENCODE_2
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
                            cm->remapped_ref_idx);
       } else if (cpi->svc.set_ref_frame_config) {
         for (unsigned int i = 0; i < INTER_REFS_PER_FRAME; i++)
@@ -1894,10 +1537,7 @@
 #endif
       frame_params.refresh_frame_flags = av1_get_refresh_frame_flags(
           cpi, &frame_params, frame_update_type, cpi->gf_frame_index,
-#if CONFIG_FRAME_PARALLEL_ENCODE
-          cur_frame_disp, ref_frame_map_pairs,
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
-          &cpi->ref_buffer_stack);
+          cur_frame_disp, ref_frame_map_pairs);
 #if CONFIG_FRAME_PARALLEL_ENCODE
 #if CONFIG_FRAME_PARALLEL_ENCODE_2
     } else {
@@ -1913,7 +1553,6 @@
       frame_params.refresh_frame_flags = 0;
 #endif  // CONFIG_FRAME_PARALLEL_ENCODE
 
-#if CONFIG_FRAME_PARALLEL_ENCODE
     frame_params.existing_fb_idx_to_show = INVALID_IDX;
     // Find the frame buffer to show based on display order.
     if (frame_params.show_existing_frame) {
@@ -1925,14 +1564,6 @@
           frame_params.existing_fb_idx_to_show = frame;
       }
     }
-#else
-    frame_params.existing_fb_idx_to_show =
-        frame_params.show_existing_frame
-            ? (frame_update_type == INTNL_OVERLAY_UPDATE
-                   ? get_ref_frame_map_idx(cm, BWDREF_FRAME)
-                   : get_ref_frame_map_idx(cm, ALTREF_FRAME))
-            : INVALID_IDX;
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
   }
 
   // The way frame_params->remapped_ref_idx is setup is a placeholder.
@@ -1978,23 +1609,11 @@
     cpi->source = &cpi->orig_source;
   }
 
-  // As the frame_update_type can get modified as part of
-  // av1_adjust_gf_refresh_qp_one_pass_rt
-  frame_update_type = get_frame_update_type(gf_group, cpi->gf_frame_index);
   if (!is_stat_generation_stage(cpi)) {
     // First pass doesn't modify reference buffer assignment or produce frame
     // flags
     update_frame_flags(&cpi->common, &cpi->refresh_frame, frame_flags);
     set_additional_frame_flags(cm, frame_flags);
-#if !CONFIG_FRAME_PARALLEL_ENCODE
-    if (!ext_flags->refresh_frame.update_pending) {
-      int ref_map_index =
-          av1_get_refresh_ref_frame_map(cm->current_frame.refresh_frame_flags);
-      av1_update_ref_frame_map(cpi, frame_update_type,
-                               gf_group->refbuf_state[cpi->gf_frame_index],
-                               ref_map_index, &cpi->ref_buffer_stack);
-    }
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
   }
 
 #if !CONFIG_REALTIME_ONLY
diff --git a/av1/encoder/encode_strategy.h b/av1/encoder/encode_strategy.h
index 15681c3..a04c483 100644
--- a/av1/encoder/encode_strategy.h
+++ b/av1/encoder/encode_strategy.h
@@ -68,44 +68,29 @@
                                   const REFBUF_STATE refbuf_state,
                                   int force_refresh_all);
 
-int av1_get_refresh_frame_flags(const AV1_COMP *const cpi,
-                                const EncodeFrameParams *const frame_params,
-                                FRAME_UPDATE_TYPE frame_update_type,
-                                int gf_index,
-#if CONFIG_FRAME_PARALLEL_ENCODE
-                                int cur_disp_order,
-                                RefFrameMapPair ref_frame_map_pairs[REF_FRAMES],
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
-                                const RefBufferStack *const ref_buffer_stack);
+int av1_get_refresh_frame_flags(
+    const AV1_COMP *const cpi, const EncodeFrameParams *const frame_params,
+    FRAME_UPDATE_TYPE frame_update_type, int gf_index, int cur_disp_order,
+    RefFrameMapPair ref_frame_map_pairs[REF_FRAMES]);
 
 int av1_get_refresh_ref_frame_map(int refresh_frame_flags);
 
-void av1_update_ref_frame_map(const AV1_COMP *cpi,
-                              FRAME_UPDATE_TYPE frame_update_type,
-                              REFBUF_STATE refbuf_state, int ref_map_index,
-                              RefBufferStack *ref_buffer_stack);
-
-/*!\brief Obtain indices of reference frames from reference frame buffer stacks
+/*!\brief Obtain indices of reference frames in ref_frame_map
  *
  * \callgraph
  * \callergraph
  *
- * \param[in]    ref_buffer_stack  Data structure for reference frame buffer
- *                                 stacks.
  * \param[out]   remapped_ref_idx  An array for storing indices of reference
  *                                 frames. The index is used to retrieve a
  *                                 reference frame buffer from ref_frame_map
  *                                 in AV1Common.
  */
-void av1_get_ref_frames(const RefBufferStack *ref_buffer_stack,
-#if CONFIG_FRAME_PARALLEL_ENCODE
-                        RefFrameMapPair ref_frame_map_pairs[REF_FRAMES],
+void av1_get_ref_frames(RefFrameMapPair ref_frame_map_pairs[REF_FRAMES],
                         int cur_frame_disp,
 #if CONFIG_FRAME_PARALLEL_ENCODE_2
                         const AV1_COMP *cpi, int gf_index,
                         int is_parallel_encode,
 #endif  // CONFIG_FRAME_PARALLEL_ENCODE_2
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
                         int remapped_ref_idx[REF_FRAMES]);
 
 int is_forced_keyframe_pending(struct lookahead_ctx *lookahead,
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index cb2f1df..e5d323c 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -3728,11 +3728,9 @@
   current_frame->order_hint %=
       (1 << (cm->seq_params->order_hint_info.order_hint_bits_minus_1 + 1));
 
-#if CONFIG_FRAME_PARALLEL_ENCODE
   current_frame->pyramid_level = get_true_pyr_level(
       cpi->ppi->gf_group.layer_depth[cpi->gf_frame_index],
       current_frame->display_order_hint, cpi->ppi->gf_group.max_layer_depth);
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
 
   if (is_stat_generation_stage(cpi)) {
 #if !CONFIG_REALTIME_ONLY
@@ -4723,7 +4721,7 @@
     first_cpi->time_stamps.prev_ts_end = ppi->ts_end_last_show_frame;
   }
 
-  av1_get_ref_frames(NULL, first_ref_frame_map_pairs, cur_frame_disp,
+  av1_get_ref_frames(first_ref_frame_map_pairs, cur_frame_disp,
 #if CONFIG_FRAME_PARALLEL_ENCODE_2
                      first_cpi, gf_index_start, 1,
 #endif  // CONFIG_FRAME_PARALLEL_ENCODE_2
@@ -4818,7 +4816,7 @@
 #endif  // CONFIG_FRAME_PARALLEL_ENCODE_2
       cur_cpi->twopass_frame.stats_in = stats_in;
 
-      av1_get_ref_frames(NULL, first_ref_frame_map_pairs, cur_frame_disp,
+      av1_get_ref_frames(first_ref_frame_map_pairs, cur_frame_disp,
 #if CONFIG_FRAME_PARALLEL_ENCODE_2
                          cur_cpi, i, 1,
 #endif  // CONFIG_FRAME_PARALLEL_ENCODE_2
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index 492c4a7..9bf156e 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -134,14 +134,13 @@
   FRAMEFLAGS_ERROR_RESILIENT = 1 << 6,
 } UENUM1BYTE(FRAMETYPE_FLAGS);
 
-#if CONFIG_FRAME_PARALLEL_ENCODE
-#if CONFIG_FPMT_TEST
+#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
 enum {
   PARALLEL_ENCODE = 0,
   PARALLEL_SIMULATION_ENCODE,
   NUM_FPMT_TEST_ENCODES
 } UENUM1BYTE(FPMT_TEST_ENC_CFG);
-#endif
+#endif  // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
 // 0 level frames are sometimes used for rate control purposes, but for
 // reference mapping purposes, the minimum level should be 1.
 #define MIN_PYR_LEVEL 1
@@ -159,7 +158,6 @@
   }
   return AOMMAX(MIN_PYR_LEVEL, frame_level);
 }
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
 
 enum {
   NO_AQ = 0,
@@ -2188,15 +2186,6 @@
 /*!\cond */
 
 typedef struct {
-  int arf_stack[FRAME_BUFFERS];
-  int arf_stack_size;
-  int lst_stack[FRAME_BUFFERS];
-  int lst_stack_size;
-  int gld_stack[FRAME_BUFFERS];
-  int gld_stack_size;
-} RefBufferStack;
-
-typedef struct {
   // Some misc info
   int high_prec;
   int q;
@@ -2919,11 +2908,6 @@
    */
   unsigned char gf_frame_index;
 
-  /*!
-   * To control the reference frame buffer and selection.
-   */
-  RefBufferStack ref_buffer_stack;
-
 #if CONFIG_INTERNAL_STATS
   /*!\cond */
   uint64_t time_compress_data;
@@ -3576,7 +3560,6 @@
 
 void av1_update_frame_size(AV1_COMP *cpi);
 
-#if CONFIG_FRAME_PARALLEL_ENCODE
 typedef struct {
   int pyr_level;
   int disp_order;
@@ -3616,7 +3599,7 @@
   }
 }
 
-#if CONFIG_FPMT_TEST
+#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
 static AOM_INLINE void calc_frame_data_update_flag(
     GF_GROUP *const gf_group, int gf_frame_index,
     bool *const do_frame_data_update) {
@@ -3641,38 +3624,6 @@
   }
 }
 #endif
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
-
-// TODO(jingning): Move these functions as primitive members for the new cpi
-// class.
-static INLINE void stack_push(int *stack, int *stack_size, int item) {
-  for (int i = *stack_size - 1; i >= 0; --i) stack[i + 1] = stack[i];
-  stack[0] = item;
-  ++*stack_size;
-}
-
-static INLINE int stack_pop(int *stack, int *stack_size) {
-  if (*stack_size <= 0) return -1;
-
-  int item = stack[0];
-  for (int i = 0; i < *stack_size; ++i) stack[i] = stack[i + 1];
-  --*stack_size;
-
-  return item;
-}
-
-static INLINE int stack_pop_end(int *stack, int *stack_size) {
-  int item = stack[*stack_size - 1];
-  stack[*stack_size - 1] = -1;
-  --*stack_size;
-
-  return item;
-}
-
-static INLINE void stack_reset(int *stack, int *stack_size) {
-  for (int i = 0; i < *stack_size; ++i) stack[i] = INVALID_IDX;
-  *stack_size = 0;
-}
 
 // av1 uses 10,000,000 ticks/second as time stamp
 #define TICKS_PER_SEC 10000000LL
diff --git a/av1/encoder/tpl_model.c b/av1/encoder/tpl_model.c
index 354e085..8e2d11d 100644
--- a/av1/encoder/tpl_model.c
+++ b/av1/encoder/tpl_model.c
@@ -1346,12 +1346,9 @@
   assert(cpi->gf_frame_index == 0);
   *pframe_qindex = 0;
 
-#if CONFIG_FRAME_PARALLEL_ENCODE
   RefFrameMapPair ref_frame_map_pairs[REF_FRAMES];
   init_ref_map_pair(cpi, ref_frame_map_pairs);
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
 
-  RefBufferStack ref_buffer_stack = cpi->ref_buffer_stack;
   int remapped_ref_idx[REF_FRAMES];
 
   EncodeFrameParams frame_params = *init_frame_params;
@@ -1425,25 +1422,17 @@
       tpl_frame->tpl_stats_ptr = tpl_data->tpl_stats_pool[process_frame_count];
       ++process_frame_count;
     }
-#if CONFIG_FRAME_PARALLEL_ENCODE
     const int true_disp = (int)(tpl_frame->frame_display_index);
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
 
-    av1_get_ref_frames(&ref_buffer_stack,
-#if CONFIG_FRAME_PARALLEL_ENCODE
-                       ref_frame_map_pairs, true_disp,
+    av1_get_ref_frames(ref_frame_map_pairs, true_disp,
 #if CONFIG_FRAME_PARALLEL_ENCODE_2
                        cpi, gf_index, 0,
 #endif  // CONFIG_FRAME_PARALLEL_ENCODE_2
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
                        remapped_ref_idx);
 
-    int refresh_mask = av1_get_refresh_frame_flags(
-        cpi, &frame_params, frame_update_type, gf_index,
-#if CONFIG_FRAME_PARALLEL_ENCODE
-        true_disp, ref_frame_map_pairs,
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
-        &ref_buffer_stack);
+    int refresh_mask =
+        av1_get_refresh_frame_flags(cpi, &frame_params, frame_update_type,
+                                    gf_index, true_disp, ref_frame_map_pairs);
 
 #if CONFIG_FRAME_PARALLEL_ENCODE
     // Make the frames marked as is_frame_non_ref to non-reference frames.
@@ -1451,13 +1440,7 @@
 #endif  // CONFIG_FRAME_PARALLEL_ENCODE
 
     int refresh_frame_map_index = av1_get_refresh_ref_frame_map(refresh_mask);
-#if !CONFIG_FRAME_PARALLEL_ENCODE
-    av1_update_ref_frame_map(cpi, frame_update_type,
-                             gf_group->refbuf_state[gf_index],
-                             refresh_frame_map_index, &ref_buffer_stack);
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
 
-#if CONFIG_FRAME_PARALLEL_ENCODE
     if (refresh_frame_map_index < REF_FRAMES &&
         refresh_frame_map_index != INVALID_IDX) {
       ref_frame_map_pairs[refresh_frame_map_index].disp_order =
@@ -1466,7 +1449,6 @@
           get_true_pyr_level(gf_group->layer_depth[gf_index], true_disp,
                              cpi->ppi->gf_group.max_layer_depth);
     }
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
 
     for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i)
       tpl_frame->ref_map_index[i - LAST_FRAME] =
@@ -1527,31 +1509,17 @@
     }
 #endif  // CONFIG_BITRATE_ACCURACY && CONFIG_THREE_PASS
     gf_group->q_val[gf_index] = *pframe_qindex;
-#if CONFIG_FRAME_PARALLEL_ENCODE
     const int true_disp = (int)(tpl_frame->frame_display_index);
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
-    av1_get_ref_frames(&ref_buffer_stack,
-#if CONFIG_FRAME_PARALLEL_ENCODE
-                       ref_frame_map_pairs, true_disp,
+    av1_get_ref_frames(ref_frame_map_pairs, true_disp,
 #if CONFIG_FRAME_PARALLEL_ENCODE_2
                        cpi, gf_index, 0,
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE_2
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
+#endif
                        remapped_ref_idx);
-    int refresh_mask = av1_get_refresh_frame_flags(
-        cpi, &frame_params, frame_update_type, gf_index,
-#if CONFIG_FRAME_PARALLEL_ENCODE
-        true_disp, ref_frame_map_pairs,
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
-        &ref_buffer_stack);
+    int refresh_mask =
+        av1_get_refresh_frame_flags(cpi, &frame_params, frame_update_type,
+                                    gf_index, true_disp, ref_frame_map_pairs);
     int refresh_frame_map_index = av1_get_refresh_ref_frame_map(refresh_mask);
-#if !CONFIG_FRAME_PARALLEL_ENCODE
-    av1_update_ref_frame_map(cpi, frame_update_type,
-                             gf_group->refbuf_state[gf_index],
-                             refresh_frame_map_index, &ref_buffer_stack);
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
 
-#if CONFIG_FRAME_PARALLEL_ENCODE
     if (refresh_frame_map_index < REF_FRAMES &&
         refresh_frame_map_index != INVALID_IDX) {
       ref_frame_map_pairs[refresh_frame_map_index].disp_order =
@@ -1560,7 +1528,6 @@
           get_true_pyr_level(gf_group->layer_depth[gf_index], true_disp,
                              cpi->ppi->gf_group.max_layer_depth);
     }
-#endif  // CONFIG_FRAME_PARALLEL_ENCODE
 
     for (int i = LAST_FRAME; i <= ALTREF_FRAME; ++i)
       tpl_frame->ref_map_index[i - LAST_FRAME] =
