Merge FRAME_SUPERRES into HORZONLY_FRAME_SUPERRES.

Change-Id: I5fc45fa9fe6a354ae34001f48850eb68364a5a79
diff --git a/aomenc.c b/aomenc.c
index 54d6ba1..2375510 100644
--- a/aomenc.c
+++ b/aomenc.c
@@ -303,7 +303,7 @@
     ARG_DEF(NULL, "resize-denominator", 1, "Frame resize denominator");
 static const arg_def_t resize_kf_denominator = ARG_DEF(
     NULL, "resize-kf-denominator", 1, "Frame resize keyframe denominator");
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 static const arg_def_t superres_mode =
     ARG_DEF(NULL, "superres-mode", 1, "Frame super-resolution mode");
 static const arg_def_t superres_denominator = ARG_DEF(
@@ -316,7 +316,7 @@
 static const arg_def_t superres_kf_qthresh =
     ARG_DEF(NULL, "superres-kf-qthresh", 1,
             "Frame super-resolution keyframe qindex threshold");
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 static const struct arg_enum_list end_usage_enum[] = { { "vbr", AOM_VBR },
                                                        { "cbr", AOM_CBR },
                                                        { "cq", AOM_CQ },
@@ -344,13 +344,13 @@
                                       &resize_mode,
                                       &resize_denominator,
                                       &resize_kf_denominator,
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
                                       &superres_mode,
                                       &superres_denominator,
                                       &superres_kf_denominator,
                                       &superres_qthresh,
                                       &superres_kf_qthresh,
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
                                       &end_usage,
                                       &target_bitrate,
                                       &min_quantizer,
@@ -1119,7 +1119,7 @@
       config->cfg.rc_resize_denominator = arg_parse_uint(&arg);
     } else if (arg_match(&arg, &resize_kf_denominator, argi)) {
       config->cfg.rc_resize_kf_denominator = arg_parse_uint(&arg);
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
     } else if (arg_match(&arg, &superres_mode, argi)) {
       config->cfg.rc_superres_mode = arg_parse_uint(&arg);
     } else if (arg_match(&arg, &superres_denominator, argi)) {
@@ -1130,7 +1130,7 @@
       config->cfg.rc_superres_qthresh = arg_parse_uint(&arg);
     } else if (arg_match(&arg, &superres_kf_qthresh, argi)) {
       config->cfg.rc_superres_kf_qthresh = arg_parse_uint(&arg);
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
     } else if (arg_match(&arg, &end_usage, argi)) {
       config->cfg.rc_end_usage = arg_parse_enum_or_int(&arg);
     } else if (arg_match(&arg, &target_bitrate, argi)) {
@@ -1346,13 +1346,13 @@
   SHOW(rc_resize_mode);
   SHOW(rc_resize_denominator);
   SHOW(rc_resize_kf_denominator);
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   SHOW(rc_superres_mode);
   SHOW(rc_superres_denominator);
   SHOW(rc_superres_kf_denominator);
   SHOW(rc_superres_qthresh);
   SHOW(rc_superres_kf_qthresh);
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
   SHOW(rc_end_usage);
   SHOW(rc_target_bitrate);
   SHOW(rc_min_quantizer);
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index 03086e6..870e4df 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -253,7 +253,7 @@
               SCALE_NUMERATOR << 1);
   RANGE_CHECK(cfg, rc_resize_kf_denominator, SCALE_NUMERATOR,
               SCALE_NUMERATOR << 1);
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   RANGE_CHECK_HI(cfg, rc_superres_mode, SUPERRES_MODES - 1);
   RANGE_CHECK(cfg, rc_superres_denominator, SCALE_NUMERATOR,
               SCALE_NUMERATOR << 1);
@@ -261,7 +261,7 @@
               SCALE_NUMERATOR << 1);
   RANGE_CHECK(cfg, rc_superres_qthresh, 1, 63);
   RANGE_CHECK(cfg, rc_superres_kf_qthresh, 1, 63);
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
   // AV1 does not support a lower bound on the keyframe interval in
   // automatic keyframe placement mode.
@@ -534,7 +534,7 @@
       oxcf->resize_kf_scale_denominator == SCALE_NUMERATOR)
     oxcf->resize_mode = RESIZE_NONE;
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   oxcf->superres_mode = (SUPERRES_MODE)cfg->rc_superres_mode;
   oxcf->superres_scale_denominator = (uint8_t)cfg->rc_superres_denominator;
   oxcf->superres_kf_scale_denominator =
@@ -553,7 +553,7 @@
   if (oxcf->superres_mode == SUPERRES_QTHRESH &&
       oxcf->superres_qthresh == 255 && oxcf->superres_kf_qthresh == 255)
     oxcf->superres_mode = SUPERRES_NONE;
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
   oxcf->maximum_buffer_size_ms = is_vbr ? 240000 : cfg->rc_buf_sz;
   oxcf->starting_buffer_level_ms = is_vbr ? 60000 : cfg->rc_buf_initial_sz;
diff --git a/av1/common/alloccommon.c b/av1/common/alloccommon.c
index b60fc83..3687596 100644
--- a/av1/common/alloccommon.c
+++ b/av1/common/alloccommon.c
@@ -141,11 +141,11 @@
 
 // Now we need to allocate enough space to store the line buffers for the
 // stripes
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   const int frame_w = cm->superres_upscaled_width;
 #else
   const int frame_w = cm->width;
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 #if CONFIG_HIGHBITDEPTH
   const int use_highbd = cm->use_highbitdepth ? 1 : 0;
 #else
diff --git a/av1/common/av1_rtcd_defs.pl b/av1/common/av1_rtcd_defs.pl
index 3bf4f27..0bb1406 100755
--- a/av1/common/av1_rtcd_defs.pl
+++ b/av1/common/av1_rtcd_defs.pl
@@ -58,7 +58,7 @@
 add_proto qw/void av1_convolve_vert/, "const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int w, int h, const InterpFilterParams fp, const int subpel_x_q4, int x_step_q4, ConvolveParams *conv_params";
 specialize qw/av1_convolve_vert ssse3/;
 
-if (aom_config("CONFIG_FRAME_SUPERRES") eq "yes") {
+if (aom_config("CONFIG_HORZONLY_FRAME_SUPERRES") eq "yes") {
   add_proto qw/void av1_convolve_horiz_rs/, "const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int w, int h, const int16_t *x_filters, int interp_taps, const int x0_qn, const int x_step_qn";
   if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
     add_proto qw/void av1_highbd_convolve_horiz_rs/, "const uint16_t *src, int src_stride, uint16_t *dst, int dst_stride, int w, int h, const int16_t *x_filters, int interp_taps, const int x0_qn, const int x_step_qn, int bd";
diff --git a/av1/common/convolve.c b/av1/common/convolve.c
index 17df00f2..74b7085 100644
--- a/av1/common/convolve.c
+++ b/av1/common/convolve.c
@@ -25,7 +25,7 @@
 #define MAX_BLOCK_HEIGHT (MAX_SB_SIZE)
 #define MAX_STEP (32)
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 
 #define UPSCALE_PROC_UNIT 64  // Source step (roughly)
 #define UPSCALE_PROC_UNIT_SCALE (UPSCALE_PROC_UNIT / SCALE_NUMERATOR)
@@ -77,7 +77,7 @@
   }
 }
 #endif  // CONFIG_HIGHBITDEPTH
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 void av1_convolve_horiz_c(const uint8_t *src, int src_stride, uint8_t *dst,
                           int dst_stride, int w, int h,
diff --git a/av1/common/enums.h b/av1/common/enums.h
index 1d24ee7..ee48306 100644
--- a/av1/common/enums.h
+++ b/av1/common/enums.h
@@ -693,10 +693,10 @@
 } RestorationType;
 #endif  // CONFIG_LOOP_RESTORATION
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 #define SUPERRES_SCALE_BITS 3
 #define SUPERRES_SCALE_DENOMINATOR_MIN (SCALE_NUMERATOR + 1)
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 #ifdef __cplusplus
 }  // extern "C"
diff --git a/av1/common/onyxc_int.h b/av1/common/onyxc_int.h
index 02aec6a..d81d01d 100644
--- a/av1/common/onyxc_int.h
+++ b/av1/common/onyxc_int.h
@@ -404,12 +404,12 @@
   InterpFilter interp_filter;
 
   loop_filter_info_n lf_info;
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   // The denominator of the superres scale; the numerator is fixed.
   uint8_t superres_scale_denominator;
   int superres_upscaled_width;
   int superres_upscaled_height;
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 #if CONFIG_LOOP_RESTORATION
   RestorationInfo rst_info[MAX_MB_PLANE];
 
diff --git a/av1/common/resize.c b/av1/common/resize.c
index 61688d2..e390810 100644
--- a/av1/common/resize.c
+++ b/av1/common/resize.c
@@ -207,14 +207,7 @@
   { 0, 1, -2, 4, 127, -3, 1, 0 },      { 0, 0, -1, 2, 128, -1, 0, 0 },
 };
 
-#if CONFIG_FRAME_SUPERRES
-
 #if CONFIG_HORZONLY_FRAME_SUPERRES
-#define UPSCALE_NORMATIVE_TAPS 8
-#else
-#define UPSCALE_NORMATIVE_TAPS 6
-#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
-
 const int16_t av1_resize_filter_normative[(
     1 << RS_SUBPEL_BITS)][UPSCALE_NORMATIVE_TAPS] = {
 #if UPSCALE_NORMATIVE_TAPS == 2
@@ -322,7 +315,7 @@
 #error "Invalid value of UPSCALE_NORMATIVE_TAPS"
 #endif  // UPSCALE_NORMATIVE_TAPS == 2
 };
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 // Filters for factor of 2 downsampling.
 static const int16_t av1_down2_symeven_half_filter[] = { 56, 12, -3, -1 };
@@ -433,7 +426,7 @@
                    SUBPEL_TAPS);
 }
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 
 #define UPSCALE_PROC_UNIT 0  // Source step (roughly), 0: do not use
 #define UPSCALE_PROC_UNIT_SCALE (UPSCALE_PROC_UNIT / SCALE_NUMERATOR)
@@ -452,59 +445,7 @@
       RS_SCALE_EXTRA_OFF - err / 2;
   return (int32_t)((uint32_t)x0 & RS_SCALE_SUBPEL_MASK);
 }
-
-#if !CONFIG_HORZONLY_FRAME_SUPERRES
-static void interpolate_normative_core(const uint8_t *const src, int in_length,
-                                       uint8_t *dst, int out_length,
-                                       int superres_denom,
-                                       const int16_t *interp_filters,
-                                       int interp_taps) {
-  (void)superres_denom;
-  assert(in_length < out_length);
-  const int32_t x_step_qn =
-      av1_get_upscale_convolve_step(in_length, out_length);
-  const int32_t x0_qn =
-      get_upscale_convolve_x0(in_length, out_length, x_step_qn);
-  // Note since we are upscaling, the first output sample is located before
-  // the first input sample. Hence srcp = src - 1 + ... below
-  const uint8_t *srcp = src - 1;
-#if UPSCALE_PROC_UNIT
-  int32_t x0 = x0_qn;
-  const int oproc_unit = UPSCALE_PROC_UNIT_SCALE * superres_denom;
-  int olen = oproc_unit;
-  for (int op = 0; op < out_length; op += olen) {
-    olen = AOMMIN(oproc_unit, out_length - op);
-    av1_convolve_horiz_rs(srcp, 0, dst + op, 0, olen, 1, interp_filters,
-                          interp_taps, x0, x_step_qn);
-    x0 += olen * x_step_qn;
-    // Note srcp may advance by UPSCALE_PROC_UNIT +/- 1
-    srcp += (x0 >> RS_SCALE_SUBPEL_BITS);
-    x0 &= RS_SCALE_SUBPEL_MASK;
-  }
-#else
-  av1_convolve_horiz_rs(srcp, 0, dst, 0, out_length, 1, interp_filters,
-                        interp_taps, x0_qn, x_step_qn);
-#endif  // UPSCALE_PROC_UNIT
-}
-
-static void interpolate_normative(const uint8_t *const input, int in_length,
-                                  uint8_t *output, int out_length,
-                                  int superres_denom) {
-  uint8_t *intbuf_alloc = (uint8_t *)aom_malloc(
-      sizeof(*input) * (in_length + UPSCALE_NORMATIVE_TAPS + 2));
-  uint8_t *intbuf = intbuf_alloc + UPSCALE_NORMATIVE_TAPS / 2 + 1;
-  memcpy(intbuf, input, sizeof(*intbuf) * in_length);
-  for (int k = 0; k < UPSCALE_NORMATIVE_TAPS / 2 + 1; ++k) {
-    intbuf[-k - 1] = intbuf[0];
-    intbuf[in_length + k] = intbuf[in_length - 1];
-  }
-  interpolate_normative_core(intbuf, in_length, output, out_length,
-                             superres_denom, &av1_resize_filter_normative[0][0],
-                             UPSCALE_NORMATIVE_TAPS);
-  aom_free(intbuf_alloc);
-}
-#endif  // !CONFIG_HORZONLY_FRAME_SUPERRES
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 #ifndef __clang_analyzer__
 static void down2_symeven(const uint8_t *const input, int length,
@@ -718,7 +659,7 @@
   aom_free(arrbuf2);
 }
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 static void upscale_normative_plane(const uint8_t *const input, int height,
                                     int width, int in_stride, uint8_t *output,
                                     int height2, int width2, int out_stride,
@@ -727,7 +668,6 @@
   assert(height > 0);
   assert(width2 > 0);
   assert(height2 > 0);
-#if CONFIG_HORZONLY_FRAME_SUPERRES
   (void)height;
   (void)height2;
   (void)superres_denom;
@@ -737,27 +677,8 @@
   av1_convolve_horiz_rs(input - 1, in_stride, output, out_stride, width2,
                         height2, &av1_resize_filter_normative[0][0],
                         UPSCALE_NORMATIVE_TAPS, x0_qn, x_step_qn);
-#else
-  uint8_t *intbuf = (uint8_t *)aom_malloc(sizeof(uint8_t) * width2 * height);
-  uint8_t *arrbuf = (uint8_t *)aom_malloc(sizeof(uint8_t) * height);
-  uint8_t *arrbuf2 = (uint8_t *)aom_malloc(sizeof(uint8_t) * height2);
-  if (intbuf == NULL || arrbuf == NULL || arrbuf2 == NULL) goto Error;
-  for (int i = 0; i < height; ++i)
-    interpolate_normative(input + in_stride * i, width, intbuf + width2 * i,
-                          width2, superres_denom);
-  for (int i = 0; i < width2; ++i) {
-    fill_col_to_arr(intbuf + i, width2, height, arrbuf);
-    interpolate_normative(arrbuf, height, arrbuf2, height2, superres_denom);
-    fill_arr_to_col(output + i, out_stride, height2, arrbuf2);
-  }
-
-Error:
-  aom_free(intbuf);
-  aom_free(arrbuf);
-  aom_free(arrbuf2);
-#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 }
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 #if CONFIG_HIGHBITDEPTH
 static void highbd_interpolate_core(const uint16_t *const input, int in_length,
@@ -852,62 +773,6 @@
                           &interp_filters[0][0], SUBPEL_TAPS);
 }
 
-#if CONFIG_FRAME_SUPERRES
-#if !CONFIG_HORZONLY_FRAME_SUPERRES
-static void highbd_interpolate_normative_core(const uint16_t *const src,
-                                              int in_length, uint16_t *dst,
-                                              int out_length,
-                                              int superres_denom, int bd,
-                                              const int16_t *interp_filters,
-                                              int interp_taps) {
-  (void)superres_denom;
-  assert(in_length < out_length);
-  const int32_t x_step_qn =
-      av1_get_upscale_convolve_step(in_length, out_length);
-  const int32_t x0_qn =
-      get_upscale_convolve_x0(in_length, out_length, x_step_qn);
-  // Note since we are upscaling, the first output sample is located before
-  // the first input sample. Hence srcp = src - 1 + ... below
-  const uint16_t *srcp = src - 1;
-#if UPSCALE_PROC_UNIT
-  int32_t x0 = x0_qn;
-  const int oproc_unit = UPSCALE_PROC_UNIT_SCALE * superres_denom;
-  int olen = oproc_unit;
-  for (int op = 0; op < out_length; op += olen) {
-    olen = AOMMIN(oproc_unit, out_length - op);
-    av1_highbd_convolve_horiz_rs(srcp, 0, dst + op, 0, olen, 1, interp_filters,
-                                 interp_taps, x0, x_step_qn, bd);
-    x0 += olen * x_step_qn;
-    // Note srcp may advance by UPSCALE_PROC_UNIT +/- 1
-    srcp += (x0 >> RS_SCALE_SUBPEL_BITS);
-    x0 &= RS_SCALE_SUBPEL_MASK;
-  }
-#else
-  av1_highbd_convolve_horiz_rs(srcp, 0, dst, 0, out_length, 1, interp_filters,
-                               interp_taps, x0_qn, x_step_qn, bd);
-#endif  // UPSCALE_PROC_UNIT
-}
-
-static void highbd_interpolate_normative(const uint16_t *const input,
-                                         int in_length, uint16_t *output,
-                                         int out_length, int bd,
-                                         int superres_denom) {
-  uint16_t *intbuf_alloc = (uint16_t *)aom_malloc(
-      sizeof(*input) * (in_length + UPSCALE_NORMATIVE_TAPS + 2));
-  uint16_t *intbuf = intbuf_alloc + UPSCALE_NORMATIVE_TAPS / 2 + 1;
-  memcpy(intbuf, input, sizeof(*intbuf) * in_length);
-  for (int k = 0; k < UPSCALE_NORMATIVE_TAPS / 2 + 1; ++k) {
-    intbuf[-k - 1] = intbuf[0];
-    intbuf[in_length + k] = intbuf[in_length - 1];
-  }
-  highbd_interpolate_normative_core(
-      intbuf, in_length, output, out_length, superres_denom, bd,
-      &av1_resize_filter_normative[0][0], UPSCALE_NORMATIVE_TAPS);
-  aom_free(intbuf_alloc);
-}
-#endif  // !CONFIG_HORZONLY_FRAME_SUPERRES
-#endif  // CONFIG_FRAME_SUPERRES
-
 #ifndef __clang_analyzer__
 static void highbd_down2_symeven(const uint16_t *const input, int length,
                                  uint16_t *output, int bd) {
@@ -1104,7 +969,7 @@
   aom_free(arrbuf2);
 }
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 static void highbd_upscale_normative_plane(const uint8_t *const input,
                                            int height, int width, int in_stride,
                                            uint8_t *output, int height2,
@@ -1114,7 +979,6 @@
   assert(height > 0);
   assert(width2 > 0);
   assert(height2 > 0);
-#if CONFIG_HORZONLY_FRAME_SUPERRES
   (void)height;
   (void)height2;
   (void)superres_denom;
@@ -1125,31 +989,8 @@
                                CONVERT_TO_SHORTPTR(output), out_stride, width2,
                                height2, &av1_resize_filter_normative[0][0],
                                UPSCALE_NORMATIVE_TAPS, x0_qn, x_step_qn, bd);
-#else
-  uint16_t *intbuf = (uint16_t *)aom_malloc(sizeof(uint16_t) * width2 * height);
-  uint16_t *arrbuf = (uint16_t *)aom_malloc(sizeof(uint16_t) * height);
-  uint16_t *arrbuf2 = (uint16_t *)aom_malloc(sizeof(uint16_t) * height2);
-  if (intbuf == NULL || arrbuf == NULL || arrbuf2 == NULL) goto Error;
-  for (int i = 0; i < height; ++i) {
-    highbd_interpolate_normative(CONVERT_TO_SHORTPTR(input + in_stride * i),
-                                 width, intbuf + width2 * i, width2,
-                                 superres_denom, bd);
-  }
-  for (int i = 0; i < width2; ++i) {
-    highbd_fill_col_to_arr(intbuf + i, width2, height, arrbuf);
-    highbd_interpolate_normative(arrbuf, height, arrbuf2, height2,
-                                 superres_denom, bd);
-    highbd_fill_arr_to_col(CONVERT_TO_SHORTPTR(output + i), out_stride, height2,
-                           arrbuf2);
-  }
-
-Error:
-  aom_free(intbuf);
-  aom_free(arrbuf);
-  aom_free(arrbuf2);
-#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 }
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 #endif  // CONFIG_HIGHBITDEPTH
 
@@ -1268,7 +1109,7 @@
   aom_extend_frame_borders(dst);
 }
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 #if CONFIG_HIGHBITDEPTH
 void av1_upscale_normative_and_extend_frame(const YV12_BUFFER_CONFIG *src,
                                             YV12_BUFFER_CONFIG *dst,
@@ -1307,7 +1148,7 @@
   }
   aom_extend_frame_borders(dst);
 }
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 YV12_BUFFER_CONFIG *av1_scale_if_required(AV1_COMMON *cm,
                                           YV12_BUFFER_CONFIG *unscaled,
@@ -1342,14 +1183,11 @@
   calculate_scaled_size_helper(height, resize_denom);
 }
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 void av1_calculate_scaled_superres_size(int *width, int *height,
                                         int superres_denom) {
   (void)height;
   calculate_scaled_size_helper(width, superres_denom);
-#if !CONFIG_HORZONLY_FRAME_SUPERRES
-  calculate_scaled_size_helper(height, superres_denom);
-#endif  // !CONFIG_HORZONLY_FRAME_SUPERRES
 }
 
 void av1_calculate_unscaled_superres_size(int *width, int *height, int denom) {
@@ -1357,11 +1195,7 @@
     // Note: av1_calculate_scaled_superres_size() rounds *up* after division
     // when the resulting dimensions are odd. So here, we round *down*.
     *width = *width * denom / SCALE_NUMERATOR;
-#if CONFIG_HORZONLY_FRAME_SUPERRES
     (void)height;
-#else
-    *height = *height * denom / SCALE_NUMERATOR;
-#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
   }
 }
 
@@ -1438,8 +1272,6 @@
 
   // Scale up and back into frame_to_show.
   assert(frame_to_show->y_crop_width != cm->width);
-  assert(IMPLIES(!CONFIG_HORZONLY_FRAME_SUPERRES,
-                 frame_to_show->y_crop_height != cm->height));
 #if CONFIG_HIGHBITDEPTH
   av1_upscale_normative_and_extend_frame(&copy_buffer, frame_to_show,
                                          cm->superres_scale_denominator,
@@ -1452,4 +1284,4 @@
   // Free the copy buffer
   aom_free_frame_buffer(&copy_buffer);
 }
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
diff --git a/av1/common/resize.h b/av1/common/resize.h
index b4ccf28..d738c0e 100644
--- a/av1/common/resize.h
+++ b/av1/common/resize.h
@@ -71,7 +71,7 @@
                                  YV12_BUFFER_CONFIG *dst);
 #endif  // CONFIG_HIGHBITDEPTH
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 #if CONFIG_HIGHBITDEPTH
 void av1_upscale_normative_and_extend_frame(const YV12_BUFFER_CONFIG *src,
                                             YV12_BUFFER_CONFIG *dst,
@@ -81,7 +81,7 @@
                                             YV12_BUFFER_CONFIG *dst,
                                             int superres_denom);
 #endif  // CONFIG_HIGHBITDEPTH
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 YV12_BUFFER_CONFIG *av1_scale_if_required(AV1_COMMON *cm,
                                           YV12_BUFFER_CONFIG *unscaled,
@@ -91,7 +91,7 @@
 // resize scale denominator.
 void av1_calculate_scaled_size(int *width, int *height, int resize_denom);
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 // Similar to above, but calculates scaled dimensions after superres from the
 // given original dimensions and superres scale denominator.
 void av1_calculate_scaled_superres_size(int *width, int *height,
@@ -108,20 +108,16 @@
 static INLINE int av1_superres_unscaled(const AV1_COMMON *cm) {
   return (cm->superres_scale_denominator == SCALE_NUMERATOR);
 }
-#endif  // CONFIG_FRAME_SUPERRES
-
-#if CONFIG_FRAME_SUPERRES && CONFIG_LOOP_RESTORATION
-#if CONFIG_HORZONLY_FRAME_SUPERRES
-#define UPSCALE_NORMATIVE_TAPS 8
-#else
-#define UPSCALE_NORMATIVE_TAPS 6
 #endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
+#if CONFIG_HORZONLY_FRAME_SUPERRES && CONFIG_LOOP_RESTORATION
+#define UPSCALE_NORMATIVE_TAPS 8
+
 extern const int16_t av1_resize_filter_normative[1 << RS_SUBPEL_BITS]
                                                 [UPSCALE_NORMATIVE_TAPS];
 
 int32_t av1_get_upscale_convolve_step(int in_length, int out_length);
-#endif
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES && CONFIG_LOOP_RESTORATION
 
 #ifdef __cplusplus
 }  // extern "C"
diff --git a/av1/common/restoration.c b/av1/common/restoration.c
index 07d4f58..a57fa58 100644
--- a/av1/common/restoration.c
+++ b/av1/common/restoration.c
@@ -17,7 +17,7 @@
 #include "./aom_scale_rtcd.h"
 #include "aom_mem/aom_mem.h"
 #include "av1/common/onyxc_int.h"
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 #include "av1/common/resize.h"
 #endif
 #include "av1/common/restoration.h"
@@ -1616,7 +1616,7 @@
   const int mi_size_x = MI_SIZE >> ss_x;
   const int mi_size_y = MI_SIZE >> ss_y;
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   // Write m for the relative mi column or row, D for the superres denominator
   // and N for the superres numerator. If u is the upscaled (called "unscaled"
   // elsewhere) pixel offset then we can write the downscaled pixel offset in
@@ -1626,17 +1626,15 @@
   //
   // from which we get u = D * MI_SIZE * m / N
   const int mi_to_num_x = mi_size_x * cm->superres_scale_denominator;
-  const int mi_to_num_y =
-      mi_size_y *
-      (CONFIG_HORZONLY_FRAME_SUPERRES ? 1 : cm->superres_scale_denominator);
+  const int mi_to_num_y = mi_size_y;
   const int denom_x = size * SCALE_NUMERATOR;
-  const int denom_y = CONFIG_HORZONLY_FRAME_SUPERRES ? size : denom_x;
+  const int denom_y = size;
 #else
   const int mi_to_num_x = mi_size_x;
   const int mi_to_num_y = mi_size_y;
   const int denom_x = size;
   const int denom_y = size;
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
   const int rnd_x = denom_x - 1;
   const int rnd_y = denom_y - 1;
@@ -1707,7 +1705,7 @@
   assert(row + RESTORATION_CTX_VERT <= src_height);
 #endif  // NDEBUG
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   const int ss_x = is_uv && cm->subsampling_x;
   const int upscaled_width = (cm->superres_upscaled_width + ss_x) >> ss_x;
   const int step = av1_get_upscale_convolve_step(src_width, upscaled_width);
@@ -1731,7 +1729,7 @@
   for (int i = 0; i < RESTORATION_CTX_VERT; i++) {
     memcpy(bdry_rows + i * bdry_stride, src_rows + i * src_stride, line_bytes);
   }
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
   extend_lines(bdry_rows, upscaled_width, RESTORATION_CTX_VERT, bdry_stride,
                RESTORATION_EXTRA_HORZ, use_highbd);
 }
@@ -1751,7 +1749,7 @@
   const int bdry_stride = boundaries->stripe_boundary_stride << use_highbd;
   uint8_t *bdry_rows = bdry_start + RESTORATION_CTX_VERT * stripe * bdry_stride;
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   // At the point where this function is called, we've already applied
   // superres. So we don't need to extend the lines here, we can just
   // pull directly from the topmost row of the upscaled frame.
@@ -1761,7 +1759,7 @@
   (void)cm;
   const int src_width = frame->crop_widths[is_uv];
   const int upscaled_width = src_width;
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
   const int line_bytes = upscaled_width << use_highbd;
   for (int i = 0; i < RESTORATION_CTX_VERT; i++) {
     // Copy the line at 'row' into both context lines. This is because
diff --git a/av1/common/tile_common.c b/av1/common/tile_common.c
index 4612496..6b5f367 100644
--- a/av1/common/tile_common.c
+++ b/av1/common/tile_common.c
@@ -11,9 +11,9 @@
 
 #include "av1/common/tile_common.h"
 #include "av1/common/onyxc_int.h"
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 #include "av1/common/resize.h"
-#endif
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 #include "aom_dsp/aom_dsp_common.h"
 
 #if CONFIG_DEPENDENT_HORZTILES
@@ -252,7 +252,7 @@
   r.top = (tile_info->mi_row_start * MI_SIZE + ss_y) >> ss_y;
   r.bottom = (tile_info->mi_row_end * MI_SIZE + ss_y) >> ss_y;
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   // If upscaling is enabled, the tile limits need scaling to match the
   // upscaled frame where the restoration tiles live. To do this, scale up the
   // top-left and bottom-right of the tile.
@@ -268,7 +268,7 @@
 #else
   const int frame_w = cm->width;
   const int frame_h = cm->height;
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
   const int plane_w = (frame_w + ss_x) >> ss_x;
   const int plane_h = (frame_h + ss_y) >> ss_y;
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 1c643d4..22517f4 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -48,9 +48,9 @@
 #include "av1/common/quant_common.h"
 #include "av1/common/reconinter.h"
 #include "av1/common/reconintra.h"
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 #include "av1/common/resize.h"
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 #include "av1/common/seg_common.h"
 #include "av1/common/thread_common.h"
 #include "av1/common/tile_common.h"
@@ -1234,13 +1234,13 @@
 }
 
 static void setup_render_size(AV1_COMMON *cm, struct aom_read_bit_buffer *rb) {
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   cm->render_width = cm->superres_upscaled_width;
   cm->render_height = cm->superres_upscaled_height;
 #else
   cm->render_width = cm->width;
   cm->render_height = cm->height;
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
   if (aom_rb_read_bit(rb))
 #if CONFIG_FRAME_SIZE
     av1_read_frame_size(rb, 16, 16, &cm->render_width, &cm->render_height);
@@ -1249,7 +1249,7 @@
 #endif
 }
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 // TODO(afergs): make "struct aom_read_bit_buffer *const rb"?
 static void setup_superres(AV1_COMMON *const cm, struct aom_read_bit_buffer *rb,
                            int *width, int *height) {
@@ -1268,7 +1268,7 @@
     cm->superres_scale_denominator = SCALE_NUMERATOR;
   }
 }
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 #if CONFIG_SEGMENT_PRED_LAST
 static void resize_segmap_buffer(AV1_COMMON *cm) {
   aom_free(cm->cur_frame->seg_map);
@@ -1342,9 +1342,9 @@
 #else
   av1_read_frame_size(rb, &width, &height);
 #endif
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   setup_superres(cm, rb, &width, &height);
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
   resize_context_buffers(cm, width, height);
   setup_render_size(cm, rb);
 
@@ -1409,9 +1409,9 @@
       height = buf->y_crop_height;
       cm->render_width = buf->render_width;
       cm->render_height = buf->render_height;
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
       setup_superres(cm, rb, &width, &height);
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
       resize_context_buffers(cm, width, height);
       found = 1;
       break;
@@ -1426,9 +1426,9 @@
 #else
     av1_read_frame_size(rb, &width, &height);
 #endif
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
     setup_superres(cm, rb, &width, &height);
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
     resize_context_buffers(cm, width, height);
     setup_render_size(cm, rb);
   }
@@ -3138,13 +3138,13 @@
   }
 #else
   cm->use_prev_frame_mvs = !cm->error_resilient_mode && cm->prev_frame &&
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
                            cm->width == cm->last_width &&
                            cm->height == cm->last_height &&
 #else
                            cm->width == cm->prev_frame->buf.y_crop_width &&
                            cm->height == cm->prev_frame->buf.y_crop_height &&
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
                            !cm->last_intra_only && cm->last_show_frame &&
                            (cm->last_frame_type != KEY_FRAME);
 #endif  // CONFIG_TEMPMV_SIGNALING
@@ -3265,7 +3265,7 @@
     ec_ctxs[i - start_tile] = &pbi->tile_data[i].tctx;
 }
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 void superres_post_decode(AV1Decoder *pbi) {
   AV1_COMMON *const cm = &pbi->common;
   BufferPool *const pool = cm->buffer_pool;
@@ -3276,7 +3276,7 @@
   av1_superres_upscale(cm, pool);
   unlock_buffer_pool(pool);
 }
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 static void dec_setup_frame_boundary_info(AV1_COMMON *const cm) {
 // Note: When LOOPFILTERING_ACROSS_TILES is enabled, we need to clear the
@@ -3394,13 +3394,13 @@
   }
 #else
   cm->use_prev_frame_mvs = !cm->error_resilient_mode && cm->prev_frame &&
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
                            cm->width == cm->last_width &&
                            cm->height == cm->last_height &&
 #else
                            cm->width == cm->prev_frame->buf.y_crop_width &&
                            cm->height == cm->prev_frame->buf.y_crop_height &&
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
                            !cm->last_intra_only && cm->last_show_frame &&
                            (cm->last_frame_type != KEY_FRAME);
 #endif  // CONFIG_TEMPMV_SIGNALING
@@ -3533,15 +3533,15 @@
   }
 
 #if CONFIG_STRIPED_LOOP_RESTORATION
-#if CONFIG_FRAME_SUPERRES && CONFIG_HORZONLY_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   if (!av1_superres_unscaled(cm)) aom_extend_frame_borders(&pbi->cur_buf->buf);
-#endif
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
   if (cm->rst_info[0].frame_restoration_type != RESTORE_NONE ||
       cm->rst_info[1].frame_restoration_type != RESTORE_NONE ||
       cm->rst_info[2].frame_restoration_type != RESTORE_NONE) {
     av1_loop_restoration_save_boundary_lines(&pbi->cur_buf->buf, cm, 0);
   }
-#endif
+#endif  // CONFIG_STRIPED_LOOP_RESTORATION
 
   if (!cm->skip_loop_filter &&
 #if CONFIG_INTRABC
@@ -3552,9 +3552,9 @@
     av1_cdef_frame(&pbi->cur_buf->buf, cm, &pbi->mb);
   }
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   superres_post_decode(pbi);
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 #if CONFIG_LOOP_RESTORATION
   if (cm->rst_info[0].frame_restoration_type != RESTORE_NONE ||
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 7114830..73db844 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -3356,7 +3356,7 @@
   }
 }
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 static void write_superres_scale(const AV1_COMMON *const cm,
                                  struct aom_write_bit_buffer *wb) {
   // First bit is whether to to scale or not
@@ -3372,7 +3372,7 @@
         SUPERRES_SCALE_BITS);
   }
 }
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 #if CONFIG_FRAME_SIZE
 static void write_frame_size(const AV1_COMMON *cm, int frame_size_override,
@@ -3382,13 +3382,13 @@
                              struct aom_write_bit_buffer *wb)
 #endif
 {
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   const int coded_width = cm->superres_upscaled_width - 1;
   const int coded_height = cm->superres_upscaled_height - 1;
 #else
   const int coded_width = cm->width - 1;
   const int coded_height = cm->height - 1;
-#endif
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 #if CONFIG_FRAME_SIZE
   if (frame_size_override) {
@@ -3403,9 +3403,9 @@
   aom_wb_write_literal(wb, coded_height, 16);
 #endif
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   write_superres_scale(cm, wb);
-#endif
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
   write_render_size(cm, wb);
 }
 
@@ -3419,21 +3419,21 @@
     YV12_BUFFER_CONFIG *cfg = get_ref_frame_buffer(cpi, ref_frame);
 
     if (cfg != NULL) {
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
       found = cm->superres_upscaled_width == cfg->y_crop_width &&
               cm->superres_upscaled_height == cfg->y_crop_height;
 #else
       found =
           cm->width == cfg->y_crop_width && cm->height == cfg->y_crop_height;
-#endif
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
       found &= cm->render_width == cfg->render_width &&
                cm->render_height == cfg->render_height;
     }
     aom_wb_write_bit(wb, found);
     if (found) {
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
       write_superres_scale(cm, wb);
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
       break;
     }
   }
@@ -3739,13 +3739,13 @@
     aom_internal_error(&cm->error, AOM_CODEC_UNSUP_BITSTREAM,
                        "Frame dimensions are larger than the maximum values");
   }
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   const int coded_width = cm->superres_upscaled_width;
   const int coded_height = cm->superres_upscaled_height;
 #else
   const int coded_width = cm->width;
   const int coded_height = cm->height;
-#endif
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
   int frame_size_override_flag =
       (coded_width != cm->seq_params.max_frame_width ||
        coded_height != cm->seq_params.max_frame_height);
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index d68444c..170d403 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -3995,13 +3995,13 @@
 #else
   if (cm->prev_frame) {
     cm->use_prev_frame_mvs = !cm->error_resilient_mode &&
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
                              cm->width == cm->last_width &&
                              cm->height == cm->last_height &&
 #else
                              cm->width == cm->prev_frame->buf.y_crop_width &&
                              cm->height == cm->prev_frame->buf.y_crop_height &&
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
                              !cm->intra_only && cm->last_show_frame;
   } else {
     cm->use_prev_frame_mvs = 0;
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index ee3d40a..96a6fd8 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -789,11 +789,11 @@
 #if CONFIG_LOOP_RESTORATION
   if (aom_realloc_frame_buffer(
           &cpi->trial_frame_rst,
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
           cm->superres_upscaled_width, cm->superres_upscaled_height,
 #else
           cm->width, cm->height,
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
           cm->subsampling_x, cm->subsampling_y,
 #if CONFIG_HIGHBITDEPTH
           cm->use_highbitdepth,
@@ -3150,11 +3150,11 @@
 #endif
 
   av1_loop_filter_init(cm);
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   cm->superres_scale_denominator = SCALE_NUMERATOR;
   cm->superres_upscaled_width = oxcf->width;
   cm->superres_upscaled_height = oxcf->height;
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 #if CONFIG_LOOP_RESTORATION
   av1_loop_restoration_precal();
 #endif  // CONFIG_LOOP_RESTORATION
@@ -4366,13 +4366,13 @@
                        "Failed to allocate frame buffer");
 
 #if CONFIG_LOOP_RESTORATION
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   const int frame_width = cm->superres_upscaled_width;
   const int frame_height = cm->superres_upscaled_height;
 #else
   const int frame_width = cm->width;
   const int frame_height = cm->height;
-#endif
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
   set_restoration_unit_size(frame_width, frame_height, cm->subsampling_x,
                             cm->subsampling_y, cm->rst_info);
   for (int i = 0; i < MAX_MB_PLANE; ++i)
@@ -4442,7 +4442,7 @@
   return new_denom;
 }
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 
 static uint8_t calculate_next_superres_scale(AV1_COMP *cpi) {
   // Choose an arbitrary random number
@@ -4486,9 +4486,9 @@
 }
 
 static int dimensions_are_ok(int owidth, int oheight, size_params_type *rsz) {
-  return dimension_is_ok(owidth, rsz->resize_width, rsz->superres_denom) &&
-         (CONFIG_HORZONLY_FRAME_SUPERRES ||
-          dimension_is_ok(oheight, rsz->resize_height, rsz->superres_denom));
+  // Only need to check the width, as scaling is horizontal only.
+  (void)oheight;
+  return dimension_is_ok(owidth, rsz->resize_width, rsz->superres_denom);
 }
 
 static int validate_size_scales(RESIZE_MODE resize_mode,
@@ -4546,7 +4546,7 @@
   }
   return dimensions_are_ok(owidth, oheight, rsz);
 }
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 // Calculates resize and superres params for next frame
 size_params_type av1_calculate_next_size_params(AV1_COMP *cpi) {
@@ -4554,9 +4554,9 @@
   size_params_type rsz = {
     oxcf->width,
     oxcf->height,
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
     SCALE_NUMERATOR
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
   };
   int resize_denom;
   if (oxcf->pass == 1) return rsz;
@@ -4571,12 +4571,12 @@
     av1_calculate_scaled_size(&rsz.resize_width, &rsz.resize_height,
                               resize_denom);
   }
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   rsz.superres_denom = calculate_next_superres_scale(cpi);
   if (!validate_size_scales(oxcf->resize_mode, oxcf->superres_mode, oxcf->width,
                             oxcf->height, &rsz))
     assert(0 && "Invalid scale parameters");
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
   return rsz;
 }
 
@@ -4584,14 +4584,14 @@
   int encode_width = rsz->resize_width;
   int encode_height = rsz->resize_height;
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   AV1_COMMON *cm = &cpi->common;
   cm->superres_upscaled_width = encode_width;
   cm->superres_upscaled_height = encode_height;
   cm->superres_scale_denominator = rsz->superres_denom;
   av1_calculate_scaled_superres_size(&encode_width, &encode_height,
                                      rsz->superres_denom);
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
   set_frame_size(cpi, encode_width, encode_height);
 }
 
@@ -4600,7 +4600,7 @@
   setup_frame_size_from_params(cpi, &rsz);
 }
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 static void superres_post_encode(AV1_COMP *cpi) {
   AV1_COMMON *cm = &cpi->common;
 
@@ -4639,7 +4639,7 @@
     cpi->source = &cpi->scaled_source;
   }
 }
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) {
   MACROBLOCKD *xd = &cpi->td.mb.e_mbd;
@@ -4728,12 +4728,12 @@
   }
 
 #if CONFIG_STRIPED_LOOP_RESTORATION
-#if CONFIG_FRAME_SUPERRES && CONFIG_HORZONLY_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   if (!av1_superres_unscaled(cm)) aom_extend_frame_borders(cm->frame_to_show);
-#endif
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
   if (!no_restoration)
     av1_loop_restoration_save_boundary_lines(cm->frame_to_show, cm, 0);
-#endif
+#endif  // CONFIG_STRIPED_LOOP_RESTORATION
 
   if (no_cdef) {
     cm->cdef_bits = 0;
@@ -4749,9 +4749,9 @@
     av1_cdef_frame(cm->frame_to_show, cm, xd);
   }
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   superres_post_encode(cpi);
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 #if CONFIG_LOOP_RESTORATION
   if (no_restoration) {
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index 46371b4..f84485e 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -124,7 +124,7 @@
   RESIZE_RANDOM = 2,  // All frames are coded at a random scale.
   RESIZE_MODES
 } RESIZE_MODE;
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
 typedef enum {
   SUPERRES_NONE = 0,     // No frame superres allowed
   SUPERRES_FIXED = 1,    // All frames are coded at the specified scale,
@@ -135,7 +135,7 @@
                          // q_index
   SUPERRES_MODES
 } SUPERRES_MODE;
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
 typedef struct AV1EncoderConfig {
   BITSTREAM_PROFILE profile;
@@ -213,14 +213,14 @@
   uint8_t resize_scale_denominator;
   uint8_t resize_kf_scale_denominator;
 
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   // Frame Super-Resolution size scaling.
   SUPERRES_MODE superres_mode;
   uint8_t superres_scale_denominator;
   uint8_t superres_kf_scale_denominator;
   int superres_qthresh;
   int superres_kf_qthresh;
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 
   // Enable feature to reduce the frame quantization every x frames.
   int frame_periodic_boost;
@@ -798,20 +798,20 @@
 
 // Returns 1 if a frame is unscaled and 0 otherwise.
 static INLINE int av1_resize_unscaled(const AV1_COMMON *cm) {
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   return cm->superres_upscaled_width == cm->render_width &&
          cm->superres_upscaled_height == cm->render_height;
 #else
   return cm->width == cm->render_width && cm->height == cm->render_height;
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 }
 
 static INLINE int av1_frame_unscaled(const AV1_COMMON *cm) {
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   return av1_superres_unscaled(cm) && av1_resize_unscaled(cm);
 #else
   return av1_resize_unscaled(cm);
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 }
 
 #ifdef __cplusplus
diff --git a/av1/encoder/ratectrl.h b/av1/encoder/ratectrl.h
index 4bf4959..db51eed 100644
--- a/av1/encoder/ratectrl.h
+++ b/av1/encoder/ratectrl.h
@@ -50,9 +50,9 @@
 typedef struct {
   int resize_width;
   int resize_height;
-#if CONFIG_FRAME_SUPERRES
+#if CONFIG_HORZONLY_FRAME_SUPERRES
   uint8_t superres_denom;
-#endif  // CONFIG_FRAME_SUPERRES
+#endif  // CONFIG_HORZONLY_FRAME_SUPERRES
 } size_params_type;
 
 typedef struct {
diff --git a/build/cmake/aom_config_defaults.cmake b/build/cmake/aom_config_defaults.cmake
index 7646029..62db8dd 100644
--- a/build/cmake/aom_config_defaults.cmake
+++ b/build/cmake/aom_config_defaults.cmake
@@ -146,7 +146,6 @@
 set(CONFIG_FRAME_REFS 0 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_FRAME_SIGN_BIAS 0 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_FRAME_SIZE 1 CACHE NUMBER "AV1 experiment flag.")
-set(CONFIG_FRAME_SUPERRES 0 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_HASH_ME 0 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_HORZONLY_FRAME_SUPERRES 0 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_INTER_STATS_ONLY 0 CACHE NUMBER "AV1 experiment flag.")
diff --git a/build/cmake/aom_experiment_deps.cmake b/build/cmake/aom_experiment_deps.cmake
index e39d66e..8727da6 100644
--- a/build/cmake/aom_experiment_deps.cmake
+++ b/build/cmake/aom_experiment_deps.cmake
@@ -109,13 +109,6 @@
     endif ()
   endif ()
 
-  if (CONFIG_HORZONLY_FRAME_SUPERRES)
-    if (NOT CONFIG_FRAME_SUPERRES)
-      change_config_and_warn(CONFIG_FRAME_SUPERRES 1
-                             CONFIG_HORZONLY_FRAME_SUPERRES)
-    endif ()
-  endif ()
-
   if (CONFIG_INTRA_EDGE)
     if (NOT CONFIG_EXT_INTRA)
       change_config_and_warn(CONFIG_EXT_INTRA 1 CONFIG_INTRA_EDGE)
diff --git a/configure b/configure
index 03ba93c..d82d5e4 100755
--- a/configure
+++ b/configure
@@ -300,7 +300,6 @@
     txk_sel
     mv_compress
     segment_globalmv
-    frame_superres
     aom_qm
     ext_qm
     ext_comp_refs
@@ -545,7 +544,6 @@
     enabled frame_sign_bias && enable_feature frame_marker
     enabled txmg && enable_feature highbitdepth
     enabled ext_skip && enable_feature frame_marker
-    enabled horzonly_frame_superres && enable_feature frame_superres
     enabled loopfilter_level && enable_feature parallel_deblocking
     enabled loopfilter_level && enable_feature ext_delta_q
     enabled striped_loop_restoration && enable_feature loop_restoration