mirror of
https://github.com/aicodix/code.git
synced 2026-04-27 14:30:36 +00:00
align parity bits accordingly
if we want to use a crc aid at the end, we should move the start of the first parity bit as far as possible to the front, otherwise we want the last bit to be a parity bit
This commit is contained in:
parent
e83dbce91f
commit
f3d3afbe01
2 changed files with 9 additions and 6 deletions
|
|
@ -20,10 +20,10 @@ class PolarParityEncoder
|
|||
return (bits[idx/32] >> (idx%32)) & 1;
|
||||
}
|
||||
public:
|
||||
void operator()(TYPE *codeword, const TYPE *message, const uint32_t *frozen, int level, int stride)
|
||||
void operator()(TYPE *codeword, const TYPE *message, const uint32_t *frozen, int level, int stride, int first)
|
||||
{
|
||||
int length = 1 << level;
|
||||
int count = stride;
|
||||
int count = first;
|
||||
TYPE parity = PH::one();
|
||||
for (int i = 0; i < length; i += 2) {
|
||||
TYPE msg0, msg1;
|
||||
|
|
@ -345,7 +345,7 @@ class PolarParityDecoder
|
|||
TYPE hard[MAX_N];
|
||||
MAP maps[MAX_N];
|
||||
public:
|
||||
void operator()(PATH *metric, TYPE *message, const VALUE *codeword, const uint32_t *frozen, int level, int stride)
|
||||
void operator()(PATH *metric, TYPE *message, const VALUE *codeword, const uint32_t *frozen, int level, int stride, int first)
|
||||
{
|
||||
assert(level <= MAX_M);
|
||||
int index = 0;
|
||||
|
|
@ -356,7 +356,7 @@ public:
|
|||
for (int i = 0; i < length; ++i)
|
||||
soft[length+i] = vdup<TYPE>(codeword[i]);
|
||||
TYPE parity = PH::one();
|
||||
int count = stride;
|
||||
int count = first;
|
||||
|
||||
switch (level) {
|
||||
case 5: PolarParityTree<TYPE, 5>::decode(metric, message, maps, &index, hard, soft, *frozen, &parity, &count, stride); break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue