let's try the reversed poly 1101101

This commit is contained in:
Ahmet Inan 2025-12-23 18:03:13 +01:00
commit 174f569cd9
2 changed files with 16 additions and 10 deletions

View file

@ -21,18 +21,21 @@ class PACEncoder
static bool conv(int *state, bool input) static bool conv(int *state, bool input)
{ {
#if 0 #if 0
// 1011011
bool b1 = (*state >> 1) & 1; bool b1 = (*state >> 1) & 1;
bool b3 = (*state >> 3) & 1; bool b3 = (*state >> 3) & 1;
bool b4 = (*state >> 4) & 1; bool b4 = (*state >> 4) & 1;
bool b6 = (*state >> 6) & 1; bool b6 = (*state >> 6) & 1;
bool output = input ^ b1 ^ b3 ^ b4 ^ b6; bool output = input ^ b1 ^ b3 ^ b4 ^ b6;
*state = ((*state & 126) << 1) | (input ? 2 : 0) | (output ? 1 : 0);
#else #else
bool s1 = *state & 1; // 1101101
bool s2 = *state & 2; bool b2 = (*state >> 2) & 1;
bool output = input ^ s1 ^ s2; bool b3 = (*state >> 3) & 1;
*state = (s1 << 1) | output; bool b5 = (*state >> 5) & 1;
bool b6 = (*state >> 6) & 1;
bool output = input ^ b2 ^ b3 ^ b5 ^ b6;
#endif #endif
*state = ((*state & 126) << 1) | (input ? 2 : 0) | (output ? 1 : 0);
return output; return output;
} }
public: public:

View file

@ -20,18 +20,21 @@ struct PACListLeaf
static bool conv(int *state, bool input) static bool conv(int *state, bool input)
{ {
#if 0 #if 0
// 1011011
bool b1 = (*state >> 1) & 1; bool b1 = (*state >> 1) & 1;
bool b3 = (*state >> 3) & 1; bool b3 = (*state >> 3) & 1;
bool b4 = (*state >> 4) & 1; bool b4 = (*state >> 4) & 1;
bool b6 = (*state >> 6) & 1; bool b6 = (*state >> 6) & 1;
bool output = input ^ b1 ^ b3 ^ b4 ^ b6; bool output = input ^ b1 ^ b3 ^ b4 ^ b6;
*state = ((*state & 126) << 1) | (input ? 2 : 0) | (output ? 1 : 0);
#else #else
bool s1 = *state & 1; // 1101101
bool s2 = *state & 2; bool b2 = (*state >> 2) & 1;
bool output = input ^ s1 ^ s2; bool b3 = (*state >> 3) & 1;
*state = (s1 << 1) | output; bool b5 = (*state >> 5) & 1;
bool b6 = (*state >> 6) & 1;
bool output = input ^ b2 ^ b3 ^ b5 ^ b6;
#endif #endif
*state = ((*state & 126) << 1) | (input ? 2 : 0) | (output ? 1 : 0);
return output; return output;
} }
static MAP rate0(PATH *metric, int *state, TYPE *hard, TYPE *soft) static MAP rate0(PATH *metric, int *state, TYPE *hard, TYPE *soft)