Commit ad5e37e1 authored by Kevin JOLY's avatar Kevin JOLY

Update MS flooded decoder

- Breakdown minLLR and sign computation loop
parent 46807398
......@@ -102,21 +102,27 @@ void CDecoder_MS_fixed_flooded::decode(
int cn_offset = cn_idx*cn_deg_max;
char signGlobal = -1;
char minLLR1 = 127;
char minLLR2 = 127;
char abs[DEG_1];
/* We compute a different estimate (the message sent), for each
* neighbouring VN */
for(size_t edge_idx = 0; edge_idx < DEG_1; edge_idx++) {
char sign = -1;
char minLLR = 127;
/* TODO JKI : compute global sign and minLLR */
for(size_t other_edge_idx = 0; other_edge_idx < DEG_1; other_edge_idx++) {
if(other_edge_idx == edge_idx) continue;
char msg = *p_vn_addr[cn_offset + other_edge_idx];
char abs_msg = (msg >= 0 ? msg : -msg);
sign *= (msg >= 0) ? -1 : 1;
minLLR = minLLR > abs_msg ? abs_msg : minLLR;
}
_cn_msgs[cn_offset + edge_idx] = (sign * minLLR);
char msg = *p_vn_addr[cn_offset + edge_idx];
signGlobal *= (msg >= 0) ? -1 : 1;
abs[edge_idx] = (msg >= 0 ? msg : -msg);
char tmp = minLLR1;
minLLR1 = minLLR1 < abs[edge_idx] ? minLLR1 : abs[edge_idx];
minLLR2 = minLLR2 < abs[edge_idx] ? minLLR2 : abs[edge_idx] > tmp ? abs[edge_idx] : tmp;
}
for(size_t edge_idx = 0; edge_idx < DEG_1; edge_idx++) {
char sign = *p_vn_addr[cn_offset + edge_idx] >= 0 ? -signGlobal : signGlobal;
char min = abs[edge_idx] == minLLR1 ? minLLR2 : minLLR1;
_cn_msgs[cn_offset + edge_idx] = (sign * min);
}
}
......@@ -127,21 +133,27 @@ void CDecoder_MS_fixed_flooded::decode(
int cn_offset = cn_idx*cn_deg_max;
char signGlobal = -1;
char minLLR1 = 127;
char minLLR2 = 127;
char abs[DEG_2];
/* We compute a different estimate (the message sent), for each
* neighbouring VN */
for(size_t edge_idx = 0; edge_idx < DEG_2; edge_idx++) {
char sign = -1;
char minLLR = 127;
/* TODO JKI : compute global sign and minLLR */
for(size_t other_edge_idx = 0; other_edge_idx < DEG_2; other_edge_idx++) {
if(other_edge_idx == edge_idx) continue;
char msg = *p_vn_addr[cn_offset + other_edge_idx];
char abs_msg = (msg >= 0 ? msg : -msg);
sign *= (msg >= 0) ? -1 : 1;
minLLR = minLLR > abs_msg ? abs_msg : minLLR;
}
_cn_msgs[cn_offset + edge_idx] = (sign * minLLR);
char msg = *p_vn_addr[cn_offset + edge_idx];
signGlobal *= (msg >= 0) ? -1 : 1;
abs[edge_idx] = (msg >= 0 ? msg : -msg);
char tmp = minLLR1;
minLLR1 = minLLR1 < abs[edge_idx] ? minLLR1 : abs[edge_idx];
minLLR2 = minLLR2 < abs[edge_idx] ? minLLR2 : abs[edge_idx] > tmp ? abs[edge_idx] : tmp;
}
for(size_t edge_idx = 0; edge_idx < DEG_2; edge_idx++) {
char sign = *p_vn_addr[cn_offset + edge_idx] >= 0 ? -signGlobal : signGlobal;
char min = abs[edge_idx] == minLLR1 ? minLLR2 : minLLR1;
_cn_msgs[cn_offset + edge_idx] = (sign * min);
}
}
#else
......
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