Populate rdmult through ducky_encode to tpl build

BUG=b/257303751

Change-Id: Ibe1130bffe2155d178eb3933daba7e40ab873587
diff --git a/av1/encoder/firstpass.h b/av1/encoder/firstpass.h
index be52e8e..d5f750f 100644
--- a/av1/encoder/firstpass.h
+++ b/av1/encoder/firstpass.h
@@ -355,6 +355,7 @@
   int max_layer_depth_allowed;
   // This is currently only populated for AOM_Q mode
   int q_val[MAX_STATIC_GF_GROUP_LENGTH];
+  int rdmult_val[MAX_STATIC_GF_GROUP_LENGTH];
   int bit_allocation[MAX_STATIC_GF_GROUP_LENGTH];
   // The frame coding type - inter/intra frame
   FRAME_TYPE frame_type[MAX_STATIC_GF_GROUP_LENGTH];
diff --git a/av1/encoder/tpl_model.c b/av1/encoder/tpl_model.c
index 178504c..2ad1122 100644
--- a/av1/encoder/tpl_model.c
+++ b/av1/encoder/tpl_model.c
@@ -1307,6 +1307,9 @@
                                bd_info.bit_depth, update_type, base_qindex) /
                            6;
 
+  if (cpi->use_ducky_encode)
+    tpl_frame->base_rdmult = gf_group->rdmult_val[frame_idx];
+
   av1_init_tpl_txfm_stats(tpl_txfm_stats);
 
   // Initialize x->mbmi_ext when compound predictions are enabled.
diff --git a/av1/qmode_rc/ducky_encode.cc b/av1/qmode_rc/ducky_encode.cc
index 74bbf8a..48eaa9b 100644
--- a/av1/qmode_rc/ducky_encode.cc
+++ b/av1/qmode_rc/ducky_encode.cc
@@ -367,6 +367,7 @@
     gf_group->frame_type[i] = !frame.is_key_frame;
 
     gf_group->q_val[i] = gop_encode_info.param_list[i].q_index;
+    gf_group->rdmult_val[i] = gop_encode_info.param_list[i].rdmult;
 
     gf_group->cur_frame_idx[i] = 0;
     gf_group->arf_src_offset[i] = frame.order_idx - frame.display_idx;