Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常顺宇
OpenXG-RAN
Commits
5420e740
Commit
5420e740
authored
Apr 01, 2020
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Efficient RB estimation through binary search
parent
8ffe5b49
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
openair1/PHY/LTE_TRANSPORT/lte_mcs.c
openair1/PHY/LTE_TRANSPORT/lte_mcs.c
+29
-0
openair1/PHY/LTE_TRANSPORT/transport_common_proto.h
openair1/PHY/LTE_TRANSPORT/transport_common_proto.h
+2
-0
No files found.
openair1/PHY/LTE_TRANSPORT/lte_mcs.c
View file @
5420e740
...
...
@@ -94,6 +94,35 @@ unsigned char I_TBS2I_MCS(unsigned char I_TBS) {
return
I_MCS
;
}
uint16_t
find_nb_rb_DL
(
uint8_t
mcs
,
uint32_t
bytes
,
uint16_t
nb_rb_max
,
uint16_t
rb_gran
)
{
if
(
bytes
==
0
||
mcs
>
28
||
nb_rb_max
==
0
)
return
0
;
const
uint32_t
bits
=
bytes
<<
3
;
const
unsigned
char
I_TBS
=
get_I_TBS
(
mcs
);
uint32_t
TBS
=
TBStable
[
I_TBS
][
nb_rb_max
-
1
];
if
(
bits
>=
TBS
)
// is nb_rb_max too small?
return
nb_rb_max
;
TBS
=
TBStable
[
I_TBS
][
rb_gran
-
1
];
if
(
bits
<=
TBS
)
// is rb_gran RB enough?
return
rb_gran
;
nb_rb_max
+=
nb_rb_max
%
rb_gran
;
// round up to full RBG
uint16_t
hi
=
nb_rb_max
/
rb_gran
-
1
;
uint16_t
lo
=
0
;
uint16_t
p
=
(
hi
+
lo
)
/
2
;
for
(;
lo
+
1
!=
hi
;
p
=
(
hi
+
lo
)
/
2
)
{
const
uint16_t
rbi
=
(
p
+
1
)
*
rb_gran
-
1
;
// convert "RBG" -> RB
TBS
=
TBStable
[
I_TBS
][
rbi
];
if
(
bits
<=
TBS
)
// need less RBs
hi
=
p
;
else
// need more RBs
lo
=
p
;
}
return
(
hi
+
1
)
*
rb_gran
;
}
uint32_t
get_TBS_DL
(
uint8_t
mcs
,
uint16_t
nb_rb
)
{
uint32_t
TBS
;
...
...
openair1/PHY/LTE_TRANSPORT/transport_common_proto.h
View file @
5420e740
...
...
@@ -60,6 +60,8 @@ unsigned char get_I_TBS_UL(unsigned char I_MCS);
@return Transport block size */
uint32_t
get_TBS_DL
(
uint8_t
mcs
,
uint16_t
nb_rb
);
uint16_t
find_nb_rb_DL
(
uint8_t
mcs
,
uint32_t
bytes
,
uint16_t
nb_rb_max
,
uint16_t
rb_gran
);
/** \brief Compute Q (modulation order) based on uplink I_MCS. Implements table 7.1.7.1-1 from 36.213.
@param I_MCS
@param nb_rb
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment