From d4440d4cfab0e8ca855b3120ab92535f5df96330 Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Thu, 24 Nov 2011 16:04:58 +0100 Subject: core/conv: Really only consider error for non-zero soft values This should have been done with 1dd7c84733b20ba776510369e9daba1a822c5b44 but somehow was missed and only applied to the 'finish' method and not the 'scan' method. Signed-off-by: Sylvain Munaut --- src/conv.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/conv.c') diff --git a/src/conv.c b/src/conv.c index 00a5532d..7a8be8ca 100644 --- a/src/conv.c +++ b/src/conv.c @@ -310,9 +310,12 @@ osmo_conv_decode_scan(struct osmo_conv_decoder *decoder, m = 1 << (code->N - 1); /* mask for 'out' bit selection */ for (j=0; jN; j++) { - ov = (out & m) ? -127 : 127; /* sbit_t value for it */ - e = ((int)in_sym[j]) - ov; /* raw error for this bit */ - nae += (e * e) >> 9; /* acc the squared/scaled value */ + int is = (int)in_sym[j]; + if (is) { + 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 */ } -- cgit v1.2.3