diff --git a/srsenb/src/stack/mac/sched_phy_ch/sched_dci.cc b/srsenb/src/stack/mac/sched_phy_ch/sched_dci.cc index 2f368d3d3..d1fe66035 100644 --- a/srsenb/src/stack/mac/sched_phy_ch/sched_dci.cc +++ b/srsenb/src/stack/mac/sched_phy_ch/sched_dci.cc @@ -94,9 +94,7 @@ tbs_info compute_mcs_and_tbs(uint32_t nof_prb, assert((is_ul or not ulqam64_enabled) && "DL cannot use UL-QAM64 enable flag"); uint32_t max_Qm = (is_ul) ? (ulqam64_enabled ? 6 : 4) : (use_tbs_index_alt ? 8 : 6); - if (!is_ul) { - max_coderate = std::min(max_coderate, 0.930F * max_Qm); - } + max_coderate = std::min(max_coderate, 0.930F * max_Qm); int mcs = 0; do { @@ -125,9 +123,7 @@ tbs_info compute_mcs_and_tbs(uint32_t nof_prb, // update max coderate based on mcs srsran_mod_t mod = (is_ul) ? srsran_ra_ul_mod_from_mcs(mcs) : srsran_ra_dl_mod_from_mcs(mcs, use_tbs_index_alt); uint32_t Qm = srsran_mod_bits_x_symbol(mod); - if (!is_ul) { - max_coderate = std::min(0.930F * Qm, max_coderate); - } + max_coderate = std::min(0.930F * Qm, max_coderate); if (coderate <= max_coderate) { // solution was found @@ -155,7 +151,7 @@ tbs_info compute_min_mcs_and_tbs_from_required_bytes(uint32_t nof_prb, { // get max MCS/TBS that meets max coderate requirements tbs_info tb_max = compute_mcs_and_tbs(nof_prb, nof_re, cqi, max_mcs, is_ul, ulqam64_enabled, use_tbs_index_alt); - if (tb_max.tbs_bytes + 8 <= (int)req_bytes or tb_max.mcs == 0 or req_bytes <= 0) { + if (tb_max.tbs_bytes + 8 <= (int)req_bytes or tb_max.mcs == 0) { // if mcs cannot be lowered or a decrease in TBS index won't meet req_bytes requirement return tb_max; } diff --git a/srsenb/test/mac/sched_dci_test.cc b/srsenb/test/mac/sched_dci_test.cc index 0913b9ae6..d9c589d21 100644 --- a/srsenb/test/mac/sched_dci_test.cc +++ b/srsenb/test/mac/sched_dci_test.cc @@ -302,10 +302,10 @@ void test_ul_mcs_tbs_derivation() TESTASSERT(compute_tbs_mcs(50, 50 - 5).mcs == 9); cqi = 15; - TESTASSERT(compute_tbs_mcs(25, 25 - 4).mcs == 28); - TESTASSERT(compute_tbs_mcs(50, 50 - 5).mcs == 28); - TESTASSERT(compute_tbs_mcs(75, 75 - 5).mcs == 28); - TESTASSERT(compute_tbs_mcs(100, 100 - 5).mcs == 28); + TESTASSERT(compute_tbs_mcs(25, 25 - 4).mcs == 23); + TESTASSERT(compute_tbs_mcs(50, 50 - 5).mcs == 23); + TESTASSERT(compute_tbs_mcs(75, 75 - 5).mcs == 24); + TESTASSERT(compute_tbs_mcs(100, 100 - 5).mcs == 23); } } // namespace srsenb @@ -327,4 +327,4 @@ int main() printf("Success\n"); return 0; -} \ No newline at end of file +}