Commit 6c87295c authored by Kevin JOLY's avatar Kevin JOLY

Update MS flooded decoder

Set saturated values and use it in the code
parent cea540e6
......@@ -125,6 +125,8 @@ CDecoder* CreateDecoder(
} else if(type.compare("MS") == 0) {
if(format.compare("fixed") == 0 && arch.compare("flooded") == 0) {
CDecoder_MS_fixed_flooded *dec = new CDecoder_MS_fixed_flooded();
dec->setVarRange (vMin, vMax);
dec->setMsgRange (mMin, mMax);
return dec;
}
else {
......
......@@ -103,8 +103,8 @@ void CDecoder_MS_fixed_flooded::decode(
int cn_offset = cn_idx*cn_deg_max;
char signGlobal = 0;
char minLLR1 = 127;
char minLLR2 = 127;
char minLLR1 = vSAT_POS_MSG;
char minLLR2 = vSAT_POS_MSG;
char abs[DEG_1];
......@@ -120,7 +120,7 @@ void CDecoder_MS_fixed_flooded::decode(
}
#if (DEG_1 & 0x1)
signGlobal ^= 0x80;
signGlobal = ~signGlobal;
#endif
for(size_t edge_idx = 0; edge_idx < DEG_1; edge_idx++) {
......@@ -138,8 +138,8 @@ void CDecoder_MS_fixed_flooded::decode(
int cn_offset = cn_idx*cn_deg_max;
char signGlobal = 0;
char minLLR1 = 127;
char minLLR2 = 127;
char minLLR1 = vSAT_POS_MSG;
char minLLR2 = vSAT_POS_MSG;
char abs[DEG_2];
......@@ -155,7 +155,7 @@ void CDecoder_MS_fixed_flooded::decode(
}
#if (DEG_2 & 0x1)
signGlobal ^= 0x80;
signGlobal = ~signGlobal;
#endif
for(size_t edge_idx = 0; edge_idx < DEG_2; edge_idx++) {
......@@ -180,8 +180,8 @@ void CDecoder_MS_fixed_flooded::decode(
estimate_acc += *p_cn_addr[vn_idx*vn_deg_max + edge_idx];
}
if(estimate_acc > 127) _vn_est[vn_idx] = 127;
else if(estimate_acc < -127) _vn_est[vn_idx] = -127;
if(estimate_acc > vSAT_POS_VAR) _vn_est[vn_idx] = vSAT_POS_VAR;
else if(estimate_acc < vSAT_NEG_VAR) _vn_est[vn_idx] = vSAT_NEG_VAR;
else _vn_est[vn_idx] = (char)estimate_acc;
for(size_t edge_idx = 0; edge_idx < p_cn_addrSize[vn_idx]; edge_idx++)
......@@ -189,8 +189,8 @@ void CDecoder_MS_fixed_flooded::decode(
int msg = *p_cn_addr[vn_idx*vn_deg_max + edge_idx];
int vn_msg = estimate_acc - msg;
if(vn_msg > 127) _vn_msgs[vn_idx*vn_deg_max + edge_idx] = 127;
else if(vn_msg < -127) _vn_msgs[vn_idx*vn_deg_max + edge_idx] = -127;
if(vn_msg > vSAT_POS_VAR) _vn_msgs[vn_idx*vn_deg_max + edge_idx] = vSAT_POS_VAR;
else if(vn_msg < vSAT_NEG_VAR) _vn_msgs[vn_idx*vn_deg_max + edge_idx] = vSAT_NEG_VAR;
else _vn_msgs[vn_idx*vn_deg_max + edge_idx] = (char)vn_msg;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment