fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/33649 )
Change subject: coding: remove redundant memset()s in gsm0503_tch_fr{96,144}_encode() ......................................................................
coding: remove redundant memset()s in gsm0503_tch_fr{96,144}_encode()
Convolutional codes terminated with CONV_TERM_FLUSH (the default) always append k-1 zeroes at the end to "flush" the encoder state. This is the case for both TCH/F9.6 and TCH/F14.4.
Change-Id: I4a77ecb9af72b2fd4ea92c42d6748879e73d2cf2 Related: OS#1572 --- M src/coding/gsm0503_coding.c 1 file changed, 16 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/49/33649/1
diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 1249ce9..3faa512 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -3322,7 +3322,7 @@
/* 3.3.2 Block code: b1(60) + b2(60) + b3(60) + b4(60) + pad(4) */ memcpy(&conv[0], &data[0], 4 * 60); - memset(&conv[240], 0, 4); + /* pad(4) is set to 0 by osmo_conv_encode() below */
/* 3.3.3 Convolutional encoder */ osmo_conv_encode(&gsm0503_tch_f96, &conv[0], &cB[0]); @@ -3543,7 +3543,7 @@
/* 3.8.2 Block code: b(290) + pad(4) */ memcpy(&conv[0], &data[0], 290); - memset(&conv[290], 0, 4); + /* pad(4) is set to 0 by osmo_conv_encode() below */
/* 3.8.3 Convolutional encoder */ osmo_conv_encode(&gsm0503_tch_f144, &conv[0], &cB[0]);