Adding mcs_tbs_idx table

This commit is contained in:
Paul Sutton 2015-10-30 13:42:46 +00:00
parent ed87963d39
commit ee91d27b49
3 changed files with 16 additions and 0 deletions

View file

@ -219,6 +219,8 @@ SRSLTE_API int srslte_ul_dci_to_grant_prb_allocation(srslte_ra_ul_dci_t *dci,
uint32_t n_rb_ho,
uint32_t nof_prb);
SRSLTE_API int srslte_ra_tbs_idx_from_mcs(uint32_t mcs);
SRSLTE_API int srslte_ra_tbs_from_idx(uint32_t tbs_idx,
uint32_t n_prb);

View file

@ -549,6 +549,15 @@ uint32_t srslte_ra_type2_n_vrb_dl(uint32_t nof_prb, bool ngap_is_1) {
}
}
/* Modulation and TBS index table for PDSCH from 3GPP TS 36.213 v10.3.0 table 7.1.7.1-1 */
int srslte_ra_tbs_idx_from_mcs(uint32_t mcs) {
if(mcs < 29) {
return mcs_tbs_idx_table[mcs];
} else {
return SRSLTE_ERROR;
}
}
/* Table 7.1.7.2.1-1: Transport block size table on 36.213 */
int srslte_ra_tbs_from_idx(uint32_t tbs_idx, uint32_t n_prb) {
if (tbs_idx < 27 && n_prb > 0 && n_prb <= SRSLTE_MAX_PRB) {

View file

@ -4,6 +4,11 @@ const int tbs_format1c_table[32] = {
552, 600, 632, 696, 776, 840, 904, 1000, 1064, 1128, 1224, 1288, 1384, 1480, 1608, 1736
};
/* Modulation and TBS index table for PDSCH from 3GPP TS 36.213 v10.3.0 table 7.1.7.1-1 */
const int mcs_tbs_idx_table[29] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
9, 10, 11, 12, 13, 14, 15, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26};
/* Transport Block Size from 3GPP TS 36.213 v10.3.0 table 7.1.7.2.1-1 */
const int tbs_table[27][110] = {{ 16, 32, 56, 88, 120, 152, 176, 208, 224, 256, 288,