mirror of
https://github.com/aicodix/code.git
synced 2026-04-27 14:30:36 +00:00
use the non-recursive 1011011 poly
This commit is contained in:
parent
9e085cc2fd
commit
77c46caa42
2 changed files with 12 additions and 8 deletions
|
|
@ -20,10 +20,12 @@ class PACEncoder
|
||||||
}
|
}
|
||||||
static bool conv(int *state, bool input)
|
static bool conv(int *state, bool input)
|
||||||
{
|
{
|
||||||
bool s1 = *state & 1;
|
bool b1 = (*state >> 1) & 1;
|
||||||
bool s2 = *state & 2;
|
bool b3 = (*state >> 3) & 1;
|
||||||
bool output = input ^ s1 ^ s2;
|
bool b4 = (*state >> 4) & 1;
|
||||||
*state = (s1 << 1) | output;
|
bool b6 = (*state >> 6) & 1;
|
||||||
|
bool output = input ^ b1 ^ b3 ^ b4 ^ b6;
|
||||||
|
*state = ((*state & 126) << 1) | (input ? 2 : 0) | (output ? 1 : 0);
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -41,10 +41,12 @@ struct PACListNode<TYPE, 0>
|
||||||
typedef typename PH::MAP MAP;
|
typedef typename PH::MAP MAP;
|
||||||
static bool conv(int *state, bool input)
|
static bool conv(int *state, bool input)
|
||||||
{
|
{
|
||||||
bool s1 = *state & 1;
|
bool b1 = (*state >> 1) & 1;
|
||||||
bool s2 = *state & 2;
|
bool b3 = (*state >> 3) & 1;
|
||||||
bool output = input ^ s1 ^ s2;
|
bool b4 = (*state >> 4) & 1;
|
||||||
*state = (s1 << 1) | output;
|
bool b6 = (*state >> 6) & 1;
|
||||||
|
bool output = input ^ b1 ^ b3 ^ b4 ^ b6;
|
||||||
|
*state = ((*state & 126) << 1) | (input ? 2 : 0) | (output ? 1 : 0);
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
static MAP rate0(PATH *metric, TYPE *hard, TYPE *soft)
|
static MAP rate0(PATH *metric, TYPE *hard, TYPE *soft)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue