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
wangwenhui
OpenXG-RAN
Commits
d056ae85
Commit
d056ae85
authored
Aug 22, 2018
by
yilmazt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor encoder fixes
parent
42d70a90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
+14
-9
No files found.
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
View file @
d056ae85
...
...
@@ -114,21 +114,24 @@ void polar_encoder_dci(uint32_t *in,
#ifdef DEBUG_POLAR_ENCODER_DCI
printf
(
"[polar_encoder_dci] crc: 0x%08x
\n
"
,
polarParams
->
crcBit
);
#endif
//(a to b)
//Using "nr_polar_aPrime" to hold "nr_polar_b".
uint8_t
arrayInd
=
ceil
(
polarParams
->
payloadBits
/
32
.
0
);
for
(
int
j
=
0
;
j
<
arrayInd
-
1
;
j
++
)
{
for
(
int
i
=
0
;
i
<
32
;
i
++
)
{
polarParams
->
nr_polar_B
[
i
+
j
*
32
]
=
(
in
[
j
]
>>
i
)
&
1
;
/*
* Bytewise operations
*/
uint8_t
arrayInd
=
ceil
(
polarParams
->
payloadBits
/
8
.
0
);
for
(
int
i
=
0
;
i
<
arrayInd
-
1
;
i
++
){
for
(
int
j
=
0
;
j
<
8
;
j
++
)
{
polarParams
->
nr_polar_B
[
j
+
(
i
*
8
)]
=
((
polarParams
->
nr_polar_aPrime
[
3
+
i
]
>>
(
7
-
j
))
&
1
);
}
}
for
(
int
i
=
0
;
i
<
((
polarParams
->
payloadBits
)
%
32
);
i
++
)
{
polarParams
->
nr_polar_B
[
i
+
(
arrayInd
-
1
)
*
32
]
=
(
in
[(
arrayInd
-
1
)]
>>
i
)
&
1
;
for
(
int
i
=
0
;
i
<
((
polarParams
->
payloadBits
)
%
8
);
i
++
)
{
polarParams
->
nr_polar_B
[
i
+
(
arrayInd
-
1
)
*
8
]
=
((
polarParams
->
nr_polar_aPrime
[
3
+
(
arrayInd
-
1
)]
>>
(
7
-
i
))
&
1
)
;
}
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
polarParams
->
nr_polar_B
[
polarParams
->
payloadBits
+
i
]
=
((
polarParams
->
crcBit
)
>>
(
31
-
i
))
&
1
;
}
//Scrambling
//Scrambling
(b to c)
for
(
int
i
=
0
;
i
<
16
;
i
++
)
{
polarParams
->
nr_polar_B
[
polarParams
->
payloadBits
+
8
+
i
]
=
(
(((
polarParams
->
crcBit
)
>>
(
23
-
i
))
&
1
)
+
((
n_RNTI
>>
(
15
-
i
))
&
1
)
)
%
2
;
...
...
@@ -175,8 +178,10 @@ void polar_encoder_dci(uint32_t *in,
*/
nr_byte2bit_uint8_32_t
(
polarParams
->
nr_polar_E
,
polarParams
->
encoderLength
,
out
);
#ifdef DEBUG_POLAR_ENCODER_DCI
printf
(
"[polar_encoder_dci] E: "
);
for
(
int
i
=
0
;
i
<
polarParams
->
encoderLength
;
i
++
)
printf
(
"%d-"
,
polarParams
->
nr_polar_E
[
i
]);
uint8_t
outputInd
=
ceil
(
polarParams
->
encoderLength
/
32
.
0
);
printf
(
"[polar_encoder_dci] out: "
);
printf
(
"
\n
[polar_encoder_dci] out: "
);
for
(
int
i
=
0
;
i
<
outputInd
;
i
++
)
{
printf
(
"[%d]->0x%08x
\t
"
,
i
,
out
[
i
]);
}
...
...
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