rc: add sb size to rc params

Bug: 461792087
Change-Id: I928581777deee95104425c31885fbc8d06cdd7e8
diff --git a/aom/aom_ext_ratectrl.h b/aom/aom_ext_ratectrl.h
index c2bbf2c..dfc9c53 100644
--- a/aom/aom_ext_ratectrl.h
+++ b/aom/aom_ext_ratectrl.h
@@ -398,6 +398,7 @@
   int min_base_q_index;      /**< for VBR mode only */
   int max_base_q_index;      /**< for VBR mode only */
   int base_qp;               /**< base QP for leaf frames, 0-255 */
+  int superblock_size;       /**< 64 or 128 */
 } aom_rc_config_t;
 
 /*!\brief Control what ref frame to use and its index.
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index 54d63f1..23c02f8 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -4285,6 +4285,11 @@
     ratectrl_config.max_base_q_index = oxcf->rc_cfg.worst_allowed_q;
     ratectrl_config.base_qp = ctx->extra_cfg.cq_level;
 
+    const BLOCK_SIZE sb_size = av1_select_sb_size(
+        oxcf, frame_info->frame_width, frame_info->frame_height,
+        cpi->ppi->number_spatial_layers);
+    ratectrl_config.superblock_size = (sb_size == BLOCK_128X128) ? 128 : 64;
+
     if (ctx->cfg.rc_end_usage == AOM_VBR) {
       ratectrl_config.rc_mode = AOM_RC_VBR;
     } else if (ctx->cfg.rc_end_usage == AOM_Q) {