Commit Graph

12 Commits

Author SHA1 Message Date
Sylvain Munaut d5974e9155 conv: Fix the traceback for tail biting codes
When picking the end state, looking only at the path metric
is highly suboptimal because in a tail biting code, we _know_ that
whatever treillis path is correct, it must start and end at the same
state. So we only consider path meeting that condition. We know any
path that doesn't isn't the right one. We only fallback to only
path metric if no path met that condition.

Fixes OS#4508

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I87e51d3880c0fe7bf3d6cd08fd46517a424a230c
2022-01-05 20:24:49 +00:00
Oliver Smith 04bfb7165b treewide: remove FSF address
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.

Change-Id: I5050285e75cf120407a1d883e99b3c4bcae8ffd7
2021-12-14 12:44:03 +01:00
Eric Wild 3afc1d1777 libomsocoding: NEON viterbi acceleration
configure flag required to enable this: --enable-neon

Although autodetection according to __ARM_NEON would work because this
is only defined if the fpu is neon neon-fp16 neon-vfpv3 neon-vfpv4
neon-fp-armv8 crypto-neon-fp-armv8 doing that would lead to a unknown
performance impact, so it needs to be enabled manually.

Speedup is about ~1.3-1.5 on a unspecified single core Cortex A9. This
requires handling a special case for RACH with len 14 which is far too
short for neon and would actually incur a performance penalty of 25%.

Related: OS#4585
Change-Id: I58ff2cb4ce3514f43390ff0a2121f81e6a4983b5
2020-08-06 16:47:40 +00:00
Harald Welte b93f60f7cd conv_acc: Our code requires SSSE3, not just SSE3
The accelerated convolutional decoder uses SSSE3 instructions such
as PSIGNW (via _mm_sign_epi16) which go beyond what SSE3 offers.  So
let's make sure we use the right compiler flag (-mssse3) and also the
right runtime check.

Without this patch, we would use illegal instructions e.g. on Opteron
Gen3 such as Opteron 2427, which are also used as build.opensuse.org
build hosts (build31 through build36) where we wouldn't pass "make
check" as a result.

Change-Id: I2754164384109f2821fd98ffb48f625893f2923d
Fixes: OS#2386
2017-11-17 11:44:22 +01:00
Harald Welte e08da97570 Fix/Update copyright notices; Add SPDX annotation
Let's fix some erroneous/accidential references to wrong license,
update copyright information where applicable and introduce a
SPDX-License-Identifier to all files.

Change-Id: I39af26c6aaaf5c926966391f6565fc5936be21af
2017-11-13 01:35:12 +09:00
Neels Hofmeyr 17518fe393 doxygen: unify use of \file across the board
Considering the various styles and implications found in the sources, edit
scores of files to follow the same API doc guidelines around the doxygen
grouping and the \file tag.

Many files now show a short description in the generated API doc that was so
far only available as C comment.

The guidelines and reasoning behind it is documented at
https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation

In some instances, remove file comments and add to the corresponding group
instead, to be shared among several files (e.g. bitvec).

Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b
2017-06-23 00:18:23 +00:00
Vadim Yanitskiy 0876ef899e core/conv/conv_acc.c: use static allocation for trellis
Allocation of a new memory is an expensive operation, which
takes place when it's initially unknown, how much memory will
we need, or in order to decrease total memory usage.

The trellis struct wasn't require dynamic allocation itself,
so let's allocate one statically inside the vdecoder structure.

Change-Id: Ib8e448823ca5548a05a45824b0b1c06743dfe5a4
2017-06-19 14:35:22 +00:00
Vadim Yanitskiy 1ac56fb292 core/conv/conv_acc.c: use static allocation for vdecoder
Allocation of a new memory is an expensive operation, which
takes place when it's initially unknown, how much memory will
we need, or in order to decrease total memory usage.

The vdecoder struct wasn't require dynamic allocation itself,
so let's use static allocation in order to increase performance.

Change-Id: Id1b140d3cb61db7352dcfc217a8fc36091e945ab
2017-06-19 14:35:22 +00:00
Vadim Yanitskiy 34da6b5f47 core/conv/conv_acc.c: delete reset_decoder()
Currently this implementation exposes nothing than
osmo_conv_decode_acc(), so it wasn't possible to call
reset_decoder() from outside.

The method itself was used to initialize accumulated
path metrics and the starting state of encoder. Now
this code is moved to generate_trellis().

Moreover, setting accumulated path metrics inside
existing loop is a bit faster that calling memset().

Change-Id: I8f17cebf468cf0106927ccee091cfb2896649cb2
2017-06-19 14:35:22 +00:00
Vadim Yanitskiy 23d3bc01ea core/conv/conv_acc.c: drop unused structure member
Change-Id: I81f7c35abf424f501ca53d6984c0d56f7936984b
2017-06-19 14:35:22 +00:00
Vadim Yanitskiy 46e533c13a core/conv: update description headers for conv_acc_*
Change-Id: I00154776c8e7d346abcbaf9048ce04d9488bb458
2017-06-19 14:35:21 +00:00
Vadim Yanitskiy e4fe71c04f core/conv: use proper filenames
We already have generic convolutional transcoding implementation
written by Sylvain Munaut and named 'conv.c', so 'viterbi_*' names
looked a bit confusing.

Let's use a single naming scheme for Viterbi related code.

Change-Id: I61062a8d1fbf5f5fc85b4fac58dc4e9fa8b5ef90
2017-06-19 14:35:21 +00:00