mirror of https://gerrit.osmocom.org/libosmocore
core/conv: Only consider error for non-zero soft values
If the input value is '0' it should not really affect the error since it's just an indecisive bit. We accept this either an internal '0' (generated via puncture) or as an external '0' (generated via an external puncturing scheme). A real received bit should never be '0', it's always gonna be closer to 1 or the other value ... (thanks to mad@auth.se on the ML for the idea) Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
parent
19dc5c9cca
commit
1dd7c84733
|
@ -389,9 +389,12 @@ osmo_conv_decode_finish(struct osmo_conv_decoder *decoder,
|
||||||
m = 1 << (code->N - 1); /* mask for 'out' bit selection */
|
m = 1 << (code->N - 1); /* mask for 'out' bit selection */
|
||||||
|
|
||||||
for (j=0; j<code->N; j++) {
|
for (j=0; j<code->N; j++) {
|
||||||
ov = (out & m) ? -127 : 127; /* sbit_t value for it */
|
int is = (int)in_sym[j];
|
||||||
e = ((int)in_sym[j]) - ov; /* raw error for this bit */
|
if (is) {
|
||||||
nae += (e * e) >> 9; /* acc the squared/scaled value */
|
ov = (out & m) ? -127 : 127; /* sbit_t value for it */
|
||||||
|
e = is - ov; /* raw error for this bit */
|
||||||
|
nae += (e * e) >> 9; /* acc the squared/scaled value */
|
||||||
|
}
|
||||||
m >>= 1; /* next mask bit */
|
m >>= 1; /* next mask bit */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue