Commit Graph

28 Commits

Author SHA1 Message Date
Alexander Chemeris 50f7d74fca coding: Always initialize bit counters in gsm0503_pdtch_egprs_decode().
Previsouly there were a lot of valid code paths which returned from the function
before setting bit counters which led to bogus BER output in osmo-bts-trx logs
when those code paths were hit.

Change-Id: I4722cae3794ccbb12001113c991d9cf345a52a96
2018-09-05 16:08:34 +03:00
Alexander Chemeris 9444326158 coding: Correctly count bits when decoding EDGE bursts with MCS >= 7.
They consist of two blocks, so we should count both blocks.

Change-Id: I560de192212dae4705054a1665726369b83d213a
2018-09-05 16:08:16 +03:00
Pau Espin 924ef0bc72 Bump version: 0.11.0.91-9d4a3-dirty → 0.12.0
Change-Id: I7e66432f37e13fd4c31389e3d89593fa0981e58f
2018-07-27 17:31:47 +02:00
Pau Espin f81d03f7dd libosmocoding: clarify return values for TCH decoding functions
Change-Id: I7d6c61e6a1b5d1fae26f385b420ff55246c4b62f
2018-07-19 18:30:07 +02:00
Alexander Chemeris ed7d2ddb15 coding: Documentation typo fix.
Change-Id: I6ca873b3decaf50e7b79b5ab2269919c862a4fe0
2018-07-14 21:12:47 +02:00
Alexander Chemeris 147051f1a1 coding: Fix (E)GPRS BER calculation to correctly account for puncturing.
Previously we didn't take into account puncturing and BER was always around
30% for GPRS/EDGE bursts because of they use puncturing coding unlike
"classical" GSM bursts.

Change-Id: I9da22e7051522d06d923fcec3b63cbed8db93910
2018-07-14 21:12:46 +02:00
Pau Espin 13154ffabd Bump version: 0.10.2.284-bc47-dirty → 0.11.0
Remark: For libosmogb and libosmogsm, LIBVERSION was
already bumped in c4fce1425e.

Change-Id: Ib4fa53a9bb9954ae48d0a610ba9a81dd8e8b4ef6
2018-05-03 15:47:11 +02:00
Harald Welte 6950b191e8 coding: Add BER-reporting RACH decode functions
For all other decode operations we report the BER, but not for the
RACH.  This results in osmo-bts-trx not being able to report BER
to the higher layers, which is possible on other BTS backends.

Let's close this gap by introducing gsm0503_rach_ext_decode_ber()
and gsm0503_rach_decode_ber() with the usual n_errors / n_bits_total
arguments.

Change-Id: I2b1926a37bde860dcfeb0d613eb55a71271928c5
2018-02-26 12:26:38 +01:00
Vadim Yanitskiy a55fe9f322 libosmocoding: use frame length definitions from codec.h
Since commit e094157e12, TCH frame
length definitions were added to libosmocodec.
No need to define them again.

Change-Id: Id8c6132534e36ea1e368432bb259fd4f3a531f90
2018-01-24 09:17:37 +00:00
Vadim Yanitskiy 9a232fd91b libosmocoding: fix typo in library documentation
Change-Id: I535d4eba5bad9094a1e9e662f32cd2bfac5b0cef
2018-01-23 18:16:02 +00:00
Max e1a511b031 coding: move eB adjustement to appropriate place
As a leftover from code move from OsmoBTS we have eB adjustement outside
of eB check in gsm0503_tch_burst_map() which is rightfully noted by
Coverity. Let's fix this by moving the adjustement under the
corresponding if.

Change-Id: I385cd6ffea4d13ef911910fc87c92b73809888a2
Fixes: CID57691
2018-01-05 10:12:35 +00:00
Max 32e5641dbb Add functions for extended RACH coding
Add support for extended RACH (11 bit) according 3GPP TS 45.003 §5.3.2:

* convolutional code with puncturing
* encoding/decoding routines
* corresponding tests

Change-Id: I85a34a82d5cd39a594ee89d91a2338226066ab5d
Related: OS#1548
2017-12-11 10:36:47 +00: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
Niro Mahasinghe c526dbc24f gsm0503_coding.c: Use majority vote in tch_efr_unreorder()
The EFR coding contains some repeated bits.  In case there are
transmission errors, some bits may of course get corrupted.  It looks
like there's an improvement can be made by taking a majority vote on
those "repetition bits", i.e. if 2 out of 3 bits are the same, then use
that instead of expecting to match all 3 bits.

See 3GPP TS 45.003 Section 3.1.1.3 for reference.

Change-Id: I2a28a4d7fb82aed4d39fe8efeea702effdba3858
2017-11-03 13:03:57 +01:00
Niro Mahasinghe 834e2ac0ea gsm0503_coding.c: Fix tch_efr_unreorder() of one bit
There's an error in tch_efr_unreorder() function in gsm0503_coding.c
that results in increased RBER. One of the indices used by repetition
bit recombining in this function doesn't match 3GPP TS 45.003 section
3.1.1.3, specifically "w(k) = s(223) for k = 231 and 232".

This bug resulted in RBER even under ideal conditions, with no
fading or AWGN present.

Change-Id: I153da7bbc1bb3e01ed31eb5a7417e90841cfcde3
2017-11-03 13:03:55 +01:00
Vadim Yanitskiy 272bd4fa66 Makefile.am: fix missing LTLDFLAGS for libosmocoding
Despite the libosmocoding.map is preset since the library release,
one was not used in a proper way. The LTLDFLAGS were missing, so
let's add them.

Change-Id: Idf677825ff642d50bea43c7f970810783e864fdd
2017-08-31 17:53:04 +07: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
Neels Hofmeyr 87e4550585 doxygen: enable AUTOBRIEF, drop \brief
Especially for short descriptions, it is annoying to have to type \brief for
every single API doc.

Drop all \brief and enable the AUTOBRIEF feature of doxygen, which always takes
the first sentence of an API doc as the brief description.

Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87
2017-06-23 00:18:22 +00:00
Max dd75bacb78 Move NUM_BYTES macro to core library
It's universally useful so it make sense to have it in the shared core:
* move macro from libosmocoding to libosmocore
* add OSMO_ prefix
* add doxygen docs

Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02
2017-06-19 11:09:09 +02:00
Harald Welte 2f984ea194 gsm0503_coding: Mark gsm0503_mcs_{ul,dl}_codes as const
The table describing the various MCS convolutional codes are constant
data and should be marked as such.

Change-Id: I4918521ee4572a67cbee5f9b49257fc5bfcde511
2017-06-12 15:35:27 +02:00
Harald Welte 0eb2c5dab2 gsm0503_interleaving: Mark input arguments as 'const *'
The interleaving/deinterleaving functions were missing 'const'
qualifiers on their input data buffers

Change-Id: I2118c34a6353167787b23f877f1d81d60151aaf9
2017-06-12 15:35:27 +02:00
Harald Welte c663678b26 Add doxygen documentation to libosmocoding
This adds the minimum amount of API documentation that we should have on
all our code, particularly new code merged into a library.

Change-Id: I526804f64313867913574e50e5b9e9205ad3aa74
2017-06-12 15:35:23 +02:00
Harald Welte b9946d372c gsm0503_{coding,mapping}: Mark input arguments as 'const'
It is generally our coding style to mark pointers to constant input data
as 'const *'.  For some reason the gsm0503 coding and mapping was not
adhering to this, so let's bring it into compliance.

Change-Id: Id8731d7ae6171dff94741b6ddbb95ab5f03bfd4e
2017-06-12 12:59:21 +02:00
Max c8cf820595 Distinguish between unsupported and invalid MCS
Previously MCS0 was incorrectly set for some of type1 header values
while according to 3GPP TS 44.060 it can only be set for type3. Fix
this:

* use EGPRS_MCS* constants instead of magic values
* do not set MCS0 for reserved bits values in EGPRS header type1
* return different error codes for invalid and unsupported MCS as well
  as for other decoding errors

Note: there's no need to adjust tests because MCS0 decoding is not
supported but it's better to explicitly distinguish between unsupported
and invalid values nevertheless.

Change-Id: Id665d5c0cf50efa18b1bcbf4f17359418a380f9e
Related: OS#1524
2017-05-24 22:12:56 +00:00
Harald Welte 898ffefde4 add libpseudotalloc as super-simplistic talloc replacement
In tightly embedded builds (--enable-embedded), we want the ability to
replace talloc with a very simple heap allocator to avoid the complexity
of talloc without modifying all our code that assumes talloc.

This will break the hierarchical notion of the allocator, but
libosmo{core,gsm,coding,codec} don't rely on that anyway.

Change-Id: Ie341034076f242a813f081919dd09d845775ad35
2017-05-17 15:15:52 +01:00
Neels Hofmeyr 9b22686134 build: coding/gsm0503: fix build in sep. dir: -I builddir
To allow building coding/gsm0503_interleaving.c which includes the generated
bit*gen.h (via bits.h), add -I to the builddir include path in order to find
the generated bit*gen.h headers there.

Change-Id: I0d465bc109765b1315d615243bea6af027afa368
2017-03-20 12:32:43 +00:00
Neels Hofmeyr 6d0fd7ba97 build: cosmetic: coding: break a CPPFLAGS line
Matches our general scheme and helps readability of an upcoming patch.

Change-Id: I174086a988b51b6e80f3661609069b69a3d41cc7
2017-03-13 14:49:12 +01:00
Vadim Yanitskiy 3262f820b5 libosmocoding: migrate transcoding routines from OsmoBTS
There are some projects, such as GR-GSM and OsmocomBB, which would
benefit from using one shared implementation of GSM 05.03 code. So,
this commit introduces a new sub-library called libosmocoding, which
(for now) provides GSM, GPRS and EDGE transcoding routines, migrated
from OsmoBTS.

The original GSM 05.03 code from OsmoBTS was relicensed under
GPLv2-or-later with permission of copyright holders (Andreas Eversberg,
Alexander Chemeris and Tom Tsou).

The following data types are currently supported:

 - xCCH
 - PDTCH (CS 1-4 and MCS 1-9)
 - TCH/FR
 - TCH/HR
 - TCH/AFS
 - RCH/AHS
 - RACH
 - SCH

Change-Id: I0c3256b87686d878e4e716d12393cad5924fdfa1
2017-03-07 01:06:38 +07:00